Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
tutorial-pioneer-robot.cpp
1
2
#include <iostream>
3
#include <visp3/core/vpConfig.h>
4
#include <visp3/robot/vpRobotPioneer.h>
5
6
int
main()
7
{
8
#ifdef VISP_HAVE_PIONEER
9
#if defined(ENABLE_VISP_NAMESPACE)
10
using namespace
VISP_NAMESPACE_NAME
;
11
#endif
12
try
{
13
ArArgumentBuilder
args
;
14
args
.add(
"-rp"
);
15
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
// UNIX
16
args
.add(
"/dev/ttyUSB0"
);
17
#else
18
args
.add(
"COM3"
);
19
#endif
20
21
ArSimpleConnector conn(&args);
22
23
vpRobotPioneer
robot;
24
25
if
(!conn.connectRobot(&robot))
26
return
EXIT_FAILURE;
27
28
robot.
useSonar
(
false
);
29
vpTime::wait
(2000);
30
31
vpColVector
v
(2);
32
v
= 0;
33
v
[0] = 0.10;
// Translational velocity in m/s
34
robot.setVelocity(
vpRobot::REFERENCE_FRAME
, v);
35
36
vpTime::wait
(1000);
37
vpColVector
v_mes = robot.getVelocity(
vpRobot::REFERENCE_FRAME
);
38
std::cout <<
"Measured vel: "
<< v_mes.
t
() << std::endl;
39
vpTime::wait
(1000);
40
41
robot.stopRunning();
42
robot.waitForRunExit();
43
}
44
catch
(
const
vpException
&e) {
45
std::cout <<
"Catch an exception: "
<<
e
<< std::endl;
46
}
47
#endif
48
}
vpColVector
Implementation of column vector and the associated operations.
Definition
vpColVector.h:191
vpColVector::t
vpRowVector t() const
Definition
vpColVector.cpp:558
vpException
error that can be emitted by ViSP classes.
Definition
vpException.h:60
vpRobotPioneer
Interface for Pioneer mobile robots based on Aria 3rd party library.
Definition
vpRobotPioneer.h:64
vpRobotPioneer::useSonar
void useSonar(bool usage)
Definition
vpRobotPioneer.h:129
vpRobot::REFERENCE_FRAME
@ REFERENCE_FRAME
Definition
vpRobot.h:75
VISP_NAMESPACE_NAME
Definition
vpEigenConversion.h:44
gen_java.args
args
Definition
gen_java.py:1306
ibvs-four-points.v
v
Definition
ibvs-four-points.py:271
ibvs-four-points.e
e
Definition
ibvs-four-points.py:272
vpTime::wait
VISP_EXPORT int wait(double t0, double t)
tutorial
robot
pioneer
tutorial-pioneer-robot.cpp
Generated by
1.17.0