 |
Visual Servoing Platform
version 3.3.0
|
47 #include <visp3/gui/vpPlot.h>
48 #include <visp3/sensor/vpForceTorqueAtiNetFTSensor.h>
50 int main(
int argc,
char **argv)
54 #ifdef VISP_HAVE_FUNC_INET_NTOP
56 std::string opt_ip =
"192.168.1.1";
58 bool opt_no_display =
false;
60 for (
int i = 0; i < argc; i++) {
61 if (std::string(argv[i]) ==
"--ip")
62 opt_ip = std::string(argv[i + 1]);
63 else if (std::string(argv[i]) ==
"--port")
64 opt_port = atoi(argv[i + 1]);
65 else if (std::string(argv[i]) ==
"--no-display" || std::string(argv[i]) ==
"-d")
66 opt_no_display =
true;
67 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
68 std::cout <<
"\nUsage: " << argv[0]
69 <<
" [--ip <Net F/T IP address (default: 192.168.1.1)>] [--port <Ethernet port (default: 49152)>]"
70 <<
" [--no-display] [-d] [--help] [-h]\n"
76 std::cout <<
"Use IP : " << opt_ip << std::endl;
77 std::cout <<
"Use port: " << opt_port << std::endl;
78 std::cout <<
"Disable display: " << opt_no_display << std::endl;
81 ati_net_ft.
init(opt_ip, opt_port);
83 std::cout <<
"Unable to start streaming" << std::endl;
87 #if defined(VISP_HAVE_DISPLAY)
89 if (!opt_no_display) {
90 plotter =
new vpPlot(2, 700, 700, 100, 200,
"Curves...");
92 plotter->
setTitle(0,
"Force measurements");
97 plotter->
setTitle(1,
"Torque measurements");
107 unsigned long nbacq = 0;
114 #if defined(VISP_HAVE_DISPLAY)
115 if (!opt_no_display) {
118 plotter->
plot(0, nbacq, force);
119 plotter->
plot(1, nbacq, torque);
134 std::cout <<
"Bias F/T sensor" << std::endl;
137 std::cout <<
"Unbias F/T sensor" << std::endl;
144 std::cout <<
"F/T: " << ft.
t() << std::endl;
150 std::cout <<
"F/T: " << ft.
t() << std::endl;
163 #if defined(VISP_HAVE_DISPLAY)
169 std::cout <<
"Mean acquisition frequency: " << fps <<
" Hz" << std::endl;
170 std::cout <<
"Test succeed" << std::endl;
174 std::cout <<
"vpForceTorqueAtiNetFTSensor is not supported on this platform" << std::endl;
VISP_EXPORT int wait(double t0, double t)
void init(const std::string &hostname, int port)
void bias(unsigned int n_counts=50)
vpImage< unsigned char > I
vpColVector extract(unsigned int r, unsigned int colsize) const
Implementation of column vector and the associated operations.
VISP_EXPORT double measureTimeMs()
void setLegend(unsigned int graphNum, unsigned int curveNum, const std::string &legend)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
bool waitForNewData(unsigned int timeout=50)
void setTitle(unsigned int graphNum, const std::string &title)
void plot(unsigned int graphNum, unsigned int curveNum, double x, double y)
static void flush(const vpImage< unsigned char > &I)
void initGraph(unsigned int graphNum, unsigned int curveNbr)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...
vpColVector getForceTorque() const