55#include <visp3/core/vpColVector.h>
56#include <visp3/core/vpDebug.h>
57#include <visp3/core/vpTime.h>
58#include <visp3/io/vpParseArgv.h>
59#ifdef VISP_HAVE_BICLOPS
61#include <visp3/robot/vpRobotBiclops.h>
64#define GETOPTARGS "c:h"
75void usage(
const char *name,
const char *badparam, std::string conf)
78Move the biclops robot\n\
81 %s [-c <Biclops configuration file>] [-h]\n\
87 -c <Biclops configuration file> %s\n\
88 Sets the biclops robot configuration file.\n\n",
92 fprintf(stderr,
"ERROR: \n");
93 fprintf(stderr,
"\nBad parameter [%s]\n", badparam);
108bool getOptions(
int argc,
const char **argv, std::string &conf)
119 usage(argv[0], NULL, conf);
124 usage(argv[0], optarg_, conf);
130 if ((c == 1) || (c == -1)) {
132 usage(argv[0], NULL, conf);
133 std::cerr <<
"ERROR: " << std::endl;
134 std::cerr <<
" Bad argument " << optarg_ << std::endl << std::endl;
141int main(
int argc,
const char **argv)
143 std::string opt_conf =
"/usr/share/BiclopsDefault.cfg";
146 if (getOptions(argc, argv, opt_conf) ==
false) {
162 std::cout <<
"Set position in the articular frame: "
164 <<
" tilt: " <<
vpMath::deg(q[1]) <<
" deg" << std::endl;
165 robot.setPositioningVelocity(30.);
169 std::cout <<
"Position in the articular frame: "
172 std::cout <<
"Velocity in the articular frame: "
177 std::cout <<
"Set position in the articular frame: "
179 <<
" tilt: " <<
vpMath::deg(q[1]) <<
" deg" << std::endl;
180 robot.setPositioningVelocity(10);
184 std::cout <<
"Position in the articular frame: "
187 std::cout <<
"Velocity in the articular frame: "
190 std::cout <<
"Set STATE_VELOCITY_CONTROL" << std::endl;
194 std::cout <<
"Position in the articular frame: "
196 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
198 std::cout <<
"Velocity in the articular frame: "
204 std::cout <<
"Set articular frame velocity "
206 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
213 std::cout <<
"Position in the articular frame: "
215 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
217 std::cout <<
"Velocity in the articular frame: "
223 std::cout <<
"Set articular frame velocity "
225 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
232 std::cout <<
"Position in the articular frame: "
234 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
236 std::cout <<
"Velocity in the articular frame: "
242 std::cout <<
"Set articular frame velocity "
244 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
251 std::cout <<
"Position in the articular frame: "
253 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
255 std::cout <<
"Velocity in the articular frame: "
262 std::cout <<
"Set articular frame velocity "
264 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
271 std::cout <<
"Position in the articular frame: "
273 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
275 std::cout <<
"Velocity in the articular frame: "
279 std::cout <<
"Catch an exception: " << e.
getMessage() << std::endl;
286 std::cout <<
"You do not have an biclops PT robot connected to your computer..." << std::endl;
static const unsigned int ndof
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
const char * getMessage() const
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.
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity)
@ STATE_POSITION_CONTROL
Initialize the position controller.
@ STATE_VELOCITY_CONTROL
Initialize the velocity controller.
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
VISP_EXPORT int wait(double t0, double t)