From 6f9de94878d4a2a40502f6479641ccef8c20e93e Mon Sep 17 00:00:00 2001 From: NirAz Date: Sun, 4 Oct 2020 10:57:40 +0300 Subject: [PATCH] Add L515 humidity temperature option --- include/librealsense2/h/rs_option.h | 3 ++- src/l500/l500-depth.cpp | 3 +++ src/l500/l500-private.cpp | 2 ++ src/types.cpp | 1 + .../java/com/intel/realsense/librealsense/Option.java | 3 ++- wrappers/matlab/option.m | 10 +++++++++- wrappers/nodejs/index.js | 10 ++++++++++ wrappers/nodejs/src/addon.cpp | 6 ++++++ wrappers/python/pybackend.cpp | 2 ++ .../RealSense/Source/RealSense/Public/RealSenseTypes.h | 6 ++++++ 10 files changed, 43 insertions(+), 3 deletions(-) diff --git a/include/librealsense2/h/rs_option.h b/include/librealsense2/h/rs_option.h index fb6638f4c7..11f87d5aa3 100644 --- a/include/librealsense2/h/rs_option.h +++ b/include/librealsense2/h/rs_option.h @@ -98,9 +98,10 @@ extern "C" { RS2_OPTION_RESET_CAMERA_ACCURACY_HEALTH, RS2_OPTION_HOST_PERFORMANCE, /**< Set host performance mode to optimize device settings so host can keep up with workload, for example, USB transaction granularity, setting option to low performance host leads to larger USB transaction size and reduced number of transactions which improves performance and stability if host is relatively weak as compared to workload */ RS2_OPTION_HDR_ENABLED, /**< Enable / disable HDR */ - RS2_OPTION_SEQUENCE_NAME, /**< HDR Sequence size */ + RS2_OPTION_SEQUENCE_NAME, /**< HDR Sequence name */ RS2_OPTION_SEQUENCE_SIZE, /**< HDR Sequence size */ RS2_OPTION_SEQUENCE_ID, /**< HDR Sequence ID - 0 is not HDR; sequence ID for HDR configuartion starts from 1 */ + RS2_OPTION_HUMIDITY_TEMPERATURE, /**< Humidity temperature [Deg Celsius]*/ 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-depth.cpp b/src/l500/l500-depth.cpp index 2a4b5af912..d883ca2793 100644 --- a/src/l500/l500-depth.cpp +++ b/src/l500/l500-depth.cpp @@ -88,6 +88,9 @@ namespace librealsense depth_sensor.register_option(RS2_OPTION_APD_TEMPERATURE, std::make_shared (_hw_monitor.get(), RS2_OPTION_APD_TEMPERATURE)); + depth_sensor.register_option(RS2_OPTION_HUMIDITY_TEMPERATURE, + std::make_shared (_hw_monitor.get(), RS2_OPTION_HUMIDITY_TEMPERATURE)); + environment::get_instance().get_extrinsics_graph().register_same_extrinsics(*_depth_stream, *_ir_stream); environment::get_instance().get_extrinsics_graph().register_same_extrinsics(*_depth_stream, *_confidence_stream); diff --git a/src/l500/l500-private.cpp b/src/l500/l500-private.cpp index e91d4395b8..c56a352045 100644 --- a/src/l500/l500-private.cpp +++ b/src/l500/l500-private.cpp @@ -95,6 +95,8 @@ namespace librealsense return float(temperature_data.MA_temperature); case RS2_OPTION_APD_TEMPERATURE: return float(temperature_data.APD_temperature); + case RS2_OPTION_HUMIDITY_TEMPERATURE: + return float(temperature_data.HUM_temperature); default: throw invalid_value_exception(to_string() << _option << " is not temperature option!"); } diff --git a/src/types.cpp b/src/types.cpp index b48c7a5391..57515593bd 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -431,6 +431,7 @@ namespace librealsense CASE(SEQUENCE_NAME) CASE(SEQUENCE_SIZE) CASE(SEQUENCE_ID) + CASE(HUMIDITY_TEMPERATURE) 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 25bd6595f6..888cfbb796 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 @@ -80,7 +80,8 @@ public enum Option { HDR_ENABLED(76), SEQUENCE_NAME(77), SEQUENCE_SIZE(78), - SEQUENCE_ID(79); + SEQUENCE_ID(79), + HUMIDITY_TEMPERATURE(80); private final int mValue; private Option(int value) { mValue = value; } diff --git a/wrappers/matlab/option.m b/wrappers/matlab/option.m index d707796007..864d81c778 100644 --- a/wrappers/matlab/option.m +++ b/wrappers/matlab/option.m @@ -73,6 +73,14 @@ sensor_mode (70) emitter_always_on (71) thermal_compensation (72) - count (73) + trigger_camera_accuracy_health (73) + reset_camera_accuracy_health (74) + host_performance (75) + hdr_enabled (76) + sequence_name (77) + sequence_size (78) + sequence_id (79) + humidity_temperature (80) + count (81) end end diff --git a/wrappers/nodejs/index.js b/wrappers/nodejs/index.js index 147867cd25..cccedd1375 100644 --- a/wrappers/nodejs/index.js +++ b/wrappers/nodejs/index.js @@ -4933,6 +4933,14 @@ const option = { */ OPTION_EMITTER_ALWAYS_ON: RS2.RS2_OPTION_EMITTER_ALWAYS_ON, OPTION_THERMAL_COMPENSATION: RS2.RS2_OPTION_THERMAL_COMPENSATION, + OPTION_TRIGGER_CAMERA_ACCURACY_HEALTH: RS2.RS2_OPTION_TRIGGER_CAMERA_ACCURACY_HEALTH, + OPTION_RESET_CAMERA_ACCURACY_HEALTH: RS2.RS2_OPTION_RESET_CAMERA_ACCURACY_HEALTH, + OPTION_HOST_PERFORMANCE: RS2.RS2_OPTION_HOST_PERFORMANCE, + OPTION_HDR_ENABLED: RS2.RS2_OPTION_HDR_ENABLED, + OPTION_SEQUENCE_NAME: RS2.RS2_OPTION_SEQUENCE_NAME, + OPTION_SEQUENCE_SIZE: RS2.RS2_OPTION_SEQUENCE_SIZE, + OPTION_SEQUENCE_ID: RS2.RS2_OPTION_SEQUENCE_ID, + OPTION_HUMIDITY_TEMPERATURE: RS2.RS2_OPTION_HUMIDITY_TEMPERATURE, /** * Number of enumeration values. Not a valid input: intended to be used in for-loops. * @type {Integer} @@ -5081,6 +5089,8 @@ const option = { return this.option_emitter_always_on; case this.OPTION_THERMAL_COMPENSATION: return this.option_thermal_compensation; + case this.OPTION_HUMIDITY_TEMPERATURE: + return this.option_humidity_temperature; default: throw new TypeError( 'option.optionToString(option) expects a valid value as the 1st argument'); diff --git a/wrappers/nodejs/src/addon.cpp b/wrappers/nodejs/src/addon.cpp index 2aa8b58090..018c68b0f8 100644 --- a/wrappers/nodejs/src/addon.cpp +++ b/wrappers/nodejs/src/addon.cpp @@ -4701,6 +4701,12 @@ void InitModule(v8::Local exports) { _FORCE_SET_ENUM(RS2_OPTION_THERMAL_COMPENSATION); _FORCE_SET_ENUM(RS2_OPTION_TRIGGER_CAMERA_ACCURACY_HEALTH); _FORCE_SET_ENUM(RS2_OPTION_RESET_CAMERA_ACCURACY_HEALTH); + _FORCE_SET_ENUM(RS2_OPTION_HOST_PERFORMANCE); + _FORCE_SET_ENUM(RS2_OPTION_HDR_ENABLED); + _FORCE_SET_ENUM(RS2_OPTION_SEQUENCE_NAME); + _FORCE_SET_ENUM(RS2_OPTION_SEQUENCE_SIZE); + _FORCE_SET_ENUM(RS2_OPTION_SEQUENCE_ID); + _FORCE_SET_ENUM(RS2_OPTION_HUMIDITY_TEMPERATURE); _FORCE_SET_ENUM(RS2_OPTION_COUNT); // rs2_camera_info diff --git a/wrappers/python/pybackend.cpp b/wrappers/python/pybackend.cpp index 07b55d9d0d..8dbbdb812a 100644 --- a/wrappers/python/pybackend.cpp +++ b/wrappers/python/pybackend.cpp @@ -174,10 +174,12 @@ PYBIND11_MODULE(NAME, m) { .value("thermal_compensation", RS2_OPTION_THERMAL_COMPENSATION) .value("trigger_camera_accuracy_health", RS2_OPTION_TRIGGER_CAMERA_ACCURACY_HEALTH) .value("reset_camera_accuracy_health", RS2_OPTION_RESET_CAMERA_ACCURACY_HEALTH) + .value("host_performance", RS2_OPTION_HOST_PERFORMANCE) .value("hdr_enabled", RS2_OPTION_HDR_ENABLED) .value("sequence_name", RS2_OPTION_SEQUENCE_NAME) .value("sequence_size", RS2_OPTION_SEQUENCE_SIZE) .value("sequence_id", RS2_OPTION_SEQUENCE_ID) + .value("humidity_temperature", RS2_OPTION_HUMIDITY_TEMPERATURE) .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 9236fb0e15..6514aa3b2b 100755 --- a/wrappers/unrealengine4/Plugins/RealSense/Source/RealSense/Public/RealSenseTypes.h +++ b/wrappers/unrealengine4/Plugins/RealSense/Source/RealSense/Public/RealSenseTypes.h @@ -128,6 +128,12 @@ enum class ERealSenseOptionType : uint8 THERMAL_COMPENSATION , /**< Depth Thermal Compensation for selected D400 SKUs */ TRIGGER_CAMERA_ACCURACY_HEALTH , RESET_CAMERA_ACCURACY_HEALTH , + HOST_PERFORMANCE , /**< Set host performance mode to optimize device settings so host can keep up with workload, for example, USB transaction granularity, setting option to low performance host leads to larger USB transaction size and reduced number of transactions which improves performance and stability if host is relatively weak as compared to workload */ + HDR_ENABLED , /**< Enable / disable HDR */ + SEQUENCE_NAME , /**< HDR Sequence name */ + SEQUENCE_SIZE , /**< HDR Sequence size */ + SEQUENCE_ID , /**< HDR Sequence ID - 0 is not HDR; sequence ID for HDR configuartion starts from 1 */ + HUMIDITY_TEMPERATURE , /**< Humidity temperature*/ }; UENUM(Blueprintable)