From 0d1bab8483fafcfdc2322e3ce39e8c5279d90b0e Mon Sep 17 00:00:00 2001 From: Eran Date: Wed, 5 Feb 2020 07:33:13 +0200 Subject: [PATCH] CR fixes --- include/librealsense2/h/rs_option.h | 2 +- src/l500/l500-device.cpp | 2 +- src/l500/l500-private.cpp | 2 +- src/l500/l500-private.h | 2 +- src/types.cpp | 2 +- .../main/java/com/intel/realsense/librealsense/Option.java | 4 +++- wrappers/nodejs/src/addon.cpp | 2 +- wrappers/python/pybackend.cpp | 2 +- .../RealSense/Source/RealSense/Public/RealSenseTypes.h | 2 +- 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/librealsense2/h/rs_option.h b/include/librealsense2/h/rs_option.h index 73d735bcd1..8022a09ba2 100644 --- a/include/librealsense2/h/rs_option.h +++ b/include/librealsense2/h/rs_option.h @@ -84,7 +84,7 @@ extern "C" { RS2_OPTION_LED_POWER, /**< Power of the LED (light emitting diode), with 0 meaning LED off*/ RS2_OPTION_ZERO_ORDER_ENABLED, /**< Toggle Zero-Order mode */ RS2_OPTION_ENABLE_MAP_PRESERVATION, /**< Preserve previous map when starting */ - RS2_OPTION_FREEFALL_ENABLED, /**< Enable/disable sensor shutdown when a free-fall is detected (off by default) */ + RS2_OPTION_FREEFALL_DETECTION_ENABLED, /**< Enable/disable sensor shutdown when a free-fall is detected (on by default) */ RS2_OPTION_COUNT /**< Number of enumeration values. Not a valid input: intended to be used in for-loops. */ } rs2_option; diff --git a/src/l500/l500-device.cpp b/src/l500/l500-device.cpp index 0ca7563b3a..3f43c1a529 100644 --- a/src/l500/l500-device.cpp +++ b/src/l500/l500-device.cpp @@ -122,7 +122,7 @@ namespace librealsense if( _fw_version >= firmware_version( "1.3.5.0" ) ) { depth_sensor.register_option( - RS2_OPTION_FREEFALL_ENABLED, + RS2_OPTION_FREEFALL_DETECTION_ENABLED, std::make_shared< freefall_option >( *_hw_monitor ) ); } diff --git a/src/l500/l500-private.cpp b/src/l500/l500-private.cpp index 03071c96b9..0bcabc359d 100644 --- a/src/l500/l500-private.cpp +++ b/src/l500/l500-private.cpp @@ -159,7 +159,7 @@ namespace librealsense { bool_option::set( value ); - command cmd{ FALL_DETECT_ENABLE, value != 0.f }; + command cmd{ FALL_DETECT_ENABLE, is_true() }; auto res = _hwm.send( cmd ); _record_action( *this ); } diff --git a/src/l500/l500-private.h b/src/l500/l500-private.h index aea36a43da..2c2a53f35c 100644 --- a/src/l500/l500-private.h +++ b/src/l500/l500-private.h @@ -319,7 +319,7 @@ namespace librealsense rs2_timestamp_domain get_frame_timestamp_domain(const std::shared_ptr& frame) const override; }; - /* For RS2_OPTION_FREEFALL_ENABLED */ + /* For RS2_OPTION_FREEFALL_DETECTION_ENABLED */ class freefall_option : public bool_option { public: diff --git a/src/types.cpp b/src/types.cpp index ecbbf0d13d..1f612dbed9 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -258,7 +258,6 @@ namespace librealsense CASE(ERROR_POLLING_ENABLED) CASE(PROJECTOR_TEMPERATURE) CASE(OUTPUT_TRIGGER_ENABLED) - CASE(FREEFALL_ENABLED) CASE(MOTION_MODULE_TEMPERATURE) CASE(DEPTH_UNITS) CASE(ENABLE_MOTION_CORRECTION) @@ -295,6 +294,7 @@ namespace librealsense CASE(LED_POWER) CASE(ZERO_ORDER_ENABLED) CASE(ENABLE_MAP_PRESERVATION) + CASE(FREEFALL_DETECTION_ENABLED) default: assert(!is_valid(value)); return UNKNOWN_VALUE; } #undef CASE diff --git a/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/Option.java b/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/Option.java index 0b1eb0edc0..0aea6d1396 100644 --- a/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/Option.java +++ b/wrappers/android/librealsense/src/main/java/com/intel/realsense/librealsense/Option.java @@ -62,7 +62,9 @@ public enum Option { ENABLE_DYNAMIC_CALIBRATION(58), DEPTH_OFFSET(59), LED_POWER(60), - FREEFALL_ENABLED(63); + ZERO_ORDER_ENABLED(61), + ENABLE_MAP_PRESERVATION(62), + FREEFALL_DETECTION_ENABLED(63); private final int mValue; diff --git a/wrappers/nodejs/src/addon.cpp b/wrappers/nodejs/src/addon.cpp index e7f146fc1d..09509bba92 100644 --- a/wrappers/nodejs/src/addon.cpp +++ b/wrappers/nodejs/src/addon.cpp @@ -4689,7 +4689,7 @@ void InitModule(v8::Local exports) { _FORCE_SET_ENUM(RS2_OPTION_LED_POWER); _FORCE_SET_ENUM(RS2_OPTION_ZERO_ORDER_ENABLED); _FORCE_SET_ENUM(RS2_OPTION_ENABLE_MAP_PRESERVATION); - _FORCE_SET_ENUM(RS2_OPTION_FREEFALL_ENABLED); + _FORCE_SET_ENUM(RS2_OPTION_FREEFALL_DETECTION_ENABLED); _FORCE_SET_ENUM(RS2_OPTION_COUNT); // rs2_camera_info diff --git a/wrappers/python/pybackend.cpp b/wrappers/python/pybackend.cpp index 135b324c69..aa0e88d65e 100644 --- a/wrappers/python/pybackend.cpp +++ b/wrappers/python/pybackend.cpp @@ -162,7 +162,7 @@ PYBIND11_MODULE(NAME, m) { .value("enable_led_power", RS2_OPTION_LED_POWER) .value("zero_order_enabled", RS2_OPTION_ZERO_ORDER_ENABLED) .value("enable_map_preservation", RS2_OPTION_ENABLE_MAP_PRESERVATION) - .value("enable_freefall", RS2_OPTION_FREEFALL_ENABLED) + .value("enable_freefall_detection", RS2_OPTION_FREEFALL_DETECTION_ENABLED) .value("count", RS2_OPTION_COUNT); py::enum_ power_state(m, "power_state"); diff --git a/wrappers/unrealengine4/Plugins/RealSense/Source/RealSense/Public/RealSenseTypes.h b/wrappers/unrealengine4/Plugins/RealSense/Source/RealSense/Public/RealSenseTypes.h index 5b58db5f7a..f3af363a07 100755 --- a/wrappers/unrealengine4/Plugins/RealSense/Source/RealSense/Public/RealSenseTypes.h +++ b/wrappers/unrealengine4/Plugins/RealSense/Source/RealSense/Public/RealSenseTypes.h @@ -116,7 +116,7 @@ enum class ERealSenseOptionType : uint8 LED_POWER , /**< Power of the LED (light emitting diode), with 0 meaning LED off */ ZERO_ORDER_ENABLED , /**< Zero-order mode */ ENABLE_MAP_PRESERVATION , /**< Preserve map from the previous run */ - FREEFALL_ENABLED , /**< Enable/disable sensor shutdown when a free-fall is detected (off by default) */ + FREEFALL_DETECTION_ENABLED , /**< Enable/disable sensor shutdown when a free-fall is detected (on by default) */ }; UENUM(Blueprintable)