47 #include <visp3/core/vpCameraParameters.h>
48 #include <visp3/core/vpImage.h>
49 #include <visp3/core/vpMeterPixelConversion.h>
50 #include <visp3/gui/vpDisplayGDI.h>
51 #include <visp3/gui/vpDisplayX.h>
52 #include <visp3/robot/vpVirtuose.h>
54 #if defined(VISP_HAVE_VIRTUOSE) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI))
58 #ifdef ENABLE_VISP_NAMESPACE
62 std::string ip =
"localhost";
64 std::vector<vpVirtuose> virtuose(4);
65 std::vector<vpHomogeneousMatrix> wMd(4);
71 for (
size_t device = 0; device < virtuose.size(); device++) {
72 std::cout <<
"Try to connect to " << ip <<
" port " << (port + device) << std::endl;
73 virtuose[device].setIpAddressAndPort(ip, port +
static_cast<int>(device));
74 virtuose[device].init();
77 std::cout <<
"After init" << std::endl;
80 for (
size_t device = 0; device < virtuose.size(); device++) {
81 std::cout <<
"Number of joints: " << virtuose[device].getJointsNumber()
82 <<
" Joint position: " << virtuose[device].getArticularPosition().t() << std::endl
83 <<
" Cartesian position: " << virtuose[device].getAvatarPosition().t() << std::endl;
91 #if defined(VISP_HAVE_X11)
93 #elif defined(VISP_HAVE_GDI)
100 for (
size_t device = 0; device < virtuose.size(); device++) {
101 vpPoseVector wpd = virtuose[device].getAvatarPosition();
102 std::cout <<
"Device #" << device <<
" has position: " << wpd.
t() << std::endl;
103 wMd[device].buildFrom(wpd);
108 std::stringstream ss;
110 double X = cMd[0][3];
111 double Y = cMd[1][3];
112 double Z = cMd[2][3];
125 for (
size_t device = 0; device < virtuose.size(); device++) {
126 virtuose[device].close();
128 std::cout <<
"The end" << std::endl;
132 int main() { std::cout <<
"You should install Virtuose API to use this binary..." << std::endl; }
Generic class defining intrinsic camera parameters.
static const vpColor white
Display for windows using GDI (available on any windows 32 platform).
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
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), const std::string &frameName="", const vpColor &textColor=vpColor::black, const vpImagePoint &textOffset=vpImagePoint(15, 15))
static void flush(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix inverse() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static double rad(double deg)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Implementation of a pose vector and operations on poses.