61 #include <visp/vpParseArgv.h>
62 #include <visp/vpConfig.h>
63 #include <visp/vpDebug.h>
64 #include <visp/vpColVector.h>
65 #include <visp/vpTime.h>
67 #ifdef VISP_HAVE_BICLOPS
69 #include <visp/vpRobotBiclops.h>
72 #define GETOPTARGS "c:h"
83 void usage(
const char *name,
const char *badparam, std::string conf)
86 Move the biclops robot\n\
89 %s [-c <Biclops configuration file>] [-h]\n \
94 -c <Biclops configuration file> %s\n\
95 Sets the biclops robot configuration file.\n\n",
99 fprintf(stderr,
"ERROR: \n" );
100 fprintf(stderr,
"\nBad parameter [%s]\n", badparam);
115 bool getOptions(
int argc,
const char **argv, std::string& conf)
122 case 'c': conf = optarg;
break;
123 case 'h': usage(argv[0], NULL, conf);
return false;
break;
126 usage(argv[0], optarg, conf);
return false;
break;
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;
142 main(
int argc,
const char ** argv)
144 std::string opt_conf =
"/usr/share/BiclopsDefault.cfg";
147 if (getOptions(argc, argv, opt_conf) ==
false) {
163 vpCTRACE <<
"Set position in the articular frame: "
165 <<
" tilt: " <<
vpMath::deg(q[1]) <<
" deg" << std::endl ;
166 robot.setPositioningVelocity(30.) ;
170 vpCTRACE <<
"Position in the articular frame: "
174 vpCTRACE <<
"Velocity in the articular frame: "
178 vpCTRACE <<
"---------------------------------------- " << std::endl;
182 vpCTRACE <<
"Set position in the articular frame: "
184 <<
" tilt: " <<
vpMath::deg(q[1]) <<
" deg" << std::endl ;
185 robot.setPositioningVelocity(10) ;
189 vpCTRACE <<
"Position in the articular frame: "
193 vpCTRACE <<
"Velocity in the articular frame: "
197 vpCTRACE <<
"---------------------------------------- " << std::endl;
199 vpCTRACE <<
"Set STATE_VELOCITY_CONTROL" << std::endl;
203 vpCTRACE <<
"Position in the articular frame: "
205 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
207 vpCTRACE <<
"Velocity in the articular frame: "
211 vpCTRACE <<
"---------------------------------------- " << std::endl;
215 vpCTRACE <<
"Set articular frame velocity "
217 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl ;
224 vpCTRACE <<
"Position in the articular frame: "
226 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
228 vpCTRACE <<
"Velocity in the articular frame: "
233 vpCTRACE <<
"---------------------------------------- " << std::endl;
237 vpCTRACE <<
"Set articular frame velocity "
239 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl ;
246 vpCTRACE <<
"Position in the articular frame: "
248 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
250 vpCTRACE <<
"Velocity in the articular frame: "
255 vpCTRACE <<
"---------------------------------------- " << std::endl;
261 vpCTRACE <<
"Set articular frame velocity "
263 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl ;
270 vpCTRACE <<
"Position in the articular frame: "
272 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
274 vpCTRACE <<
"Velocity in the articular frame: "
278 vpCTRACE <<
"---------------------------------------- " << std::endl;
284 vpCTRACE <<
"Set articular frame velocity "
286 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl ;
293 vpCTRACE <<
"Position in the articular frame: "
295 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
297 vpCTRACE <<
"Velocity in the articular frame: "
310 vpERROR_TRACE(
"You do not have a biclops robot connected to your computer...");
static const unsigned int ndof
void setPosition(const vpHomogeneousMatrix &cMw)
Initialize the position controller.
static int wait(double t0, double t)
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Initialize the velocity controller.
Interface for the biclops, pan, tilt head control.
static double rad(double deg)
void getPosition(vpHomogeneousMatrix &cMw) const
static double deg(double rad)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &v)