43 #include <visp3/core/vpMeterPixelConversion.h>
44 #include <visp3/gui/vpDisplayX.h>
45 #include <visp3/sensor/vpRealSense2.h>
47 #if defined(VISP_HAVE_REALSENSE2) && (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) && \
48 (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && (RS2_API_VERSION > ((2 * 10000) + (31 * 100) + 0))
52 #ifdef ENABLE_VISP_NAMESPACE
60 std::cout <<
"Product line: " << product_line << std::endl;
62 if (product_line !=
"T200") {
63 std::cout <<
"This example doesn't support devices that are not part of T200 product line family !" << std::endl;
67 config.enable_stream(RS2_STREAM_ACCEL);
68 config.enable_stream(RS2_STREAM_GYRO);
73 rs.getIMUData(&imu_acc, &imu_vel,
nullptr);
75 std::cout <<
"Gyro vel: x = " << std::setw(12) << imu_vel[0] <<
" y = " << std::setw(12) << imu_vel[1]
76 <<
" z = " << std::setw(12) << imu_vel[2];
77 std::cout <<
" Accel: x = " << std::setw(12) << imu_acc[0] <<
" y = " << std::setw(12) << imu_acc[1]
78 <<
" z = " << std::setw(12) << imu_acc[2];
79 std::cout << std::endl;
83 std::cerr <<
"RealSense error " << e.
what() << std::endl;
85 catch (
const std::exception &e) {
86 std::cerr << e.what() << std::endl;
94 #if !defined(VISP_HAVE_REALSENSE2)
95 std::cout <<
"You do not realsense2 SDK functionality enabled..." << std::endl;
96 std::cout <<
"Tip:" << std::endl;
97 std::cout <<
"- Install librealsense2, configure again ViSP using cmake and build again this example" << std::endl;
99 #elif !(defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI))
100 std::cout <<
"You don't have X11 or GDI display capabilities" << std::endl;
101 #elif !(RS2_API_VERSION > ((2 * 10000) + (31 * 100) + 0))
102 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()