ViSP
 All Classes Functions Variables Enumerations Enumerator Friends Groups Pages
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 }