diff --git a/src/l500/l500-depth.cpp b/src/l500/l500-depth.cpp index 2a4b5af912..29d159b970 100644 --- a/src/l500/l500-depth.cpp +++ b/src/l500/l500-depth.cpp @@ -76,17 +76,29 @@ namespace librealsense auto& depth_sensor = get_depth_sensor(); auto& raw_depth_sensor = get_raw_depth_sensor(); - depth_sensor.register_option(RS2_OPTION_LLD_TEMPERATURE, - std::make_shared (_hw_monitor.get(), RS2_OPTION_LLD_TEMPERATURE)); - - depth_sensor.register_option(RS2_OPTION_MC_TEMPERATURE, - std::make_shared (_hw_monitor.get(), RS2_OPTION_MC_TEMPERATURE)); - - depth_sensor.register_option(RS2_OPTION_MA_TEMPERATURE, - std::make_shared (_hw_monitor.get(), RS2_OPTION_MA_TEMPERATURE)); - - depth_sensor.register_option(RS2_OPTION_APD_TEMPERATURE, - std::make_shared (_hw_monitor.get(), RS2_OPTION_APD_TEMPERATURE)); + depth_sensor.register_option( + RS2_OPTION_LLD_TEMPERATURE, + std::make_shared< l500_temperature_options >( _hw_monitor.get(), + RS2_OPTION_LLD_TEMPERATURE, + "Laser Driver temperature" ) ); + + depth_sensor.register_option( + RS2_OPTION_MC_TEMPERATURE, + std::make_shared< l500_temperature_options >( _hw_monitor.get(), + RS2_OPTION_MC_TEMPERATURE, + "Mems Controller temperature" ) ); + + depth_sensor.register_option( + RS2_OPTION_MA_TEMPERATURE, + std::make_shared< l500_temperature_options >( _hw_monitor.get(), + RS2_OPTION_MA_TEMPERATURE, + "DSP controller temperature" ) ); + + depth_sensor.register_option( + RS2_OPTION_APD_TEMPERATURE, + std::make_shared< l500_temperature_options >( _hw_monitor.get(), + RS2_OPTION_APD_TEMPERATURE, + "Avalanche Photo Diode 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-options.cpp b/src/l500/l500-options.cpp index f6698b60a3..bdc56f0512 100644 --- a/src/l500/l500-options.cpp +++ b/src/l500/l500-options.cpp @@ -26,10 +26,13 @@ namespace librealsense return _range; } - l500_hw_options::l500_hw_options(hw_monitor* hw_monitor, l500_control type, option* resolution) + l500_hw_options::l500_hw_options( hw_monitor * hw_monitor, + l500_control type, + option * resolution, + const std::string & description ) :_hw_monitor(hw_monitor), - _type(type), - _resolution(resolution) + _type(type), _resolution( resolution ) + , _description( description ) { auto min = _hw_monitor->send(command{ AMCGET, _type, get_min }); auto max = _hw_monitor->send(command{ AMCGET, _type, get_max }); @@ -97,14 +100,93 @@ namespace librealsense depth_sensor.register_option(RS2_OPTION_SENSOR_MODE, resolution_option); - _hw_options[RS2_OPTION_POST_PROCESSING_SHARPENING] = register_option(RS2_OPTION_POST_PROCESSING_SHARPENING, _hw_monitor.get(), post_processing_sharpness, resolution_option.get()); - _hw_options[RS2_OPTION_PRE_PROCESSING_SHARPENING] = register_option(RS2_OPTION_PRE_PROCESSING_SHARPENING, _hw_monitor.get(), pre_processing_sharpness, resolution_option.get()); - _hw_options[RS2_OPTION_NOISE_FILTERING] = register_option(RS2_OPTION_NOISE_FILTERING, _hw_monitor.get(), noise_filtering, resolution_option.get()); - _hw_options[RS2_OPTION_AVALANCHE_PHOTO_DIODE] = register_option(RS2_OPTION_AVALANCHE_PHOTO_DIODE, _hw_monitor.get(), apd, resolution_option.get()); - _hw_options[RS2_OPTION_CONFIDENCE_THRESHOLD] = register_option(RS2_OPTION_CONFIDENCE_THRESHOLD, _hw_monitor.get(), confidence, resolution_option.get()); - _hw_options[RS2_OPTION_LASER_POWER] = register_option(RS2_OPTION_LASER_POWER, _hw_monitor.get(), laser_gain, resolution_option.get()); - _hw_options[RS2_OPTION_MIN_DISTANCE] = register_option(RS2_OPTION_MIN_DISTANCE, _hw_monitor.get(), min_distance, resolution_option.get()); - _hw_options[RS2_OPTION_INVALIDATION_BYPASS] = register_option(RS2_OPTION_INVALIDATION_BYPASS, _hw_monitor.get(), invalidation_bypass, resolution_option.get()); + _hw_options[RS2_OPTION_POST_PROCESSING_SHARPENING] = register_option< l500_hw_options, + hw_monitor *, + l500_control, + option *, + std::string >( + RS2_OPTION_POST_PROCESSING_SHARPENING, + _hw_monitor.get(), + post_processing_sharpness, + resolution_option.get(), + "Changes the amount of sharpening in the post-processed image" ); + + _hw_options[RS2_OPTION_PRE_PROCESSING_SHARPENING] = register_option< l500_hw_options, + hw_monitor *, + l500_control, + option *, + std::string >( + RS2_OPTION_PRE_PROCESSING_SHARPENING, + _hw_monitor.get(), + pre_processing_sharpness, + resolution_option.get(), + "Changes the amount of sharpening in the pre-processed image" ); + + _hw_options[RS2_OPTION_NOISE_FILTERING] + = register_option< l500_hw_options, + hw_monitor *, + l500_control, + option *, + std::string >( RS2_OPTION_NOISE_FILTERING, + _hw_monitor.get(), + noise_filtering, + resolution_option.get(), + "Control edges and background noise" ); + + _hw_options[RS2_OPTION_AVALANCHE_PHOTO_DIODE] = register_option< l500_hw_options, + hw_monitor *, + l500_control, + option *, + std::string >( + RS2_OPTION_AVALANCHE_PHOTO_DIODE, + _hw_monitor.get(), + apd, + resolution_option.get(), + "Changes the exposure time of Avalanche Photo Diode in the receiver" ); + + _hw_options[RS2_OPTION_CONFIDENCE_THRESHOLD] = register_option< l500_hw_options, + hw_monitor *, + l500_control, + option *, + std::string >( + RS2_OPTION_CONFIDENCE_THRESHOLD, + _hw_monitor.get(), + confidence, + resolution_option.get(), + "The confidence level threshold to use to mark a pixel as valid by the depth algorithm" ); + + _hw_options[RS2_OPTION_LASER_POWER] = register_option< l500_hw_options, + hw_monitor *, + l500_control, + option *, + std::string >( + RS2_OPTION_LASER_POWER, + _hw_monitor.get(), + laser_gain, + resolution_option.get(), + "Power of the laser emitter, with 0 meaning projector off" ); + + _hw_options[RS2_OPTION_MIN_DISTANCE] + = register_option< l500_hw_options, + hw_monitor *, + l500_control, + option *, + std::string >( RS2_OPTION_MIN_DISTANCE, + _hw_monitor.get(), + min_distance, + resolution_option.get(), + "Minimal distance to the target (in mm)" ); + + _hw_options[RS2_OPTION_INVALIDATION_BYPASS] + = register_option< l500_hw_options, + hw_monitor *, + l500_control, + option *, + std::string >( RS2_OPTION_INVALIDATION_BYPASS, + _hw_monitor.get(), + invalidation_bypass, + resolution_option.get(), + "Enable/disable pixel invalidation" ); _ambient_light = register_option, uvc_sensor&, platform::extension_unit, uint8_t, std::string, const std::map& > (RS2_OPTION_AMBIENT_LIGHT, raw_depth_sensor, ivcam2::depth_xu, ivcam2::L500_AMBIENT, diff --git a/src/l500/l500-options.h b/src/l500/l500-options.h index 74ff812d42..1466971643 100644 --- a/src/l500/l500-options.h +++ b/src/l500/l500-options.h @@ -38,12 +38,17 @@ namespace librealsense bool is_enabled() const override { return true; } - const char* get_description() const override { return ""; } - l500_hw_options(hw_monitor* hw_monitor, l500_control type, option* resolution); + const char * get_description() const override { return _description.c_str(); } void enable_recording(std::function recording_action) override; + l500_hw_options( hw_monitor * hw_monitor, + l500_control type, + option * resolution, + const std::string& description ); + + private: float query(int width) const; @@ -53,6 +58,7 @@ namespace librealsense uint32_t _width; uint32_t _height; option* _resolution; + std::string _description; }; class l500_options: public virtual l500_device diff --git a/src/l500/l500-private.cpp b/src/l500/l500-private.cpp index e91d4395b8..5d4421ee89 100644 --- a/src/l500/l500-private.cpp +++ b/src/l500/l500-private.cpp @@ -100,8 +100,12 @@ namespace librealsense } } - l500_temperature_options::l500_temperature_options(hw_monitor* hw_monitor, rs2_option opt) - :_hw_monitor(hw_monitor), _option(opt) + l500_temperature_options::l500_temperature_options( hw_monitor * hw_monitor, + rs2_option opt, + const std::string& description ) + : _hw_monitor( hw_monitor ) + , _option( opt ) + , _description( description ) { } diff --git a/src/l500/l500-private.h b/src/l500/l500-private.h index 269318276a..c1acab2db8 100644 --- a/src/l500/l500-private.h +++ b/src/l500/l500-private.h @@ -398,13 +398,16 @@ namespace librealsense bool is_enabled() const override { return true; } - const char* get_description() const override { return ""; } + const char * get_description() const override { return _description.c_str(); } - explicit l500_temperature_options(hw_monitor* hw_monitor, rs2_option opt); + explicit l500_temperature_options( hw_monitor * hw_monitor, + rs2_option opt, + const std::string& description ); private: rs2_option _option; hw_monitor* _hw_monitor; + std::string _description; }; class l500_timestamp_reader : public frame_timestamp_reader