Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
tutorial-pioneer-robot.cpp
#include <iostream>
#include <visp3/core/vpConfig.h>
#include <visp3/robot/vpRobotPioneer.h>
int
main()
{
#ifdef VISP_HAVE_PIONEER
#if defined(ENABLE_VISP_NAMESPACE)
using namespace
VISP_NAMESPACE_NAME
;
#endif
try
{
ArArgumentBuilder args;
args.add(
"-rp"
);
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
// UNIX
args.add(
"/dev/ttyUSB0"
);
#else
args.add(
"COM3"
);
#endif
ArSimpleConnector conn(&args);
vpRobotPioneer
robot;
if
(!conn.connectRobot(&robot))
return
EXIT_FAILURE;
robot.
useSonar
(
false
);
vpTime::wait
(2000);
vpColVector
v(2);
v = 0;
v[0] = 0.10;
// Translational velocity in m/s
robot.setVelocity(
vpRobot::REFERENCE_FRAME
, v);
vpTime::wait
(1000);
vpColVector
v_mes = robot.getVelocity(
vpRobot::REFERENCE_FRAME
);
std::cout <<
"Measured vel: "
<< v_mes.
t
() << std::endl;
vpTime::wait
(1000);
robot.stopRunning();
robot.waitForRunExit();
}
catch
(
const
vpException
&e) {
std::cout <<
"Catch an exception: "
<< e << std::endl;
}
#endif
}
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
vpTime::wait
VISP_EXPORT int wait(double t0, double t)
Generated by
1.17.0