57 #include <visp3/io/vpParseArgv.h> 58 #include <visp3/core/vpConfig.h> 59 #include <visp3/core/vpDebug.h> 60 #include <visp3/core/vpColVector.h> 61 #include <visp3/core/vpTime.h> 63 #ifdef VISP_HAVE_BICLOPS 65 #include <visp3/robot/vpRobotBiclops.h> 68 #define GETOPTARGS "c:h" 79 void usage(
const char *name,
const char *badparam, std::string conf)
82 Move the biclops robot\n\ 85 %s [-c <Biclops configuration file>] [-h]\n \ 90 -c <Biclops configuration file> %s\n\ 91 Sets the biclops robot configuration file.\n\n",
95 fprintf(stderr,
"ERROR: \n" );
96 fprintf(stderr,
"\nBad parameter [%s]\n", badparam);
111 bool getOptions(
int argc,
const char **argv, std::string& conf)
118 case 'c': conf = optarg_;
break;
119 case 'h': usage(argv[0], NULL, conf);
return false;
break;
122 usage(argv[0], optarg_, conf);
return false;
break;
126 if ((c == 1) || (c == -1)) {
128 usage(argv[0], NULL, conf);
129 std::cerr <<
"ERROR: " << std::endl;
130 std::cerr <<
" Bad argument " << optarg_ << std::endl << std::endl;
138 main(
int argc,
const char ** argv)
140 std::string opt_conf =
"/usr/share/BiclopsDefault.cfg";
143 if (getOptions(argc, argv, opt_conf) ==
false) {
159 std::cout <<
"Set position in the articular frame: " 161 <<
" tilt: " <<
vpMath::deg(q[1]) <<
" deg" << std::endl ;
162 robot.setPositioningVelocity(30.) ;
166 std::cout <<
"Position in the articular frame: " 170 std::cout <<
"Velocity in the articular frame: " 176 std::cout <<
"Set position in the articular frame: " 178 <<
" tilt: " <<
vpMath::deg(q[1]) <<
" deg" << std::endl ;
179 robot.setPositioningVelocity(10) ;
183 std::cout <<
"Position in the articular frame: " 187 std::cout <<
"Velocity in the articular frame: " 191 std::cout <<
"Set STATE_VELOCITY_CONTROL" << std::endl;
195 std::cout <<
"Position in the articular frame: " 197 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
199 std::cout <<
"Velocity in the articular frame: " 206 std::cout <<
"Set articular frame velocity " 208 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl ;
215 std::cout <<
"Position in the articular frame: " 217 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
219 std::cout <<
"Velocity in the articular frame: " 226 std::cout <<
"Set articular frame velocity " 228 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl ;
235 std::cout <<
"Position in the articular frame: " 237 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
239 std::cout <<
"Velocity in the articular frame: " 246 std::cout <<
"Set articular frame velocity " 248 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl ;
255 std::cout <<
"Position in the articular frame: " 257 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
259 std::cout <<
"Velocity in the articular frame: " 267 std::cout <<
"Set articular frame velocity " 269 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl ;
276 std::cout <<
"Position in the articular frame: " 278 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl ;
280 std::cout <<
"Velocity in the articular frame: " 285 std::cout <<
"Catch an exception: " << e.
getMessage() << std::endl;
293 vpERROR_TRACE(
"You do not have a biclops robot connected to your computer...");
void setPosition(const vpHomogeneousMatrix &wMc)
VISP_EXPORT int wait(double t0, double t)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
static const unsigned int ndof
Initialize the position controller.
error that can be emited by ViSP classes.
vpHomogeneousMatrix getPosition() const
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)
const char * getMessage(void) const
static double deg(double rad)
Implementation of column vector and the associated operations.