44 #include <visp3/gui/vpPlot.h>
45 #include <visp3/sensor/vpForceTorqueAtiNetFTSensor.h>
47 int main(
int argc,
char **argv)
51 #ifdef VISP_HAVE_FUNC_INET_NTOP
53 std::string opt_ip =
"192.168.1.1";
55 bool opt_no_display =
false;
57 for (
int i = 0; i < argc; i++) {
58 if (std::string(argv[i]) ==
"--ip")
59 opt_ip = std::string(argv[i + 1]);
60 else if (std::string(argv[i]) ==
"--port")
61 opt_port = atoi(argv[i + 1]);
62 else if (std::string(argv[i]) ==
"--no-display" || std::string(argv[i]) ==
"-d")
63 opt_no_display =
true;
64 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
65 std::cout <<
"\nUsage: " << argv[0]
66 <<
" [--ip <Net F/T IP address (default: 192.168.1.1)>] [--port <Ethernet port (default: 49152)>]"
67 <<
" [--no-display] [-d] [--help] [-h]\n"
73 std::cout <<
"Use IP : " << opt_ip << std::endl;
74 std::cout <<
"Use port: " << opt_port << std::endl;
75 std::cout <<
"Disable display: " << opt_no_display << std::endl;
78 ati_net_ft.
init(opt_ip, opt_port);
80 std::cout <<
"Unable to start streaming" << std::endl;
84 #if defined(VISP_HAVE_DISPLAY)
86 if (!opt_no_display) {
87 plotter =
new vpPlot(2, 700, 700, 100, 200,
"Curves...");
89 plotter->
setTitle(0,
"Force measurements");
94 plotter->
setTitle(1,
"Torque measurements");
104 unsigned long nbacq = 0;
111 #if defined(VISP_HAVE_DISPLAY)
112 if (!opt_no_display) {
115 plotter->
plot(0, nbacq, force);
116 plotter->
plot(1, nbacq, torque);
131 std::cout <<
"Bias F/T sensor" << std::endl;
134 std::cout <<
"Unbias F/T sensor" << std::endl;
141 std::cout <<
"F/T: " << ft.
t() << std::endl;
147 std::cout <<
"F/T: " << ft.
t() << std::endl;
160 #if defined(VISP_HAVE_DISPLAY)
166 std::cout <<
"Mean acquisition frequency: " << fps <<
" Hz" << std::endl;
167 std::cout <<
"Test succeed" << std::endl;
171 std::cout <<
"vpForceTorqueAtiNetFTSensor is not supported on this platform" << std::endl;
Implementation of column vector and the associated operations.
vpColVector extract(unsigned int r, unsigned int colsize) const
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
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)
vpColVector getForceTorque() const
void bias(unsigned int n_counts=50)
bool waitForNewData(unsigned int timeout=50)
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...
void initGraph(unsigned int graphNum, unsigned int curveNbr)
vpImage< unsigned char > I
void setLegend(unsigned int graphNum, unsigned int curveNum, const std::string &legend)
void plot(unsigned int graphNum, unsigned int curveNum, double x, double y)
void setTitle(unsigned int graphNum, const std::string &title)
void init(const std::string &hostname, int port)
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT double measureTimeMs()