42 #include <visp3/gui/vpPlot.h>
43 #include <visp3/sensor/vpForceTorqueAtiNetFTSensor.h>
45 int main(
int argc,
char **argv)
47 #ifdef ENABLE_VISP_NAMESPACE
52 #ifdef VISP_HAVE_FUNC_INET_NTOP
54 std::string opt_ip =
"192.168.1.1";
56 bool opt_no_display =
false;
58 for (
int i = 0; i < argc; i++) {
59 if (std::string(argv[i]) ==
"--ip")
60 opt_ip = std::string(argv[i + 1]);
61 else if (std::string(argv[i]) ==
"--port")
62 opt_port = atoi(argv[i + 1]);
63 else if (std::string(argv[i]) ==
"--no-display" || std::string(argv[i]) ==
"-d")
64 opt_no_display =
true;
65 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
66 std::cout <<
"\nUsage: " << argv[0]
67 <<
" [--ip <Net F/T IP address (default: 192.168.1.1)>] [--port <Ethernet port (default: 49152)>]"
68 <<
" [--no-display] [-d] [--help] [-h]\n"
74 std::cout <<
"Use IP : " << opt_ip << std::endl;
75 std::cout <<
"Use port: " << opt_port << std::endl;
76 std::cout <<
"Disable display: " << opt_no_display << std::endl;
79 ati_net_ft.
init(opt_ip, opt_port);
81 std::cout <<
"Unable to start streaming" << std::endl;
85 #if defined(VISP_HAVE_DISPLAY)
87 if (!opt_no_display) {
88 plotter =
new vpPlot(2, 700, 700, 100, 200,
"Curves...");
90 plotter->
setTitle(0,
"Force measurements");
95 plotter->
setTitle(1,
"Torque measurements");
105 unsigned long nbacq = 0;
112 #if defined(VISP_HAVE_DISPLAY)
113 if (!opt_no_display) {
116 plotter->
plot(0, nbacq, force);
117 plotter->
plot(1, nbacq, torque);
134 std::cout <<
"Bias F/T sensor" << std::endl;
138 std::cout <<
"Unbias F/T sensor" << std::endl;
146 std::cout <<
"F/T: " << ft.
t() << std::endl;
152 std::cout <<
"F/T: " << ft.
t() << std::endl;
165 #if defined(VISP_HAVE_DISPLAY)
171 std::cout <<
"Mean acquisition frequency: " << fps <<
" Hz" << std::endl;
172 std::cout <<
"Test succeed" << std::endl;
176 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()