38 #include <visp3/core/vpConfig.h>
39 #include <visp3/core/vpTime.h>
40 #include <visp3/robot/vpRobotPioneer.h>
42 #ifndef VISP_HAVE_PIONEER
45 std::cout <<
"\nThis example requires Aria 3rd party library. You should "
65 int main(
int argc,
char **argv)
68 std::cout <<
"\nWARNING: this program does no sensing or avoiding of "
70 "the robot WILL collide with any objects in the way! Make sure "
72 "robot has approximately 3 meters of free space on all sides.\n"
77 ArArgumentParser parser(&argc, argv);
78 parser.loadDefaultArguments();
82 ArRobotConnector robotConnector(&parser, &robot);
83 if (!robotConnector.connectRobot()) {
84 ArLog::log(ArLog::Terse,
"Could not connect to the robot.");
85 if (parser.checkHelpAndWarnUnparsed()) {
90 if (!Aria::parseArgs()) {
96 std::cout <<
"Robot connected" << std::endl;
102 for (
int i = 0; i < 100; i++) {
111 std::cout <<
"Trans. vel= " << v_mes[0] <<
" m/s, Rot. vel=" <<
vpMath::deg(v_mes[1]) <<
" deg/s" << std::endl;
113 std::cout <<
"Left wheel vel= " << v_mes[0] <<
" m/s, Right wheel vel=" << v_mes[1] <<
" m/s" << std::endl;
114 std::cout <<
"Battery=" << robot.getBatteryVoltage() << std::endl;
119 ArLog::log(ArLog::Normal,
"simpleMotionCommands: Stopping.");
126 ArLog::log(ArLog::Normal,
127 "simpleMotionCommands: Pose=(%.2f,%.2f,%.2f), Trans. "
128 "Vel=%.2f, Rot. Vel=%.2f, Battery=%.2fV",
129 robot.getX(), robot.getY(), robot.getTh(), robot.getVel(), robot.getRotVel(), robot.getBatteryVoltage());
132 std::cout <<
"Ending robot thread..." << std::endl;
136 robot.waitForRunExit();
139 ArLog::log(ArLog::Normal,
"simpleMotionCommands: Exiting.");
142 std::cout <<
"Catch an exception: " << e << std::endl;
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
static double deg(double rad)
Interface for Pioneer mobile robots based on Aria 3rd party library.
void useSonar(bool usage)
void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) vp_override
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT double measureTimeMs()