46#include <visp3/core/vpConfig.h>
48#ifdef VISP_HAVE_BICLOPS
50#include <visp3/robot/vpRobotBiclops.h>
51#include <visp3/io/vpParseArgv.h>
54#define GETOPTARGS "c:h"
56#ifdef ENABLE_VISP_NAMESPACE
67void usage(
const char *name,
const char *badparam, std::string conf)
70Move the Biclops robot\n\
73 %s [-c <Biclops configuration file>] [-h]\n\
79 -c <Biclops configuration file> %s\n\
80 Sets the Biclops robot configuration file.\n\n",
84 fprintf(stderr,
"ERROR: \n");
85 fprintf(stderr,
"\nBad parameter [%s]\n", badparam);
98bool getOptions(
int argc,
const char **argv, std::string &conf)
109 usage(argv[0],
nullptr, conf);
113 usage(argv[0], optarg_, conf);
118 if ((c == 1) || (c == -1)) {
120 usage(argv[0],
nullptr, conf);
121 std::cerr <<
"ERROR: " << std::endl;
122 std::cerr <<
" Bad argument " << optarg_ << std::endl << std::endl;
129int main(
int argc,
const char **argv)
131 std::string opt_conf =
"/usr/share/BiclopsDefault.cfg";
134 if (getOptions(argc, argv, opt_conf) ==
false) {
150 std::cout <<
"Set Joint position "
152 <<
" tilt: " <<
vpMath::deg(q[1]) <<
" deg" << std::endl;
153 robot.setPositioningVelocity(30.);
157 std::cout <<
" Joint position "
160 std::cout <<
" Joint velocity "
165 std::cout <<
"Set Joint position "
167 <<
" tilt: " <<
vpMath::deg(q[1]) <<
" deg" << std::endl;
168 robot.setPositioningVelocity(10);
172 std::cout <<
" Joint position: "
175 std::cout <<
" Joint velocity: "
178 std::cout <<
"Set STATE_VELOCITY_CONTROL" << std::endl;
182 std::cout <<
" Joint position: "
184 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
186 std::cout <<
" Joint velocity "
192 std::cout <<
"Set joint velocity for 5 sec"
194 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
201 std::cout <<
" Joint position "
203 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
205 std::cout <<
" Joint velocity "
211 std::cout <<
"Set joint velocity for 3 sec"
213 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
220 std::cout <<
" Joint position "
222 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
224 std::cout <<
" Joint velocity "
230 std::cout <<
"Set joint velocity for 2 sec"
232 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
239 std::cout <<
" Joint position "
241 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
243 std::cout <<
" Joint velocity "
250 std::cout <<
"Set joint velocity for 2 sec"
252 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
259 std::cout <<
" Joint position "
261 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
263 std::cout <<
" Joint velocity "
268 std::cout <<
"Catch an exception: " <<
e.getMessage() << std::endl;
275 std::cout <<
"You do not have an Biclops PT robot connected to your computer..." << std::endl;
static const unsigned int ndof
Number of dof.
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
static double rad(double deg)
static double deg(double rad)
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Interface for the Biclops, pan, tilt head control.
@ STATE_POSITION_CONTROL
Initialize the position controller.
@ STATE_VELOCITY_CONTROL
Initialize the velocity controller.
VISP_EXPORT int wait(double t0, double t)