36#include <visp3/core/vpConfig.h>
37#include <visp3/core/vpTime.h>
38#include <visp3/robot/vpRobotPioneer.h>
40#ifndef VISP_HAVE_PIONEER
43 std::cout <<
"\nThis example requires Aria 3rd party library. You should "
63int main(
int argc,
char **argv)
65#ifdef ENABLE_VISP_NAMESPACE
70 std::cout <<
"\nWARNING: this program does no sensing or avoiding of "
72 "the robot WILL collide with any objects in the way! Make sure "
74 "robot has approximately 3 meters of free space on all sides.\n"
79 ArArgumentParser
parser(&argc, argv);
80 parser.loadDefaultArguments();
84 ArRobotConnector robotConnector(&parser, &robot);
85 if (!robotConnector.connectRobot()) {
86 ArLog::log(ArLog::Terse,
"Could not connect to the robot.");
87 if (
parser.checkHelpAndWarnUnparsed()) {
92 if (!Aria::parseArgs()) {
98 std::cout <<
"Robot connected" << std::endl;
99 robot.useSonar(
false);
104 for (
int i = 0;
i < 100;
i++) {
113 std::cout <<
"Trans. vel= " << v_mes[0] <<
" m/s, Rot. vel=" <<
vpMath::deg(v_mes[1]) <<
" deg/s" << std::endl;
115 std::cout <<
"Left wheel vel= " << v_mes[0] <<
" m/s, Right wheel vel=" << v_mes[1] <<
" m/s" << std::endl;
116 std::cout <<
"Battery=" << robot.getBatteryVoltage() << std::endl;
121 ArLog::log(ArLog::Normal,
"simpleMotionCommands: Stopping.");
128 ArLog::log(ArLog::Normal,
129 "simpleMotionCommands: Pose=(%.2f,%.2f,%.2f), Trans. "
130 "Vel=%.2f, Rot. Vel=%.2f, Battery=%.2fV",
131 robot.getX(), robot.getY(), robot.getTh(), robot.getVel(), robot.getRotVel(), robot.getBatteryVoltage());
134 std::cout <<
"Ending robot thread..." << std::endl;
138 robot.waitForRunExit();
141 ArLog::log(ArLog::Normal,
"simpleMotionCommands: Exiting.");
145 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.
VISP_EXPORT double measureTimeMs()
VISP_EXPORT int wait(double t0, double t)