45#include <visp3/core/vpMeterPixelConversion.h>
46#include <visp3/gui/vpDisplayX.h>
47#include <visp3/sensor/vpRealSense2.h>
49#if defined(VISP_HAVE_REALSENSE2) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) && \
50 (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && (RS2_API_VERSION > ((2 * 10000) + (31 * 100) + 0))
59 std::cout <<
"Product line: " << product_line << std::endl;
61 if (product_line !=
"T200") {
62 std::cout <<
"This example doesn't support devices that are not part of T200 product line family !" << std::endl;
66 config.enable_stream(RS2_STREAM_ACCEL);
67 config.enable_stream(RS2_STREAM_GYRO);
74 std::cout <<
"Gyro vel: x = " << std::setw(12) << imu_vel[0] <<
" y = " << std::setw(12) << imu_vel[1]
75 <<
" z = " << std::setw(12) << imu_vel[2];
76 std::cout <<
" Accel: x = " << std::setw(12) << imu_acc[0] <<
" y = " << std::setw(12) << imu_acc[1]
77 <<
" z = " << std::setw(12) << imu_acc[2];
78 std::cout << std::endl;
81 std::cerr <<
"RealSense error " << e.
what() << std::endl;
82 }
catch (
const std::exception &e) {
83 std::cerr << e.what() << std::endl;
91#if !defined(VISP_HAVE_REALSENSE2)
92 std::cout <<
"You do not realsense2 SDK functionality enabled..." << std::endl;
93 std::cout <<
"Tip:" << std::endl;
94 std::cout <<
"- Install librealsense2, configure again ViSP using cmake and build again this example" << std::endl;
96#elif (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
97 std::cout <<
"You do not build ViSP with c++11 or higher compiler flag" << std::endl;
98 std::cout <<
"Tip:" << std::endl;
99 std::cout <<
"- Configure ViSP again using cmake -DUSE_CXX_STANDARD=11, and build again this example" << std::endl;
100#elif !(defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI))
101 std::cout <<
"You don't have X11 or GDI display capabilities" << std::endl;
102#elif !(RS2_API_VERSION > ((2 * 10000) + (31 * 100) + 0))
103 std::cout <<
"Install librealsense version > 2.31.0" << std::endl;
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
const char * what() const
bool open(const rs2::config &cfg=rs2::config())
std::string getProductLine()
void getIMUData(vpColVector *imu_vel, vpColVector *imu_acc, double *ts)