From 8115d6092c54e73f3bb854fc30a29162aa3dd2be Mon Sep 17 00:00:00 2001 From: Nir Azkiel Date: Wed, 19 Apr 2023 08:44:27 +0300 Subject: [PATCH] PR #11699 from Nir-Az: Allow change AE type while not streaming (even if AE is on) (cherry picked from commit e9a3095f2b31471e30d4f73fd0c12a979e657616) --- src/ds/d400/d400-device.cpp | 7 +------ unit-tests/live/d400/test-depth_ae_mode.py | 6 ++++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ds/d400/d400-device.cpp b/src/ds/d400/d400-device.cpp index fdc43d5983..6fbfeae585 100644 --- a/src/ds/d400/d400-device.cpp +++ b/src/ds/d400/d400-device.cpp @@ -810,13 +810,8 @@ namespace librealsense { (float)RS2_DEPTH_AUTO_EXPOSURE_REGULAR, "Regular" }, { (float)RS2_DEPTH_AUTO_EXPOSURE_ACCELERATED, "Accelerated" } } , false); - std::vector< std::pair< std::shared_ptr< option >, std::string > > options_and_reasons - = { std::make_pair( enable_auto_exposure, - "Depth auto exposure mode cannot be set when auto exposure is enabled" ) }; - depth_sensor.register_option( - RS2_OPTION_DEPTH_AUTO_EXPOSURE_MODE, - std::make_shared< gated_option >( depth_auto_exposure_mode, options_and_reasons ) ); + RS2_OPTION_DEPTH_AUTO_EXPOSURE_MODE, depth_auto_exposure_mode ); } //EXPOSURE diff --git a/unit-tests/live/d400/test-depth_ae_mode.py b/unit-tests/live/d400/test-depth_ae_mode.py index 72192f57b6..4e88434e9c 100644 --- a/unit-tests/live/d400/test-depth_ae_mode.py +++ b/unit-tests/live/d400/test-depth_ae_mode.py @@ -12,7 +12,7 @@ depth_sensor = device.first_depth_sensor() fw_version = rsutils.version( device.get_info( rs.camera_info.firmware_version )) -if fw_version <= rsutils.version(5,15,0,0): +if fw_version < rsutils.version(5,15,0,0): log.i(f"FW version {fw_version} does not support DEPTH_AUTO_EXPOSURE_MODE option, skipping test...") test.print_results_and_exit() @@ -26,10 +26,12 @@ ################################################################################################ -test.start("Verify cannot set when auto exposure on") +test.start("Verify can set when auto exposure on") depth_sensor.set_option(rs.option.enable_auto_exposure, True) test.check_equal(depth_sensor.get_option(rs.option.enable_auto_exposure), True) depth_sensor.set_option(rs.option.auto_exposure_mode, ACCELERATED) +test.check_equal(depth_sensor.get_option(rs.option.auto_exposure_mode), ACCELERATED) +depth_sensor.set_option(rs.option.auto_exposure_mode, REGULAR) test.check_equal(depth_sensor.get_option(rs.option.auto_exposure_mode), REGULAR) test.finish()