Example of robot pose usage.
Show how to compute rMo = rMc * cMo with cMo obtained by pose computation and rMc from the robot position.
#include <visp/vpConfig.h>
#include <visp/vpImage.h>
#include <visp/vpDisplayX.h>
#include <visp/vpDisplayOpenCV.h>
#include <visp/vpDisplayGTK.h>
#include <visp/vpRobotViper850.h>
#include <visp/vpCameraParameters.h>
#include <visp/vpPixelMeterConversion.h>
#include <visp/vp1394TwoGrabber.h>
#include <visp/vpPoint.h>
#include <visp/vpDot.h>
#include <visp/vpPose.h>
#include <visp/vpDebug.h>
#include <iostream>
#if defined(VISP_HAVE_VIPER850) && defined(VISP_HAVE_DC1394_2)
int main()
{
try {
bool reset = false;
#ifdef VISP_HAVE_X11
#elif defined(VISP_HAVE_OPENCV)
#elif defined(VISP_HAVE_GTK)
#endif
double sdim = 0.077;
for (int i=0; i < 4; i ++) {
std::cout << "Click on dot " << i << std::endl;
std::cout <<
" Coordinates: " << dot[i].
getCog() << std::endl;
}
for (int i=0; i < 4; i ++) {
double x=0, y=0 ;
}
for (int i=0; i < 4; i ++) {
}
std::cout << "Pose cMo: " << std::endl << cMo;
std::cout << " rotation: "
<<
vpMath::deg(r[2]) <<
" deg" << std::endl << std::endl;
std::cout << "Robot pose in reference frame: " << p << std::endl;
t[0] = p[0]; t[1] = p[1]; t[2] = p[2];
r[0] = p[3]; r[1] = p[4]; r[2] = p[5];
std::cout << "Pose rMc: " << std::endl << rMc;
std::cout << " rotation: "
<<
vpMath::deg(r[2]) <<
" deg" << std::endl << std::endl;
std::cout << "Robot pose in articular: " << p << std::endl;
std::cout << "Pose rMc from MGD: " << std::endl << rMc;
std::cout << " rotation: "
<<
vpMath::deg(r[2]) <<
" deg" << std::endl << std::endl;
rMo = rMc * cMo;
std::cout << "Pose rMo = rMc * cMo: " << std::endl << rMo;
std::cout << " rotation: "
<<
vpMath::deg(r[2]) <<
" deg" << std::endl << std::endl;
}
std::cout << "Catch an exception: " << e << std::endl;
}
return 0;
}
#else
int main()
{
std::cout << "Sorry, test not valid. You should have an Viper850 robot..."
<< std::endl;
return 0;
}
#endif