56 #include <visp3/core/vpColVector.h> 57 #include <visp3/core/vpConfig.h> 58 #include <visp3/core/vpDebug.h> 59 #include <visp3/core/vpTime.h> 60 #include <visp3/io/vpParseArgv.h> 61 #ifdef VISP_HAVE_BICLOPS 63 #include <visp3/robot/vpRobotBiclops.h> 66 #define GETOPTARGS "c:h" 77 void usage(
const char *name,
const char *badparam, std::string conf)
80 Move the biclops robot\n\ 83 %s [-c <Biclops configuration file>] [-h]\n \ 88 -c <Biclops configuration file> %s\n\ 89 Sets the biclops robot configuration file.\n\n", conf.c_str());
92 fprintf(stderr,
"ERROR: \n");
93 fprintf(stderr,
"\nBad parameter [%s]\n", badparam);
108 bool 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;
141 int 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: " 280 std::cout <<
"Catch an exception: " << e.
getMessage() << std::endl;
287 std::cout <<
"You do not have an biclops PT robot connected to your computer..." << std::endl;
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.
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Initialize the velocity controller.
const char * getMessage(void) const
vpHomogeneousMatrix getPosition() const
Interface for the biclops, pan, tilt head control.
static double rad(double deg)
static double deg(double rad)
Implementation of column vector and the associated operations.