44 #include <visp3/core/vpConfig.h>
46 #if defined(VISP_HAVE_OCCIPITAL_STRUCTURE) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
48 #include <visp3/gui/vpPlot.h>
49 #include <visp3/sensor/vpOccipitalStructure.h>
54 double initial_ts, ts;
58 ST::CaptureSessionSettings settings;
59 settings.source = ST::CaptureSessionSourceId::StructureCore;
60 settings.structureCore.depthEnabled =
true;
61 settings.structureCore.visibleEnabled =
true;
62 settings.structureCore.accelerometerEnabled =
true;
63 settings.structureCore.gyroscopeEnabled =
true;
64 settings.structureCore.imuUpdateRate = ST::StructureCoreIMUUpdateRate::AccelAndGyro_1000Hz;
69 vpPlot acceleration_plotter(1, 400, 800, 10, 10,
"Accelerations");
70 vpPlot rotationRate_plotter(1, 400, 800, 10, 450,
"Rotation rates");
71 acceleration_plotter.initGraph(0, 3);
72 rotationRate_plotter.initGraph(0, 3);
81 acceleration_plotter.plot(0, 0, 0, 0);
82 acceleration_plotter.plot(0, 1, 0, 0);
83 acceleration_plotter.plot(0, 2, 0, 0);
84 rotationRate_plotter.plot(0, 0, 0, 0);
85 rotationRate_plotter.plot(0, 1, 0, 0);
86 rotationRate_plotter.plot(0, 2, 0, 0);
88 acceleration_plotter.setLegend(0, 0,
"X axis");
89 acceleration_plotter.setLegend(0, 1,
"Y axis");
90 acceleration_plotter.setLegend(0, 2,
"Z axis");
91 rotationRate_plotter.setLegend(0, 0,
"X axis");
92 rotationRate_plotter.setLegend(0, 1,
"Y axis");
93 rotationRate_plotter.setLegend(0, 2,
"Z axis");
95 sc.
getIMUData(&imu_vel, &imu_acc, &initial_ts);
101 acceleration_plotter.plot(0, ts - initial_ts, imu_acc);
102 rotationRate_plotter.plot(0, ts - initial_ts, imu_vel);
109 std::cerr <<
"Structure SDK error " << e.
what() << std::endl;
111 catch (
const std::exception &e) {
112 std::cerr << e.what() << std::endl;
120 #if !defined( VISP_HAVE_OCCIPITAL_STRUCTURE )
121 std::cout <<
"You do not have Occipital Structure SDK functionality enabled..." << std::endl;
122 std::cout <<
"Tip:" << std::endl;
123 std::cout <<
"- Install libStructure, configure again ViSP using cmake and build again this example" << std::endl;
125 #elif ( VISP_CXX_STANDARD < VISP_CXX_STANDARD_11 )
126 std::cout <<
"You do not build ViSP with c++11 or higher compiler flag" << std::endl;
127 std::cout <<
"Tip:" << std::endl;
128 std::cout <<
"- Configure ViSP again using cmake -DUSE_CXX_STANDARD=11, and build again this example" << std::endl;
Implementation of column vector and the associated operations.
static const vpColor blue
static const vpColor green
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
error that can be emitted by ViSP classes.
const char * what() const
void getIMUData(vpColVector *imu_vel, vpColVector *imu_acc, double *ts=nullptr)
bool open(const ST::CaptureSessionSettings &settings)
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...