Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set depth invalidation enabled by CMake flag #6288

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMake/lrs_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ option(FORCE_RSUSB_BACKEND "Use RS USB backend, mandatory for Win7/MacOS/Android
option(BUILD_NETWORK_DEVICE "Build Network Device support" OFF)
option(FORCE_LIBUVC "Explicitly turn-on libuvc backend - deprecated, use FORCE_RSUSB_BACKEND instead" OFF)
option(FORCE_WINUSB_UVC "Explicitly turn-on winusb_uvc (for win7) backend - deprecated, use FORCE_RSUSB_BACKEND instead" OFF)
option(ANDROID_USB_HOST_UVC "Build UVC backend for Android - deprecated, use FORCE_RSUSB_BACKEND instead" OFF)
option(ANDROID_USB_HOST_UVC "Build UVC backend for Android - deprecated, use FORCE_RSUSB_BACKEND instead" OFF)
option(ENABLE_L500_DEPTH_INVALIDATION "Turn on the depth frame validator to automatically catch corrupted frames and restart the sensor" ON)
4 changes: 4 additions & 0 deletions src/l500/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ target_sources(${LRS_TARGET}
"${CMAKE_CURRENT_LIST_DIR}/l500-serializable.h"
"${CMAKE_CURRENT_LIST_DIR}/l500-options.h"
)

if (ENABLE_L500_DEPTH_INVALIDATION)
add_definitions(-DENABLE_L500_DEPTH_INVALIDATION)
endif()
11 changes: 9 additions & 2 deletions src/l500/l500-depth.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ namespace librealsense
{
public:
explicit l500_depth_sensor(l500_device* owner, std::shared_ptr<uvc_sensor> uvc_sensor, std::map<uint32_t,rs2_format> l500_depth_fourcc_to_rs2_format_map, std::map<uint32_t, rs2_stream> l500_depth_fourcc_to_rs2_stream_map)
: synthetic_sensor("L500 Depth Sensor", uvc_sensor, owner, l500_depth_fourcc_to_rs2_format_map, l500_depth_fourcc_to_rs2_stream_map), _owner(owner), _depth_invalidation_enabled(false)
: synthetic_sensor("L500 Depth Sensor", uvc_sensor, owner, l500_depth_fourcc_to_rs2_format_map, l500_depth_fourcc_to_rs2_stream_map), _owner(owner)
{
#ifdef ENABLE_L500_DEPTH_INVALIDATION
_depth_invalidation_enabled = true;
#else
_depth_invalidation_enabled = false;
#endif

register_option(RS2_OPTION_DEPTH_UNITS, std::make_shared<const_value_option>("Number of meters represented by a single depth unit",
lazy<float>([&]() {
return read_znorm(); })));
Expand All @@ -111,7 +117,8 @@ namespace librealsense
<< "Unsupported depth invalidation enabled " << val << " is out of range.");
});

register_option(static_cast<rs2_option>(RS2_OPTION_DEPTH_INVALIDATION_ENABLE), _depth_invalidation_option);
// The depth invalidation enable option is deprecated for now.
//register_option(static_cast<rs2_option>(RS2_OPTION_DEPTH_INVALIDATION_ENABLE), _depth_invalidation_option);
}

std::vector<rs2_option> get_supported_options() const override
Expand Down