Example of a real robot control, the ptu-46 robot (pan-tilt turret). The robot is controlled first in position, then in velocity.
#include <visp/vpConfig.h>
#include <visp/vpDebug.h>
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
# include <unistd.h>
#endif
#ifdef VISP_HAVE_PTU46
#include <visp/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) ;
}
catch (...)
{
std::cout << "Sorry PtU46 not available ..." << std::endl;
}
return 0;
}
#else
int
main()
{
vpERROR_TRACE(
"You do not have a ptu-46 robot connected to your computer...");
return 0;
}
#endif