Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L515 - Add digital gain option that replace ambient light option #7563

Merged
merged 7 commits into from Oct 19, 2020

Conversation

Nir-Az
Copy link
Collaborator

@Nir-Az Nir-Az commented Oct 13, 2020

Original Requirement : "Rename ambient light option to digital gain"

  • Add digital gain option at same option value as ambient light

  • Add comment on LRS API option ambient light that it is deprecates

  • Replace ambient light option registration with digital gain option (same value for both) from L515 depth sensor

  • Add it to all wrappers

  • Add special case for python wrapper for dealing with 2 options with the same value

  • no ambient == high gain

Tested on:

  • RealSense Viewer
  • Python wrapper
  • C# wrapper

Tracked on [RS5-9152]

src/l500/ac-trigger.cpp Outdated Show resolved Hide resolved
src/l500/ac-trigger.cpp Outdated Show resolved Hide resolved
{ float(RS2_AMBIENT_LIGHT_LOW_AMBIENT), "Low Ambient" }}));
(RS2_OPTION_VISUAL_PRESET, std::make_shared<uvc_xu_option<int >>(raw_depth_sensor, ivcam2::depth_xu, ivcam2::L500_DIGITAL_GAIN,
"Change the depth digital gain to: 1 for high gain and 2 for low gain",
std::map<float, std::string>{ { float(RS2_DIGITAL_GAIN_HIGH_GAIN), "High Gain"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting... it doesn't take the string representation from the get_string() functions?

Copy link
Collaborator Author

@Nir-Az Nir-Az Oct 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was implemented this way with ambient light so I kept it.
If I remove the map the viewer will display it as a slider (we don't want it), the strings map makes the viewer display it as a combo box.

{ RS2_AMBIENT_LIGHT_LOW_AMBIENT, "Low Ambient" }});
_digital_gain = register_option<uvc_xu_option<int>, uvc_sensor&, platform::extension_unit, uint8_t, std::string, const std::map<float, std::string>& >
(RS2_OPTION_DIGITAL_GAIN, raw_depth_sensor, ivcam2::depth_xu, ivcam2::L500_DIGITAL_GAIN,
"Change the depth digital gain to values: 1 for high gain and 2 for low gain",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to values: -> to:

src/rs.cpp Outdated
@@ -1271,6 +1271,7 @@ const char* rs2_cah_trigger_to_string( rs2_cah_trigger mode )
const char* rs2_calibration_type_to_string(rs2_calibration_type type) { return get_string(type); }
const char* rs2_calibration_status_to_string(rs2_calibration_status status) { return get_string(status); }
const char* rs2_host_perf_mode_to_string(rs2_host_perf_mode mode) { return get_string(mode); }
const char* rs2_digital_gain_to_string(rs2_digital_gain gain) { return get_string(gain); }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to right after the rs2_ambient_light?

src/types.h Outdated
@@ -558,6 +558,7 @@ namespace librealsense
RS2_ENUM_HELPERS_CUSTOMIZED(rs2_ambient_light, RS2_AMBIENT_LIGHT_NO_AMBIENT, RS2_AMBIENT_LIGHT_LOW_AMBIENT)
RS2_ENUM_HELPERS(rs2_cah_trigger, CAH_TRIGGER)
RS2_ENUM_HELPERS(rs2_host_perf_mode, HOST_PERF)
RS2_ENUM_HELPERS_CUSTOMIZED(rs2_digital_gain, RS2_DIGITAL_GAIN_HIGH_GAIN, RS2_DIGITAL_GAIN_LOW_GAIN)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move right after rs2_ambient_light

@maloel maloel merged commit b5d6f7f into IntelRealSense:development Oct 19, 2020
@Nir-Az Nir-Az deleted the add_digital_gain_option_2 branch December 23, 2020 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants