52 #include <visp3/robot/vpVirtuose.h> 53 #include <visp3/core/vpImage.h> 54 #include <visp3/core/vpCameraParameters.h> 55 #include <visp3/core/vpMeterPixelConversion.h> 56 #include <visp3/gui/vpDisplayX.h> 57 #include <visp3/gui/vpDisplayGDI.h> 59 #if defined(VISP_HAVE_VIRTUOSE) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) 65 std::vector<vpVirtuose> virtuose(4);
66 std::vector<vpHomogeneousMatrix> wMd(4);
72 for (
size_t device=0; device < virtuose.size(); device ++) {
73 std::stringstream ss; ss << port + device;
74 std::string ip =
"localhost#" + ss.str();
75 std::cout <<
"Connect to: " << ip << std::endl;
77 virtuose[device].setIpAddress(ip);
78 virtuose[device].init();
81 std::cout <<
"After init" << std::endl;
84 for (
size_t device=0; device < virtuose.size(); device ++) {
85 std::cout <<
"Number of joints: " << virtuose[device].getJointsNumber()
86 <<
" Joint position: " << virtuose[device].getArticularPosition().t() << std::endl
87 <<
" Cartesian position: " << virtuose[device].getAvatarPosition().t() << std::endl;
95 #if defined(VISP_HAVE_X11) 97 #elif defined(VISP_HAVE_GDI) 104 for (
size_t device=0; device < virtuose.size(); device ++) {
105 vpPoseVector wpd = virtuose[device].getAvatarPosition();
106 std::cout <<
"Device #" << device <<
" has position: " << wpd.
t() << std::endl;
107 wMd[device].buildFrom(wpd);
112 std::stringstream ss;
114 double X = cMd[0][3];
115 double Y = cMd[1][3];
116 double Z = cMd[2][3];
130 for (
size_t device=0; device < virtuose.size(); device ++) {
131 virtuose[device].close();
133 std::cout <<
"The end" << std::endl;
137 int main() { std::cout <<
"You should install Virtuose API to use this binary..." << std::endl; }
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Display for windows using GDI (available on any windows 32 platform).
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
vpHomogeneousMatrix inverse() const
static void flush(const vpImage< unsigned char > &I)
static void display(const vpImage< unsigned char > &I)
Generic class defining intrinsic camera parameters.
static double rad(double deg)
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, const vpImagePoint &offset=vpImagePoint(0, 0))
Implementation of a pose vector and operations on poses.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static const vpColor white