47 #include <visp3/gui/vpPlot.h> 48 #include <visp3/sensor/vpForceTorqueIitSensor.h> 50 int main(
int argc,
char **argv)
52 #ifdef VISP_HAVE_FT_IIT_SDK 53 bool opt_no_display =
false;
54 bool opt_filtered =
false;
56 for (
int i = 0; i < argc; i++) {
57 if (std::string(argv[i]) ==
"--no-display" || std::string(argv[i]) ==
"-d")
58 opt_no_display =
true;
59 if (std::string(argv[i]) ==
"--filtered" || std::string(argv[i]) ==
"-f")
61 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
62 std::cout <<
"\nUsage: " << argv[0] <<
" [--no-display] [--filtered] [--help] [-d] [-f] [-h]\n" << std::endl;
67 std::cout <<
"Disable display: " << opt_no_display << std::endl;
71 #if defined(VISP_HAVE_DISPLAY) 73 if (!opt_no_display) {
74 plotter =
new vpPlot(2, 700, 700, 100, 200,
"Curves...");
76 plotter->
setTitle(0,
"Force measurements");
81 plotter->
setTitle(1,
"Torque measurements");
89 std::cout <<
"Unable to connect to IIT force-torque sensor" << std::endl;
98 unsigned long nbacq = 0;
104 #if defined(VISP_HAVE_DISPLAY) 105 if (!opt_no_display) {
108 plotter->
plot(0, nbacq, force);
109 plotter->
plot(1, nbacq, torque);
120 std::cout <<
"F/T: " << ft.
t() << std::endl;
126 std::cout <<
"F/T: " << ft.
t() << std::endl;
137 std::cout <<
"Mean acquisition frequency: " << fps <<
" Hz" << std::endl;
139 #if defined(VISP_HAVE_DISPLAY) 145 std::cout <<
"Test succeed" << std::endl;
150 std::cout <<
"ViSP is not build with IIT force-torque SDK support" << std::endl;
VISP_EXPORT int wait(double t0, double t)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
vpImage< unsigned char > I
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
vpColVector extract(unsigned int r, unsigned int colsize) const
void setLegend(unsigned int graphNum, unsigned int curveNum, const std::string &legend)
static void flush(const vpImage< unsigned char > &I)
bool connected(int timeout_ms=0) const
VISP_EXPORT double measureTimeMs()
void setTitle(unsigned int graphNum, const std::string &title)
void plot(unsigned int graphNum, unsigned int curveNum, double x, double y)
void initGraph(unsigned int graphNum, unsigned int curveNbr)
Implementation of column vector and the associated operations.
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...
vpColVector getForceTorque(bool filtered=false)