diff --git a/examples/align/rs-align.cpp b/examples/align/rs-align.cpp index 3e6c21cfb9..97ed828751 100644 --- a/examples/align/rs-align.cpp +++ b/examples/align/rs-align.cpp @@ -3,7 +3,6 @@ #include #include "example-imgui.hpp" -#include "../examples/example-utils.hpp" /* This example introduces the concept of spatial stream alignment. diff --git a/examples/ar-advanced/rs-ar-advanced.cpp b/examples/ar-advanced/rs-ar-advanced.cpp index 44f0905810..a6c4825af9 100644 --- a/examples/ar-advanced/rs-ar-advanced.cpp +++ b/examples/ar-advanced/rs-ar-advanced.cpp @@ -9,7 +9,6 @@ #include #include #include "example.hpp" -#include "../examples/example-utils.hpp" struct point3d { float f[3]; diff --git a/examples/example.hpp b/examples/example.hpp index 9d4a2fbe66..7129672d43 100644 --- a/examples/example.hpp +++ b/examples/example.hpp @@ -19,6 +19,7 @@ #include #include "../third-party/stb_easy_font.h" +#include "example-utils.hpp" #ifndef PI #define PI 3.14159265358979323846 diff --git a/examples/measure/rs-measure.cpp b/examples/measure/rs-measure.cpp index f9f3377af0..d0423c3a1d 100644 --- a/examples/measure/rs-measure.cpp +++ b/examples/measure/rs-measure.cpp @@ -14,7 +14,6 @@ #include #include #include -#include "../examples/example-utils.hpp" using pixel = std::pair; diff --git a/examples/pose-and-image/CMakeLists.txt b/examples/pose-and-image/CMakeLists.txt index 993b078dda..dd2a22453e 100644 --- a/examples/pose-and-image/CMakeLists.txt +++ b/examples/pose-and-image/CMakeLists.txt @@ -20,6 +20,7 @@ endif() if(BUILD_EXAMPLES) add_executable(rs-pose-and-image rs-pose-and-image.cpp) target_link_libraries(rs-pose-and-image ${DEPENDENCIES}) + include_directories(../../examples) set_target_properties (rs-pose-and-image PROPERTIES FOLDER Examples) install(TARGETS rs-pose-and-image RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/pose-and-image/rs-pose-and-image.cpp b/examples/pose-and-image/rs-pose-and-image.cpp index e0cc0b286a..0640d05948 100644 --- a/examples/pose-and-image/rs-pose-and-image.cpp +++ b/examples/pose-and-image/rs-pose-and-image.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "../examples/example-utils.hpp" +#include "example.hpp" int main(int argc, char * argv[]) try { diff --git a/examples/pose-predict/CMakeLists.txt b/examples/pose-predict/CMakeLists.txt index b23297fc6e..2dc862eaca 100644 --- a/examples/pose-predict/CMakeLists.txt +++ b/examples/pose-predict/CMakeLists.txt @@ -9,6 +9,7 @@ if(BUILD_EXAMPLES) add_executable(rs-pose-predict rs-pose-predict.cpp) set_property(TARGET rs-pose-predict PROPERTY CXX_STANDARD 11) target_link_libraries(rs-pose-predict ${DEPENDENCIES}) + include_directories(../../examples) set_target_properties (rs-pose-predict PROPERTIES FOLDER Examples) install(TARGETS rs-pose-predict RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/pose-predict/rs-pose-predict.cpp b/examples/pose-predict/rs-pose-predict.cpp index 13f9aaf1a1..f81582574a 100644 --- a/examples/pose-predict/rs-pose-predict.cpp +++ b/examples/pose-predict/rs-pose-predict.cpp @@ -9,7 +9,7 @@ #include #include -#include "../examples/example-utils.hpp" +#include "example.hpp" inline rs2_quaternion quaternion_exp(rs2_vector v) { diff --git a/examples/pose/CMakeLists.txt b/examples/pose/CMakeLists.txt index 7e71cabc3a..3f4553601b 100644 --- a/examples/pose/CMakeLists.txt +++ b/examples/pose/CMakeLists.txt @@ -9,6 +9,7 @@ if(BUILD_EXAMPLES) add_executable(rs-pose rs-pose.cpp) set_property(TARGET rs-pose PROPERTY CXX_STANDARD 11) target_link_libraries(rs-pose ${DEPENDENCIES}) + include_directories(../../examples) set_target_properties (rs-pose PROPERTIES FOLDER Examples) install(TARGETS rs-pose RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/pose/rs-pose.cpp b/examples/pose/rs-pose.cpp index 76597fe53e..2cffe77547 100644 --- a/examples/pose/rs-pose.cpp +++ b/examples/pose/rs-pose.cpp @@ -3,7 +3,7 @@ #include #include #include -#include "../examples/example-utils.hpp" +#include "example.hpp" int main(int argc, char * argv[]) try { diff --git a/examples/trajectory/rs-trajectory.cpp b/examples/trajectory/rs-trajectory.cpp index 7196b1e10e..62cf49b294 100644 --- a/examples/trajectory/rs-trajectory.cpp +++ b/examples/trajectory/rs-trajectory.cpp @@ -4,7 +4,6 @@ #include #include "example.hpp" // Include short list of convenience functions for rendering #include -#include "../examples/example-utils.hpp" struct short3 { diff --git a/tools/benchmark/CMakeLists.txt b/tools/benchmark/CMakeLists.txt index 7d15ae13e2..c847c31d2c 100644 --- a/tools/benchmark/CMakeLists.txt +++ b/tools/benchmark/CMakeLists.txt @@ -21,7 +21,7 @@ endif() if(BUILD_GRAPHICAL_EXAMPLES) add_executable(rs-benchmark rs-benchmark.cpp ../../third-party/glad/glad.c) target_link_libraries(rs-benchmark ${DEPENDENCIES} realsense2-gl) - include_directories(../../third-party/tclap/include ../../third-party/glad) + include_directories(../../third-party/tclap/include ../../third-party/glad ../../examples) set_target_properties (rs-benchmark PROPERTIES FOLDER Tools ) diff --git a/tools/benchmark/rs-benchmark.cpp b/tools/benchmark/rs-benchmark.cpp index b00be5e4d6..db4a7d63ef 100644 --- a/tools/benchmark/rs-benchmark.cpp +++ b/tools/benchmark/rs-benchmark.cpp @@ -17,7 +17,7 @@ #include #include "tclap/CmdLine.h" -#include "../examples/example-utils.hpp" +#include "example-utils.hpp" using namespace std; using namespace chrono; @@ -208,9 +208,24 @@ class gl_blocks : public suite int main(int argc, char** argv) try { std::string serial; - if (!device_with_streams({ RS2_STREAM_COLOR,RS2_STREAM_DEPTH }, serial)) + enum second_stream { + rgb_stream, + ir_stream + }; + second_stream second_stream; + if (!device_with_streams({ RS2_STREAM_DEPTH }, serial)) return EXIT_SUCCESS; + if (device_with_streams({ RS2_STREAM_COLOR }, serial)) + second_stream = rgb_stream; + else if (device_with_streams({ RS2_STREAM_INFRARED }, serial)) + second_stream = ir_stream; + else + { + std::cout<< " Connect a device that supports either RGB stream or Infrared stream." <