Uses ArActionGoto to drive the robot in a squareThis program will make the robot drive in a 2.5x2.5 meter square by setting each corner in turn as the goal for an ArActionGoto action. It also uses speed limiting actions to avoid collisions. After some time, it cancels the goal (and the robot stops due to a stopping action) and exits.
Press escape to shut down Aria and exit.
#include "Aria.h"
int main(int argc, char **argv)
{
printf("You may press escape to exit\n");
{
return 1;
}
{
printf("Could not connect to robot... exiting\n");
return 1;
}
const int duration = 30000;
ArLog::log(
ArLog::Normal,
"Going to four goals in turn for %d seconds, then cancelling goal and exiting.", duration/1000);
bool first = true;
int goalNum = 0;
{
{
first = false;
goalNum++;
if (goalNum > 4)
goalNum = 1;
if (goalNum == 1)
else if (goalNum == 2)
else if (goalNum == 3)
else if (goalNum == 4)
}
ArLog::log(
ArLog::Normal,
"%d seconds have elapsed. Cancelling current goal, waiting 3 seconds, and exiting.", duration/1000);
break;
}
}
return 0;
}