41 #include <visp3/robot/vpRobotViper650.h>
43 #ifdef VISP_HAVE_VIPER650
45 #ifdef ENABLE_VISP_NAMESPACE
57 for (
unsigned int i = 0; i < 3; i++) {
58 if (std::fabs(t1[i] - t2[i]) > epsilon)
60 if (std::fabs(tu1[i] - tu2[i]) > epsilon)
68 for (
unsigned int i = 0; i < q1.
size(); i++) {
69 if (std::fabs(q1[i] - q2[i]) > epsilon) {
88 eMt[0][1] = -sqrt(2)/2;
89 eMt[1][1] = -sqrt(2)/2;
92 eMt[0][2] = -sqrt(2)/2;
93 eMt[1][2] = sqrt(2)/2;
105 std::cout <<
"eMt:\n" << eMt << std::endl;
108 std::cout <<
"Connection to Viper 650 robot" << std::endl;
123 std::cout <<
"q: " << q.
t() << std::endl;
126 robot.get_fMw(q, fMw);
127 robot.get_fMe(q, fMe);
128 robot.get_fMc(q, fMt);
131 std::cout <<
"fMw:\n" << fMw << std::endl;
132 std::cout <<
"fMe:\n" << fMe << std::endl;
133 std::cout <<
"fMt:\n" << fMt << std::endl;
134 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;
154 std::cout <<
"eMc:\n" << cMe.
inverse() << std::endl;
156 std::cout <<
"Compare pose eMt and eMc:" << std::endl;
157 if (!pose_equal(eMt, cMe.
inverse(), 1e-4)) {
158 std::cout <<
" Error: Pose eMc differ" << std::endl;
159 std::cout <<
"\nTest failed" << std::endl;
162 std::cout <<
" They are the same, we can continue" << std::endl;
172 for (
unsigned int i = 0; i < 3; i++) {
173 f_t_t[i] = f_pose_t[i];
174 f_rxyz_t[i] = f_pose_t[i + 3];
177 std::cout <<
"fMt_ (from ref frame):\n" << fMt_ << std::endl;
179 std::cout <<
"Compare pose fMt and fMt_:" << std::endl;
180 if (!pose_equal(fMt, fMt_, 1e-4)) {
181 std::cout <<
" Error: Pose fMt differ" << std::endl;
182 std::cout <<
"\nTest failed" << std::endl;
185 std::cout <<
" They are the same, we can continue" << std::endl;
191 robot.getInverseKinematics(fMt, q1);
193 std::cout <<
"Move robot in joint (the robot should not move)" << std::endl;
199 std::cout <<
"Reach joint position q2: " << q2.
t() << std::endl;
201 std::cout <<
"Compare joint position q and q2:" << std::endl;
202 if (!joint_equal(q, q2, 1e-4)) {
203 std::cout <<
" Error: Joint position differ" << std::endl;
204 std::cout <<
"\nTest failed" << std::endl;
207 std::cout <<
" They are the same, we can continue" << std::endl;
215 for (
unsigned int i = 0; i < 3; i++) {
216 f_pose_t[i] = f_t_t[i];
217 f_pose_t[i + 3] = f_rxyz_t[i];
220 std::cout <<
"Move robot in reference frame (the robot should not move)" << std::endl;
224 std::cout <<
"Reach joint position q3: " << q3.
t() << std::endl;
225 std::cout <<
"Compare joint position q and q3:" << std::endl;
226 if (!joint_equal(q, q3, 1e-4)) {
227 std::cout <<
" Error: Joint position differ" << std::endl;
228 std::cout <<
"\nTest failed" << std::endl;
231 std::cout <<
" They are the same, we can continue" << std::endl;
243 robot.getInverseKinematics(fMt_, q);
245 std::cout <<
"fMt_:\n" << fMt_ << std::endl;
247 std::cout <<
"Move robot in joint position to reach fMt_" << std::endl;
256 std::cout <<
"Compare pose fMt_ and fpt_:" << std::endl;
258 std::cout <<
" Error: Pose fMt_ differ" << std::endl;
259 std::cout <<
"\nTest failed" << std::endl;
262 std::cout <<
" They are the same, we can continue" << std::endl;
273 std::cout <<
"Move robot in camera velocity" << std::endl;
295 std::cout <<
"Move robot in joint velocity" << std::endl;
314 std::cout <<
"Move robot in camera velocity" << std::endl;
335 std::cout <<
"Move robot in joint velocity" << std::endl;
352 robot.get_fMc(q, fMt);
359 robot.getInverseKinematics(fMt * tMt, q);
361 std::cout <<
"Move robot in joint position" << std::endl;
365 std::cout <<
"The end" << std::endl;
366 std::cout <<
"Test succeed" << std::endl;
370 std::cout <<
"Test failed with exception: " << e.
getMessage() << std::endl;
378 std::cout <<
"The real Viper650 robot controller is not available." << std::endl;
unsigned int size() const
Return the number of elements of the 2D array.
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
const char * getMessage() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpRotationMatrix getRotationMatrix() const
vpHomogeneousMatrix & buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
vpHomogeneousMatrix inverse() const
vpTranslationVector getTranslationVector() const
void extract(vpRotationMatrix &R) const
static double rad(double deg)
Implementation of a matrix and operations on matrices.
vpMatrix pseudoInverse(double svThreshold=1e-6) const
Implementation of a pose vector and operations on poses.
void get_eJe(vpMatrix &eJe) VP_OVERRIDE
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) VP_OVERRIDE
Control of Irisa's Viper S650 robot named Viper650.
@ STATE_POSITION_CONTROL
Initialize the position controller.
@ STATE_VELOCITY_CONTROL
Initialize the velocity controller.
@ STATE_STOP
Stops robot motion especially in velocity and acceleration control.
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a rotation vector as Euler angle minimal representation.
Implementation of a rotation vector as axis-angle minimal representation.
Class that consider the case of a translation vector.
vpHomogeneousMatrix get_cMe() const
VISP_EXPORT double measureTimeMs()