Example program demonstrating use of the Pioneer gripper.Shows how to control the Pioneer 2DOF gripper accessory. In addition to the arrow keys to teleoperate the robot, Use the following keyboard keys to control it: u Lift the gripper up d Lift the gripper down o Open the gripper c Close the gripper s Stop gripper movement.
- See also
- ArModeGripper (the gripper control mode used in the "demo" program)
#include "Aria.h"
class PrintGripStatus
{
public:
myGripper(gripper),
myPrintCB(this, &PrintGripStatus::printStatus)
{
}
{
}
void printStatus()
{
}
};
class GripperControlHandler
{
public:
myGripper(gripper),
myUpCB(this, &GripperControlHandler::liftUp),
myDownCB(this, &GripperControlHandler::liftDown),
myOpenCB(this, &GripperControlHandler::open),
myCloseCB(this, &GripperControlHandler::close),
myStopCB(this, &GripperControlHandler::stop)
{
}
void addKeyHandlers(
ArRobot *robot)
{
if(keyHandler == NULL)
{
}
}
void liftUp()
{
}
void liftDown()
{
}
void stop()
{
}
void close()
{
}
void open()
{
}
};
int main(int argc, char **argv)
{
{
return 1;
}
{
return 2;
}
{
return -1;
}
PrintGripStatus printStatus(&gripper);
GripperControlHandler gripControl(&gripper);
printStatus.addRobotTask(&robot);
gripControl.addKeyHandlers(&robot);
ArLog::log(
ArLog::Normal,
"You may now operate the robot with arrow keys or joystick. Operate the gripper with the u, d, o, c, and page up/page down keys.");
return 0;
}