This example displays information about a plugged RealSense sensor using librealsense2.
#include <iostream>
#include <visp3/sensor/vpRealSense2.h>
#if defined(VISP_HAVE_REALSENSE2) && defined(VISP_HAVE_CPP11_COMPATIBILITY)
int main()
{
try {
std::cout << "RealSense characteristics:\n" << rs << std::endl;
std::cout <<
"Depth scale: " << std::setprecision(std::numeric_limits<float>::max_digits10) << rs.
getDepthScale() << std::endl;
std::cerr <<
"RealSense error " << e.
what() << std::endl;
} catch (const std::exception &e) {
std::cerr << e.what() << std::endl;
}
return EXIT_SUCCESS;
}
#else
int main()
{
#if !defined(VISP_HAVE_REALSENSE2)
std::cout << "You do not have realsense2 SDK functionality enabled..." << std::endl;
std::cout << "Tip:" << std::endl;
std::cout << "- Install librealsense2, configure again ViSP using cmake and build again this example" << std::endl;
return EXIT_SUCCESS;
#endif
#if !defined(VISP_HAVE_CPP11_COMPATIBILITY)
std::cout << "You do not build ViSP with C++11 compiler flag" << std::endl;
std::cout << "Tip:" << std::endl;
std::cout << "- Configure ViSP again using cmake -DUSE_CPP11=ON, and build again this example" << std::endl;
#endif
return EXIT_SUCCESS;
}
#endif