Add Reflectivity option restrictions - #7706
Conversation
|
|
||
| void l500_options::on_set_option(rs2_option opt, float value) | ||
| { | ||
| verify_max_usable_range_restrictions(value); |
There was a problem hiding this comment.
opt may not be VISUAL_PRESET... but inside the verify fn you compare the value to MAX_RANGE...? Am I misunderstanding?
There was a problem hiding this comment.
You are correct, the logic was not good.
Changed.
|
|
||
| if (ds.supports_option(RS2_OPTION_ENABLE_IR_REFLECTIVITY) && ds.get_option(RS2_OPTION_ENABLE_IR_REFLECTIVITY).query() == 1.0f) | ||
| { | ||
| ds.get_option(RS2_OPTION_ENABLE_IR_REFLECTIVITY).set(0.0f); |
There was a problem hiding this comment.
Let's do this only after the other test passes
There was a problem hiding this comment.
We leave it as is as we discussed, we changed the throw to set MUR off
| (ds.get_option(RS2_OPTION_ENABLE_MAX_USABLE_RANGE).query() == 1.0) && | ||
| (value != rs2_sensor_mode::RS2_SENSOR_MODE_VGA)) | ||
| { | ||
| throw wrong_api_call_sequence_exception("Max Usable Range support VGA resolution only"); |
There was a problem hiding this comment.
I think we should turn it off, not throw
| { | ||
| int sensor_mode = static_cast<int>(s->get_option(RS2_OPTION_SENSOR_MODE)); | ||
| int width = 0, height = 0; | ||
| width_height_from_resolution(static_cast<rs2_sensor_mode>(sensor_mode), width, height); |
There was a problem hiding this comment.
Add function resolution_id_from_sensor_mode
| } | ||
| } | ||
|
|
||
| static int get_resolution_id_from_sensor_mode(int sensor_mode, const rs2::sensor &s, const std::vector<std::pair<int, int>> &res_values) |
There was a problem hiding this comment.
Why not pass in rs2_sensor_mode?
| { | ||
| int width = 0, height = 0; | ||
| width_height_from_resolution(static_cast<rs2_sensor_mode>(sensor_mode), width, height); | ||
| auto iter = std::find_if(res_values.begin(), |
| if( ds.supports_option( RS2_OPTION_ENABLE_IR_REFLECTIVITY ) | ||
| && ds.get_option( RS2_OPTION_ENABLE_IR_REFLECTIVITY ).query() == 1.0f ) | ||
| throw librealsense::wrong_api_call_sequence_exception( | ||
| "Enabling Alternate IR while IR Reflectivity is enabled is prohibited" ); |
There was a problem hiding this comment.
Alternate IR cannot be enabled with IR Reflectivity
Implement IR Reflectivity option restrictions according to [RS5-8358]
Note: