int main()
{
    robot_live(reset);
    robot_run(run);             /* never returns */

    return 0;
}
示例#2
0
int main()
{
	robot_live(reset);
	robot_run(run);             /* this function never returns */

	return 0;
}
void VirtualRobot::run() {

	// feed in the raw wall sensor input
	feedSensorData();

	// run the robot drive code
	robot_run(&robot);

	// calculate and update the new position
	int blockWidthPX = VirtualMaze::getBlockWidthPX();
	int offset = blockWidthPX / 2 - ROBOT_SIZE_PX / 2;

	int newX = blockWidthPX * robot.pos.x + offset;
	int newY = blockWidthPX * robot.pos.y + offset;
	rectangle->setPos(newX, newY);
}
示例#4
0
int main() {
  robot_live(reset); // controller initialization
  robot_run(run);    // controller start
  return 0;
}