/**
* Name:Circle
* Written by pt
* Compiler:Microsoft Visual C++
*/
#include <airobot/c/SimpleRobot.h>
//移动的速度
double moveVelocity;
//转动的速度
double turnVelocity;
/**
* 每个单位时间都会触发
*/
void onTick(struct TickAction* action)
{
//按moveVelocity速度移动
move(moveVelocity);
//按turnVelocity速度转动
turn(turnVelocity);
}
/**
* 当开始一轮新的比赛时触发
*/
void onRoundBegin(struct RoundBeginAction* action)
{
//初始化移动速度为5
moveVelocity = 5;
//初始化转动速度为3度
turnVelocity = toRadians(3);
}
/**
* 机器人程序入口
*/
int main(int argC, char* argV[])
{
tickHook = onTick;
roundBeginHook = onRoundBegin;
return startup(argC, argV);
}
(AI-TANK)走圆
最新推荐文章于 2019-11-29 00:56:54 发布