Added tracking functionality to robot code