45 #include <visp3/robot/vpRobotViper850.h>
47 #ifdef VISP_HAVE_VIPER850
58 for(
unsigned int i=0; i<3; i++) {
59 if (std::fabs(t1[i]-t2[i]) > epsilon)
61 if (std::fabs(tu1[i]-tu2[i]) > epsilon)
69 for(
unsigned int i=0; i<q1.
size(); i++) {
70 if (std::fabs(q1[i]-q2[i]) > epsilon) {
89 eMt[0][1] = -sqrt(2)/2;
90 eMt[1][1] = -sqrt(2)/2;
93 eMt[0][2] = -sqrt(2)/2;
94 eMt[1][2] = sqrt(2)/2;
106 std::cout <<
"eMt:\n" << eMt << std::endl;
109 std::cout <<
"Connection to Viper 850 robot" << std::endl;
124 std::cout <<
"q: " << q.
t() << std::endl;
132 std::cout <<
"fMw:\n" << fMw << std::endl;
133 std::cout <<
"fMe:\n" << fMe << std::endl;
134 std::cout <<
"fMt:\n" << fMt << std::endl;
135 std::cout <<
"eMc:\n" << cMe.
inverse() << std::endl;
140 std::cout <<
"eMt_:\n" << eMt_ << std::endl;
143 std::cout <<
"Compare pose eMt and eMt_:" << std::endl;
144 if (! pose_equal(eMt, eMt_, 1e-4)) {
145 std::cout <<
" Error: Pose eMt differ" << std::endl;
146 std::cout <<
"\nTest failed" << std::endl;
149 std::cout <<
" They are the same, we can continue" << std::endl;
153 std::cout <<
"eMc:\n" << cMe.
inverse() << std::endl;
155 std::cout <<
"Compare pose eMt and eMc:" << std::endl;
156 if (! pose_equal(eMt, cMe.
inverse(), 1e-4)) {
157 std::cout <<
" Error: Pose eMc differ" << std::endl;
158 std::cout <<
"\nTest failed" << std::endl;
161 std::cout <<
" They are the same, we can continue" << std::endl;
171 for (
unsigned int i=0; i<3; i++) {
172 f_t_t[i] = f_pose_t[i];
173 f_rxyz_t[i] = f_pose_t[i+3];
176 std::cout <<
"fMt_ (from ref frame):\n" << fMt_ << std::endl;
178 std::cout <<
"Compare pose fMt and fMt_:" << std::endl;
179 if (! pose_equal(fMt, fMt_, 1e-4)) {
180 std::cout <<
" Error: Pose fMt differ" << std::endl;
181 std::cout <<
"\nTest failed" << std::endl;
184 std::cout <<
" They are the same, we can continue" << std::endl;
192 std::cout <<
"Move robot in joint (the robot should not move)" << std::endl;
198 std::cout <<
"Reach joint position q2: " << q2.
t() << std::endl;
200 std::cout <<
"Compare joint position q and q2:" << std::endl;
201 if (! joint_equal(q, q2, 1e-4)) {
202 std::cout <<
" Error: Joint position differ" << std::endl;
203 std::cout <<
"\nTest failed" << std::endl;
206 std::cout <<
" They are the same, we can continue" << std::endl;
214 for (
unsigned int i=0; i<3; i++) {
215 f_pose_t[i] = f_t_t[i];
216 f_pose_t[i+3] = f_rxyz_t[i];
219 std::cout <<
"Move robot in reference frame (the robot should not move)" << std::endl;
223 std::cout <<
"Reach joint position q3: " << q3.
t() << std::endl;
224 std::cout <<
"Compare joint position q and q3:" << std::endl;
225 if (! joint_equal(q, q3, 1e-4)) {
226 std::cout <<
" Error: Joint position differ" << std::endl;
227 std::cout <<
"\nTest failed" << std::endl;
230 std::cout <<
" They are the same, we can continue" << std::endl;
244 std::cout <<
"fMt_:\n" << fMt_ << std::endl;
246 std::cout <<
"Move robot in joint position to reach fMt_" << std::endl;
255 std::cout <<
"Compare pose fMt_ and fpt_:" << std::endl;
257 std::cout <<
" Error: Pose fMt_ differ" << std::endl;
258 std::cout <<
"\nTest failed" << std::endl;
261 std::cout <<
" They are the same, we can continue" << std::endl;
272 std::cout <<
"Move robot in camera velocity" << std::endl;
293 std::cout <<
"Move robot in joint velocity" << std::endl;
313 std::cout <<
"Move robot in camera velocity" << std::endl;
333 std::cout <<
"Move robot in joint velocity" << std::endl;
359 std::cout <<
"Move robot in joint position" << std::endl;
363 std::cout <<
"The end" << std::endl;
364 std::cout <<
"Test succeed" << std::endl;
367 std::cout <<
"Test failed with exception: " << e.
getMessage() << std::endl;
374 std::cout <<
"The real Viper850 robot controller is not available." << std::endl;
void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position)
Implementation of a matrix and operations on matrices.
void get_fMw(const vpColVector &q, vpHomogeneousMatrix &fMw) const
Implementation of an homogeneous matrix and operations on such kind of matrices.
Control of Irisa's Viper S850 robot named Viper850.
Initialize the position controller.
vpRobot::vpRobotStateType setRobotState(vpRobot::vpRobotStateType newState)
error that can be emited by ViSP classes.
unsigned int size() const
Return the number of elements of the 2D array.
void get_eJe(vpMatrix &eJe)
VISP_EXPORT double measureTimeMs()
Implementation of a rotation matrix and operations on such kind of matrices.
Initialize the velocity controller.
vpRotationMatrix getRotationMatrix() const
vpTranslationVector getTranslationVector() const
void extract(vpRotationMatrix &R) const
vpHomogeneousMatrix get_fMc(const vpColVector &q) const
const char * getMessage(void) const
void get_fMe(const vpColVector &q, vpHomogeneousMatrix &fMe) const
Implementation of a velocity twist matrix and operations on such kind of matrices.
unsigned int getInverseKinematics(const vpHomogeneousMatrix &fMc, vpColVector &q, const bool &verbose=false) const
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
static double rad(double deg)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &velocity)
Implementation of column vector and the associated operations.
void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &position)
Implementation of a pose vector and operations on poses.
vpHomogeneousMatrix inverse() const
Implementation of a rotation vector as Euler angle minimal representation.
vpMatrix pseudoInverse(double svThreshold=1e-6) const
Compute the pseudo inverse of the matrix using the SVD.
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.
void get_cMe(vpHomogeneousMatrix &cMe) const