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)) 64 std::string ip =
"localhost";
66 std::vector<vpVirtuose> virtuose(4);
67 std::vector<vpHomogeneousMatrix> wMd(4);
73 for (
size_t device=0; device < virtuose.size(); device ++) {
74 std::cout <<
"Try to connect to " << ip <<
" port " << (port + device) << std::endl;
75 virtuose[device].setIpAddressAndPort(ip, port + static_cast<int>(device));
76 virtuose[device].init();
79 std::cout <<
"After init" << std::endl;
82 for (
size_t device=0; device < virtuose.size(); device ++) {
83 std::cout <<
"Number of joints: " << virtuose[device].getJointsNumber()
84 <<
" Joint position: " << virtuose[device].getArticularPosition().t() << std::endl
85 <<
" Cartesian position: " << virtuose[device].getAvatarPosition().t() << std::endl;
93 #if defined(VISP_HAVE_X11) 95 #elif defined(VISP_HAVE_GDI) 102 for (
size_t device=0; device < virtuose.size(); device ++) {
103 vpPoseVector wpd = virtuose[device].getAvatarPosition();
104 std::cout <<
"Device #" << device <<
" has position: " << wpd.
t() << std::endl;
105 wMd[device].buildFrom(wpd);
110 std::stringstream ss;
112 double X = cMd[0][3];
113 double Y = cMd[1][3];
114 double Z = cMd[2][3];
128 for (
size_t device=0; device < virtuose.size(); device ++) {
129 virtuose[device].close();
131 std::cout <<
"The end" << std::endl;
135 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...
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.
vpHomogeneousMatrix inverse() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static const vpColor white