Some changes to updateRobotPosition.