Example of a real robot control, the ptu-46 robot (pan-tilt turret). The robot is controlled first in position, then in velocity.
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpDebug.h>
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
#include <unistd.h>
#endif
#ifdef VISP_HAVE_PTU46
#include <visp3/robot/vpRobotPtu46.h>
int main()
{
try {
q = 0;
vpCTRACE <<
"Set position in the articular frame: " << q.
t();
vpCTRACE <<
"Set position in the articular frame: " << q.
t();
vpCTRACE <<
"Position in the articular frame " << qm.
t();
#if 0
qdot = 0 ;
vpCTRACE <<
"Set camera frame velocity " << qdot.
t() ;
sleep(2) ;
qdot = 0 ;
vpCTRACE <<
"Set camera frame velocity " << qdot.
t() ;
sleep(2) ;
#endif
qdot = 0;
vpCTRACE <<
"Set articular frame velocity " << qdot.
t();
sleep(2);
qdot = 0;
vpCTRACE <<
"Set articular frame velocity " << qdot.
t();
sleep(2);
}
std::cout << "Sorry PtU46 not available. Got exception: " << e << std::endl;
return EXIT_FAILURE
}
return EXIT_SUCCESS;
}
#else
int main()
{
std::cout << "You do not have an PTU46 PT robot connected to your computer..." << std::endl;
return EXIT_SUCCESS;
}
#endif