40 #include <visp3/robot/vpSimulatorViper850.h>
42 #if defined(VISP_HAVE_MODULE_GUI) && (defined(_WIN32) || defined(VISP_HAVE_PTHREAD))
44 #include <visp3/core/vpTime.h>
45 #include <visp3/core/vpImagePoint.h>
46 #include <visp3/core/vpPoint.h>
47 #include <visp3/core/vpMeterPixelConversion.h>
48 #include <visp3/core/vpIoTools.h>
60 q_prev_getdis(), first_time_getdis(true), positioningVelocity(defaultPositioningVelocity),
61 zeroPos(), reposPos(), toolCustom(false), arm_dir()
76 DWORD dwThreadIdArray;
77 hThread = CreateThread(
84 #elif defined (VISP_HAVE_PTHREAD)
91 pthread_attr_init(&
attr);
92 pthread_attr_setdetachstate(&
attr, PTHREAD_CREATE_JOINABLE);
108 q_prev_getdis(), first_time_getdis(true), positioningVelocity(defaultPositioningVelocity),
109 zeroPos(), reposPos(), toolCustom(false), arm_dir()
117 mutex_fMi = CreateMutex(NULL,FALSE,NULL);
124 DWORD dwThreadIdArray;
125 hThread = CreateThread(
132 #elif defined(VISP_HAVE_PTHREAD)
139 pthread_attr_init(&
attr);
140 pthread_attr_setdetachstate(&
attr, PTHREAD_CREATE_JOINABLE);
156 WaitForSingleObject(hThread,INFINITE);
157 CloseHandle(hThread);
163 #elif defined(VISP_HAVE_PTHREAD)
164 pthread_attr_destroy(&
attr);
165 pthread_join(
thread, NULL);
176 for(
int i = 0; i < 6; i++)
197 std::vector<std::string> arm_dirs =
vpIoTools::splitChain(std::string(VISP_ROBOT_ARMS_DIR), std::string(
";"));
198 bool armDirExists =
false;
199 for(
size_t i=0; i < arm_dirs.size(); i++)
201 arm_dir = arm_dirs[i];
205 if (! armDirExists) {
208 std::cout <<
"The simulator uses data from VISP_ROBOT_ARMS_DIR=" << arm_dir << std::endl;
211 std::cout <<
"Cannot get VISP_ROBOT_ARMS_DIR environment variable" << std::endl;
225 zeroPos[1] = -M_PI/2; zeroPos[2] = M_PI;
228 reposPos[1] = -M_PI/2; reposPos[2] = M_PI; reposPos[4] = M_PI/2;
235 first_time_getdis =
true;
317 etc[0] = -0.04558630174;
318 etc[1] = -0.00134326752;
319 etc[2] = 0.001000828017;
326 std::cout <<
"This tool is not handled in vpSimulatorViper850.cpp" << std::endl;
350 const unsigned int &image_width,
351 const unsigned int &image_height)
361 if (image_width == 640 && image_height == 480)
363 std::cout <<
"Get default camera parameters for camera \""
368 vpTRACE(
"Cannot get default intrinsic camera parameters for this image resolution");
374 if (image_width == 640 && image_height == 480) {
375 std::cout <<
"Get default camera parameters for camera \""
380 vpTRACE(
"Cannot get default intrinsic camera parameters for this image resolution");
386 std::cout <<
"This tool is not handled in vpSimulatorViper850.cpp" << std::endl;
444 double tcur_1 =
tcur;
457 double ellapsedTime = (
tcur -
tprev) * 1e-3;
474 articularVelocities = 0.0;
480 articularCoordinates[0] = articularCoordinates[0] + ellapsedTime*articularVelocities[0];
481 articularCoordinates[1] = articularCoordinates[1] + ellapsedTime*articularVelocities[1];
482 articularCoordinates[2] = articularCoordinates[2] + ellapsedTime*articularVelocities[2];
483 articularCoordinates[3] = articularCoordinates[3] + ellapsedTime*articularVelocities[3];
484 articularCoordinates[4] = articularCoordinates[4] + ellapsedTime*articularVelocities[4];
485 articularCoordinates[5] = articularCoordinates[5] + ellapsedTime*articularVelocities[5];
492 ellapsedTime = (
joint_min[(
unsigned int)(-jl-1)] - articularCoordinates[(
unsigned int)(-jl-1)])/(articularVelocities[(
unsigned int)(-jl-1)]);
494 ellapsedTime = (
joint_max[(
unsigned int)(jl-1)] - articularCoordinates[(
unsigned int)(jl-1)])/(articularVelocities[(
unsigned int)(jl-1)]);
496 for (
unsigned int i = 0; i < 6; i++)
497 articularCoordinates[i] = articularCoordinates[i] + ellapsedTime*articularVelocities[i];
538 for (
int k = 1; k < 7; k++)
591 double c23 = cos(q2+q3);
592 double s23 = sin(q2+q3);
609 fMit[0][0][3] =
a1*c1;
610 fMit[0][1][3] =
a1*s1;
613 fMit[1][0][0] = c1*c2;
614 fMit[1][1][0] = s1*c2;
616 fMit[1][0][1] = -c1*s2;
617 fMit[1][1][1] = -s1*s2;
622 fMit[1][0][3] = c1*(
a2*c2+
a1);
623 fMit[1][1][3] = s1*(
a2*c2+
a1);
624 fMit[1][2][3] =
d1-
a2*s2;
626 double quickcomp1 =
a3*c23-
a2*c2-
a1;
628 fMit[2][0][0] = -c1*c23;
629 fMit[2][1][0] = -s1*c23;
634 fMit[2][0][2] = c1*s23;
635 fMit[2][1][2] = s1*s23;
637 fMit[2][0][3] = -c1*quickcomp1;
638 fMit[2][1][3] = -s1*quickcomp1;
639 fMit[2][2][3] =
a3*s23-
a2*s2+
d1;
641 double quickcomp2 = c1*(s23*
d4 - quickcomp1);
642 double quickcomp3 = s1*(s23*
d4 - quickcomp1);
644 fMit[3][0][0] = -c1*c23*c4+s1*s4;
645 fMit[3][1][0] = -s1*c23*c4-c1*s4;
646 fMit[3][2][0] = s23*c4;
647 fMit[3][0][1] = c1*s23;
648 fMit[3][1][1] = s1*s23;
650 fMit[3][0][2] = -c1*c23*s4-s1*c4;
651 fMit[3][1][2] = -s1*c23*s4+c1*c4;
652 fMit[3][2][2] = s23*s4;
653 fMit[3][0][3] = quickcomp2;
654 fMit[3][1][3] = quickcomp3;
655 fMit[3][2][3] = c23*
d4+
a3*s23-
a2*s2+
d1;
657 fMit[4][0][0] = c1*(s23*s5-c5*c23*c4)+s1*c5*s4;
658 fMit[4][1][0] = s1*(s23*s5-c5*c23*c4)-c1*c5*s4;
659 fMit[4][2][0] = s23*c4*c5+c23*s5;
660 fMit[4][0][1] = c1*c23*s4+s1*c4;
661 fMit[4][1][1] = s1*c23*s4-c1*c4;
662 fMit[4][2][1] = -s23*s4;
663 fMit[4][0][2] = c1*(s23*c5+s5*c23*c4)-s1*s5*s4;
664 fMit[4][1][2] = s1*(s23*c5+s5*c23*c4)+c1*s5*s4;
665 fMit[4][2][2] = -s23*c4*s5+c23*c5;
666 fMit[4][0][3] = quickcomp2;
667 fMit[4][1][3] = quickcomp3;
668 fMit[4][2][3] = c23*
d4+
a3*s23-
a2*s2+
d1;
670 fMit[5][0][0] = c1*(c23*(c4*c5*c6-s4*s6)-s23*s5*c6)-s1*(s4*c5*c6+c4*s6);
671 fMit[5][1][0] = -s1*(c23*(-c4*c5*c6+s4*s6)+s23*s5*c6)+c1*(s4*c5*c6+c4*s6);
672 fMit[5][2][0] = s23*(s4*s6-c4*c5*c6)-c23*s5*c6;
673 fMit[5][0][1] = -c1*(c23*(c4*c5*s6+s4*c6)-s23*s5*s6)+s1*(s4*c5*s6-c4*c6);
674 fMit[5][1][1] = -s1*(c23*(c4*c5*s6+s4*c6)-s23*s5*s6)-c1*(s4*c5*s6-c4*c6);
675 fMit[5][2][1] = s23*(c4*c5*s6+s4*c6)+c23*s5*s6;
676 fMit[5][0][2] = c1*(c23*c4*s5+s23*c5)-s1*s4*s5;
677 fMit[5][1][2] = s1*(c23*c4*s5+s23*c5)+c1*s4*s5;
678 fMit[5][2][2] = -s23*c4*s5+c23*c5;
679 fMit[5][0][3] = quickcomp2;
680 fMit[5][1][3] = quickcomp3;
681 fMit[5][2][3] = s23*
a3+c23*
d4-
a2*s2+
d1;
683 fMit[6][0][0] = c1*(c23*(c4*c5*c6-s4*s6)-s23*s5*c6)-s1*(s4*c5*c6+c4*s6);
684 fMit[6][1][0] = -s1*(c23*(-c4*c5*c6+s4*s6)+s23*s5*c6)+c1*(s4*c5*c6+c4*s6);
685 fMit[6][2][0] = s23*(s4*s6-c4*c5*c6)-c23*s5*c6;
686 fMit[6][0][1] = -c1*(c23*(c4*c5*s6+s4*c6)-s23*s5*s6)+s1*(s4*c5*s6-c4*c6);
687 fMit[6][1][1] = -s1*(c23*(c4*c5*s6+s4*c6)-s23*s5*s6)-c1*(s4*c5*s6-c4*c6);
688 fMit[6][2][1] = s23*(c4*c5*s6+s4*c6)+c23*s5*s6;
689 fMit[6][0][2] = c1*(c23*c4*s5+s23*c5)-s1*s4*s5;
690 fMit[6][1][2] = s1*(c23*c4*s5+s23*c5)+c1*s4*s5;
691 fMit[6][2][2] = -s23*c4*s5+c23*c5;
692 fMit[6][0][3] = c1*(c23*(c4*s5*
d6-
a3)+s23*(c5*
d6+
d4)+a1+
a2*c2)-s1*s4*s5*
d6;
693 fMit[6][1][3] = s1*(c23*(c4*s5*
d6-
a3)+s23*(c5*
d6+
d4)+a1+
a2*c2)+c1*s4*s5*
d6;
694 fMit[6][2][3] = s23*(
a3-c4*s5*
d6)+c23*(c5*
d6+
d4)-
a2*s2+
d1;
704 for (
int i = 0; i < 8; i++)
707 #elif defined(VISP_HAVE_PTHREAD)
709 for (
int i = 0; i < 8; i++)
734 std::cout <<
"Change the control mode from velocity to position control.\n";
744 std::cout <<
"Change the control mode from stop to velocity control.\n";
830 "use setRobotState(vpRobot::STATE_VELOCITY_CONTROL) first) ");
832 "Cannot send a velocity to the robot "
833 "use setRobotState(vpRobot::STATE_VELOCITY_CONTROL) first) ");
838 double scale_trans_sat = 1;
839 double scale_rot_sat = 1;
840 double scale_sat = 1;
855 vpERROR_TRACE (
"The velocity vector must have a size of 6 !!!!");
859 for (
unsigned int i = 0 ; i < 3; ++ i)
861 vel_abs = fabs (vel[i]);
864 vel_trans_max = vel_abs;
866 "(axis nr. %d).", vel[i], i+1);
869 vel_abs = fabs (vel[i+3]);
871 vel_rot_max = vel_abs;
873 "(axis nr. %d).", vel[i+3], i+4);
883 if ( (scale_trans_sat < 1) || (scale_rot_sat < 1) )
885 if (scale_trans_sat < scale_rot_sat)
886 scale_sat = scale_trans_sat;
888 scale_sat = scale_rot_sat;
898 vpERROR_TRACE (
"The velocity vector must have a size of 6 !!!!");
901 for (
unsigned int i = 0 ; i < 6; ++ i)
903 vel_abs = fabs (vel[i]);
906 vel_rot_max = vel_abs;
908 "(axis nr. %d).", vel[i], i+1);
913 if ( scale_rot_sat < 1 )
914 scale_sat = scale_rot_sat;
937 double scale_rot_sat = 1;
938 double scale_sat = 1;
956 articularVelocity = eJe_*eVc*velocityframe;
967 articularVelocity = fJe_*velocityframe;
973 articularVelocity = velocityframe;
990 for (
unsigned int i = 0 ; i < 6; ++ i)
992 vel_abs = fabs (articularVelocity[i]);
995 vel_rot_max = vel_abs;
997 "(axis nr. %d).", articularVelocity[i], i+1);
1002 if ( scale_rot_sat < 1 )
1003 scale_sat = scale_rot_sat;
1078 vel = cVe*eJe_*articularVelocity;
1083 vel = articularVelocity;
1090 vel = fJe_*articularVelocity;
1100 "Case not taken in account.");
1206 double velmax = fabs(q[0]);
1207 for (
unsigned int i = 1; i < 6; i++)
1209 if (velmax < fabs(q[i]))
1210 velmax = fabs(q[i]);
1297 "Modification of the robot state");
1314 for (
unsigned int i=0; i < 3; i++)
1331 qdes = articularCoordinates;
1336 error = qdes - articularCoordinates;
1353 "Position out of range.");
1355 }
while (errsqr > 1e-8 && nbSol > 0);
1365 error = q - articularCoordinates;
1378 }
while (errsqr > 1e-8);
1389 for (
unsigned int i=0; i < 3; i++)
1401 qdes = articularCoordinates;
1405 error = qdes - articularCoordinates;
1421 }
while (errsqr > 1e-8 && nbSol > 0);
1426 vpERROR_TRACE (
"Positionning error. Mixt frame not implemented");
1428 "Positionning error: "
1429 "Mixt frame not implemented.");
1508 position[0] = pos1 ;
1509 position[1] = pos2 ;
1510 position[2] = pos3 ;
1511 position[3] = pos4 ;
1512 position[4] = pos5 ;
1513 position[5] = pos6 ;
1569 "Bad position in filename.");
1665 for (
unsigned int i=0; i <3; i++)
1675 vpERROR_TRACE (
"Positionning error. Mixt frame not implemented");
1677 "Positionning error: "
1678 "Mixt frame not implemented.");
1740 for(
unsigned int j=0;j<3;j++)
1742 position[j]=posRxyz[j];
1743 position[j+3]=RtuVect[j];
1776 vpTRACE(
"Joint limit vector has not a size of 6 !");
1808 double c2 = cos(q2);
1809 double c3 = cos(q3);
1810 double s3 = sin(q3);
1811 double c23 = cos(q2+q3);
1812 double s23 = sin(q2+q3);
1813 double s5 = sin(q5);
1815 bool cond1 = fabs(s5) < 1e-1;
1816 bool cond2 = fabs(
a3*s3+c3*
d4) < 1e-1;
1817 bool cond3 = fabs(
a2*c2-
a3*c23+s23*d4+
a1) < 1e-1;
1838 J[1][0] = 0; J[2][0] = 0; J[3][0] = 0; J[4][0] = 0; J[5][0] = 0;
1839 J[1][1] = 0; J[2][1] = 0; J[3][1] = 0; J[4][1] = 0; J[5][1] = 0;
1840 J[1][2] = 0; J[2][2] = 0; J[3][2] = 0; J[4][2] = 0; J[5][2] = 0;
1846 J[0][0] = 0; J[3][0] = 0; J[4][0] = 0; J[5][0] = 0;
1847 J[0][1] = 0; J[3][1] = 0; J[4][1] = 0; J[5][1] = 0;
1865 for (
unsigned int i = 0; i < 6; i++)
1867 if (articularCoordinates[i] <=
joint_min[i])
1869 difft =
joint_min[i] - articularCoordinates[i];
1873 artNumb = -(int)i-1;
1878 for (
unsigned int i = 0; i < 6; i++)
1880 if (articularCoordinates[i] >=
joint_max[i])
1882 difft = articularCoordinates[i] -
joint_max[i];
1886 artNumb = (int)(i+1);
1892 std::cout <<
"\nWarning: Velocity control stopped: axis " << fabs((
float)artNumb) <<
" on joint limit!" <<std::endl;
1909 vpSimulatorViper850::getCameraDisplacement(
vpColVector &displacement)
1924 vpSimulatorViper850::getArticularDisplacement(
vpColVector &displacement)
1957 if ( ! first_time_getdis )
1963 std::cout <<
"getDisplacement() CAMERA_FRAME not implemented\n";
1970 displacement = q_cur - q_prev_getdis;
1976 std::cout <<
"getDisplacement() REFERENCE_FRAME not implemented\n";
1983 std::cout <<
"getDisplacement() MIXT_FRAME not implemented\n";
1991 first_time_getdis =
false;
1995 q_prev_getdis = q_cur;
2063 fd = fopen(filename,
"r") ;
2067 char line[FILENAME_MAX];
2068 char dummy[FILENAME_MAX];
2070 bool sortie =
false;
2074 if (fgets (line, FILENAME_MAX, fd) != NULL) {
2075 if ( strncmp (line,
"#", 1) != 0) {
2077 if ( strncmp (line, head,
sizeof(head)-1) == 0) {
2089 while ( sortie !=
true );
2093 int ret = sscanf(line,
"%s %lf %lf %lf %lf %lf %lf",
2095 &q[0], &q[1], &q[2], &q[3], &q[4], &q[5]);
2134 fd = fopen(filename,
"w") ;
2139 #Viper - Position - Version 1.0\n\
2142 # Joint position in degrees\n\
2147 fprintf(fd,
"R: %lf %lf %lf %lf %lf %lf\n",
2298 std::string scene_dir_;
2299 std::vector<std::string> scene_dirs =
vpIoTools::splitChain(std::string(VISP_SCENES_DIR), std::string(
";"));
2300 bool sceneDirExists =
false;
2301 for(
size_t i=0; i < scene_dirs.size(); i++)
2303 scene_dir_ = scene_dirs[i];
2304 sceneDirExists =
true;
2307 if (! sceneDirExists) {
2310 std::cout <<
"The simulator uses data from VISP_SCENES_DIR=" << scene_dir_ << std::endl;
2313 std::cout <<
"Cannot get VISP_SCENES_DIR environment variable" << std::endl;
2317 unsigned int name_length = 30;
2318 if (scene_dir_.size() > FILENAME_MAX)
2321 unsigned int full_length = (
unsigned int)scene_dir_.size() + name_length;
2322 if (full_length > FILENAME_MAX)
2325 char *name_cam =
new char [full_length];
2327 strcpy(name_cam, scene_dir_.c_str());
2328 strcat(name_cam,
"/camera.bnd");
2331 if (arm_dir.size() > FILENAME_MAX)
2333 full_length = (
unsigned int)arm_dir.size() + name_length;
2334 if (full_length > FILENAME_MAX)
2337 char *name_arm =
new char [full_length];
2338 strcpy(name_arm, arm_dir.c_str());
2339 strcat(name_arm,
"/viper850_arm1.bnd");
2341 strcpy(name_arm, arm_dir.c_str());
2342 strcat(name_arm,
"/viper850_arm2.bnd");
2344 strcpy(name_arm, arm_dir.c_str());
2345 strcat(name_arm,
"/viper850_arm3.bnd");
2347 strcpy(name_arm, arm_dir.c_str());
2348 strcat(name_arm,
"/viper850_arm4.bnd");
2350 strcpy(name_arm, arm_dir.c_str());
2351 strcat(name_arm,
"/viper850_arm5.bnd");
2353 strcpy(name_arm, arm_dir.c_str());
2354 strcat(name_arm,
"/viper850_arm6.bnd");
2363 add_rfstack(IS_BACK);
2365 add_vwstack (
"start",
"depth", 0.0, 100.0);
2366 add_vwstack (
"start",
"window", -0.1,0.1,-0.1,0.1);
2367 add_vwstack (
"start",
"type", PERSPECTIVE);
2381 bool changed =
false;
2385 if (std::fabs(displacement[2][3]) > std::numeric_limits<double>::epsilon())
2408 float w44o[4][4],w44cext[4][4],x,y,z;
2412 add_vwstack (
"start",
"cop", w44cext[3][0],w44cext[3][1],w44cext[3][2]);
2413 x = w44cext[2][0] + w44cext[3][0];
2414 y = w44cext[2][1] + w44cext[3][1];
2415 z = w44cext[2][2] + w44cext[3][2];
2416 add_vwstack (
"start",
"vrp", x,y,z);
2417 add_vwstack (
"start",
"vpn", w44cext[2][0],w44cext[2][1],w44cext[2][2]);
2418 add_vwstack (
"start",
"vup", w44cext[1][0],w44cext[1][1],w44cext[1][2]);
2419 add_vwstack (
"start",
"window", -u, u, -v, v);
2427 vp2jlc_matrix(fMit[0],w44o);
2430 vp2jlc_matrix(fMit[1],w44o);
2433 vp2jlc_matrix(fMit[2],w44o);
2436 vp2jlc_matrix(fMit[3],w44o);
2439 vp2jlc_matrix(fMit[6],w44o);
2447 cMe = fMit[6] * cMe;
2448 vp2jlc_matrix(cMe,w44o);
2454 vp2jlc_matrix(
fMo,w44o);
2494 std::cout <<
"Used joint coordinates (rad): " << articularCoordinates.
t() << std::endl;
2524 fMo = fMit[7] * cMo_;
2527 #elif !defined(VISP_BUILD_SHARED_LIBS)
2529 void dummy_vpSimulatorViper850() {};
static void displayCamera(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color, unsigned int thickness)
Implementation of a matrix and operations on matrices.
void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q)
void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)
void get_eJe(const vpColVector &q, vpMatrix &eJe) const
VISP_EXPORT int wait(double t0, double t)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &velocity)
bool singularityTest(const vpColVector q, vpMatrix &J)
vpHomogeneousMatrix eMc
End effector to camera transformation.
Error that can be emited by the vpRobot class and its derivates.
vpColVector get_artCoord()
virtual ~vpSimulatorViper850()
void get_fMi(vpHomogeneousMatrix *fMit)
void computeArticularVelocity()
static bool readPosFile(const char *filename, vpColVector &q)
static const vpToolType defaultTool
Default tool attached to the robot end effector.
unsigned int getWidth() const
void get_cMe(vpHomogeneousMatrix &cMe)
double getSamplingTime() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
unsigned int jointLimitArt
static void * launcher(void *arg)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Point coordinates conversion from normalized coordinates in meter to pixel coordinates ...
VISP_EXPORT double measureTimeSecond()
void getExternalImage(vpImage< vpRGBa > &I)
bool constantSamplingTimeMode
Flag used to force the sampling time in the thread computing the robot's displacement to a constant v...
bool singularityManagement
double getMaxTranslationVelocity(void) const
static const vpColor none
Initialize the position controller.
error that can be emited by ViSP classes.
void track(const vpHomogeneousMatrix &cMo)
void get_fJe(vpMatrix &fJe)
vpColVector get_velocity()
double get_y() const
Get the point y coordinate in the image plane.
static const char *const CONST_MARLIN_F033C_CAMERA_NAME
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
double getMaxRotationVelocity(void) const
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Class that defines what is a point.
static Type maximum(const Type &a, const Type &b)
Implementation of a rotation matrix and operations on such kind of matrices.
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
pthread_mutex_t mutex_artCoord
pthread_mutex_t mutex_display
void move(const char *filename)
vpDisplayRobotType displayType
Initialize the velocity controller.
vpCameraParameters cameraParam
void setJointLimit(const vpColVector &limitMin, const vpColVector &limitMax)
void setToolType(vpViper850::vpToolType tool)
Set the current tool type.
void setExternalCameraPosition(const vpHomogeneousMatrix camMf_)
Initialize the acceleration controller.
vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
void set_displayBusy(const bool &status)
vpCameraParametersProjType
void initialiseObjectRelativeToCamera(const vpHomogeneousMatrix &cMo)
static void display(const vpImage< unsigned char > &I)
vpToolType
List of possible tools that can be attached to the robot end-effector.
Generic class defining intrinsic camera parameters.
vpHomogeneousMatrix getExternalCameraPosition() const
void getDisplacement(const vpRobot::vpControlFrameType frame, vpColVector &displacement)
Modelisation of the ADEPT Viper 850 robot.
void extract(vpRotationMatrix &R) const
vpHomogeneousMatrix get_fMc(const vpColVector &q) const
double get_x() const
Get the point x coordinate in the image plane.
vpToolType getToolType() const
Get the current tool type.
static Type minimum(const Type &a, const Type &b)
Implementation of a velocity twist matrix and operations on such kind of matrices.
unsigned int getRows() const
Return the number of rows of the 2D array.
unsigned int getInverseKinematics(const vpHomogeneousMatrix &fMc, vpColVector &q, const bool &verbose=false) const
void set_velocity(const vpColVector &vel)
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
static double rad(double deg)
void setExternalCameraParameters(const vpCameraParameters &cam)
vpControlFrameType getRobotFrame(void) const
void get_fJe(const vpColVector &q, vpMatrix &fJe) const
This class aims to be a basis used to create all the simulators of robots.
vpRobot::vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
vpHomogeneousMatrix * fMi
VISP_EXPORT double measureTimeMs()
pthread_mutex_t mutex_fMi
void get_cMe(vpHomogeneousMatrix &cMe) const
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, unsigned int thickness=1, vpImagePoint offset=vpImagePoint(0, 0))
void updateArticularPosition()
bool setVelocityCalled
Flag used to specify to the thread managing the robot displacements that the setVelocity() method has...
void display_scene(Matrix mat, Bound_scene &sc, const vpImage< vpRGBa > &I, const vpColor &color)
vpHomogeneousMatrix camMf
vpHomogeneousMatrix navigation(const vpImage< vpRGBa > &I, bool &changed)
static double deg(double rad)
Implementation of column vector and the associated operations.
void setCameraParameters(const vpCameraParameters &cam)
Implementation of a pose vector and operations on poses.
vpHomogeneousMatrix inverse() const
virtual vpRobotStateType getRobotState(void) const
unsigned int getHeight() const
Implementation of a rotation vector as Euler angle minimal representation.
vpControlFrameType setRobotFrame(vpRobot::vpControlFrameType newFrame)
vpMatrix pseudoInverse(double svThreshold=1e-6) const
Compute the pseudo inverse of the matrix using the SVD.
void findHighestPositioningSpeed(vpColVector &q)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
void set_artCoord(const vpColVector &coord)
virtual void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
void get_cVe(vpVelocityTwistMatrix &cVe)
vpCameraParameters::vpCameraParametersProjType projModel
VISP_EXPORT double getMinTimeForUsleepCall()
void set_artVel(const vpColVector &vel)
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height)
void getVelocity(const vpRobot::vpControlFrameType frame, vpColVector &q)
pthread_mutex_t mutex_velocity
static const double defaultPositioningVelocity
static bool savePosFile(const char *filename, const vpColVector &q)
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.
double getPositioningVelocity(void)
pthread_mutex_t mutex_artVel
static const unsigned int njoint
Number of joint.
vpHomogeneousMatrix camMf2
bool initialiseCameraRelativeToObject(const vpHomogeneousMatrix &cMo)
static const char *const CONST_PTGREY_FLEA2_CAMERA_NAME
void get_eJe(vpMatrix &eJe)
void resize(const unsigned int i, const bool flagNullify=true)