Head tracking code for anti-robot