Example program showing use of the original 5DOF P2 arm accessory.Demonstrates how to connect with the Pioneer 2 controller and set up the P2Arm class, including the ARMpac handler. It simply queries and prints the status of the arm, moving it to a position, then exits. Note, The P2Arm class is only for use with the microcontroller-integrated original 5DOF Pioneer 2 arm (Robotica arm). The newer Energid Cyton 7DOF arm is accessed through separate cyton libraries.
#include "Aria.h"
int main(int argc, char **argv)
{
{
return 1;
}
{
return 1;
}
{
return 1;
}
printf("Current joint info:\nJoint Vel Home Center\n");
{
printf(
" %2i: %5i %5i %5i\n", i, joint->
myVel, joint->
myHome, joint->
myCenter);
}
printf("\n");
printf("Powering on (takes a couple seconds to stabilize)\n");
printf("Current arm status:\n");
printf("Arm Status: ");
printf("Good=1 ");
else
printf("Good=0 ");
printf("Inited=1 ");
else
printf("Inited=0 ");
printf("Power=1 ");
else
printf("Power=0 ");
printf("Homing=1 ");
else
printf("Homing=0 ");
printf("\n\n");
printf("Moving Arm...\n");
int deploy_offset[] = {0, -100, 10, 40, 80, -55, 20};
{
arm.
moveToTicks(i, joint->myCenter + deploy_offset[i]);
}
bool moving = true;
while (moving)
{
moving = false;
printf("Joints: ");
{
{
printf("M; ");
moving = true;
}
else
{
printf("NM; ");
}
}
printf("\r");
}
printf("\n\n");
printf("Parking arm.\n");
{
}
printf("Shutting down ARIA and exiting.\n");
return(0);
}