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;
55 for (
int i = 0; i < argc; i++) {
56 if (std::string(argv[i]) ==
"--no-display" || std::string(argv[i]) ==
"-d")
57 opt_no_display =
true;
58 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
59 std::cout <<
"\nUsage: " << argv[0] <<
" [--no-display] [-d] [--help] [-h]\n" << std::endl;
64 std::cout <<
"Disable display: " << opt_no_display << std::endl;
68 #if defined(VISP_HAVE_DISPLAY) 70 if (!opt_no_display) {
71 plotter =
new vpPlot(2, 700, 700, 100, 200,
"Curves...");
73 plotter->
setTitle(0,
"Force measurements");
78 plotter->
setTitle(1,
"Torque measurements");
86 std::cout <<
"Unable to connect to IIT force-torque sensor" << std::endl;
95 unsigned long nbacq = 0;
101 #if defined(VISP_HAVE_DISPLAY) 102 if (!opt_no_display) {
105 plotter->
plot(0, nbacq, force);
106 plotter->
plot(1, nbacq, torque);
117 std::cout <<
"F/T: " << ft.
t() << std::endl;
123 std::cout <<
"F/T: " << ft.
t() << std::endl;
134 std::cout <<
"Mean acquisition frequency: " << fps <<
" Hz" << std::endl;
136 #if defined(VISP_HAVE_DISPLAY) 142 std::cout <<
"Test succeed" << std::endl;
147 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()
vpColVector getForceTorque()
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...