56 #include <visp3/core/vpColVector.h> 57 #include <visp3/core/vpDebug.h> 58 #include <visp3/core/vpTime.h> 59 #include <visp3/io/vpParseArgv.h> 60 #ifdef VISP_HAVE_BICLOPS 62 #include <visp3/robot/vpRobotBiclops.h> 65 #define GETOPTARGS "c:h" 76 void usage(
const char *name,
const char *badparam, std::string conf)
79 Move the biclops robot\n\ 82 %s [-c <Biclops configuration file>] [-h]\n \ 87 -c <Biclops configuration file> %s\n\ 88 Sets the biclops robot configuration file.\n\n", conf.c_str());
91 fprintf(stderr,
"ERROR: \n");
92 fprintf(stderr,
"\nBad parameter [%s]\n", badparam);
107 bool getOptions(
int argc,
const char **argv, std::string &conf)
118 usage(argv[0], NULL, conf);
123 usage(argv[0], optarg_, conf);
129 if ((c == 1) || (c == -1)) {
131 usage(argv[0], NULL, conf);
132 std::cerr <<
"ERROR: " << std::endl;
133 std::cerr <<
" Bad argument " << optarg_ << std::endl << std::endl;
140 int main(
int argc,
const char **argv)
142 std::string opt_conf =
"/usr/share/BiclopsDefault.cfg";
145 if (getOptions(argc, argv, opt_conf) ==
false) {
161 std::cout <<
"Set position in the articular frame: " 163 <<
" tilt: " <<
vpMath::deg(q[1]) <<
" deg" << std::endl;
164 robot.setPositioningVelocity(30.);
168 std::cout <<
"Position in the articular frame: " 171 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: " 186 std::cout <<
"Velocity in the articular frame: " 189 std::cout <<
"Set STATE_VELOCITY_CONTROL" << std::endl;
193 std::cout <<
"Position in the articular frame: " 195 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
197 std::cout <<
"Velocity in the articular frame: " 203 std::cout <<
"Set articular frame velocity " 205 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
212 std::cout <<
"Position in the articular frame: " 214 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
216 std::cout <<
"Velocity in the articular frame: " 222 std::cout <<
"Set articular frame velocity " 224 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
231 std::cout <<
"Position in the articular frame: " 233 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
235 std::cout <<
"Velocity in the articular frame: " 241 std::cout <<
"Set articular frame velocity " 243 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
250 std::cout <<
"Position in the articular frame: " 252 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
254 std::cout <<
"Velocity in the articular frame: " 261 std::cout <<
"Set articular frame velocity " 263 <<
" tilt: " <<
vpMath::deg(qdot[1]) <<
" deg/s" << std::endl;
270 std::cout <<
"Position in the articular frame: " 272 <<
" tilt: " <<
vpMath::deg(qm[1]) <<
" deg" << std::endl;
274 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;
VISP_EXPORT int wait(double t0, double t)
static const unsigned int ndof
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
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.
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.
void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &velocity)
const char * getMessage() const