ViSP  2.8.0
tutorial-pioneer-robot.cpp
1 
2 #include <iostream>
3 #include <visp/vpRobotPioneer.h>
4 
5 int main()
6 {
7 #ifdef VISP_HAVE_PIONEER
8  ArArgumentBuilder args;
9  args.add("-rp");
10 #ifdef UNIX
11  args.add("/dev/ttyUSB0");
12 #else
13  args.add("COM3");
14 #endif
15 
16  ArSimpleConnector conn(&args);
17 
18  vpRobotPioneer robot;
19 
20  if (!conn.connectRobot(&robot))
21  return -1;
22 
23  robot.useSonar(false);
24  vpTime::wait(2000);
25 
26  vpColVector v(2);
27  v = 0;
28  v[0] = 0.10; // Translational velocity in m/s
30 
31  vpTime::wait(1000);
33  std::cout << "Measured vel: " << v_mes.t() << std::endl;
34  vpTime::wait(1000);
35 
36  robot.stopRunning();
37  robot.waitForRunExit();
38 #endif
39 }
void useSonar(bool usage)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
Interface for Pioneer mobile robots based on Aria 3rd party library.
static int wait(double t0, double t)
Definition: vpTime.cpp:149
vpRowVector t() const
transpose of Vector
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity)