Skip to content

Commit

Permalink
Fixes for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
aangerma committed Jan 29, 2020
1 parent 30e0e51 commit cc59ae7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/l500/l500-controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ namespace librealsense
return val;
}

l500_controls::l500_controls(std::shared_ptr<context> ctx, const platform::backend_device_group & group) :l500_device(ctx, group)
l500_controls::l500_controls(std::shared_ptr<context> ctx, const platform::backend_device_group & group) :
device(ctx, group),
l500_device(ctx, group)
{
auto& raw_depth_sensor = get_raw_depth_sensor();
auto& depth_sensor = get_depth_sensor();
Expand Down Expand Up @@ -139,13 +141,11 @@ namespace librealsense
break;
case low_ambient:
_sensitivity->set_with_no_signal(sensetivity_short);
auto range = _hw_options[RS2_OPTION_LASER_POWER]->get_range();
_hw_options[RS2_OPTION_LASER_POWER]->set_with_no_signal(range.max);
set_max_laser();
break;
case max_range:
_sensitivity->set_with_no_signal(sensetivity_long);
range = _hw_options[RS2_OPTION_LASER_POWER]->get_range();
_hw_options[RS2_OPTION_LASER_POWER]->set_with_no_signal(range.max);
set_max_laser();
break;
case short_range:
_sensitivity->set_with_no_signal(sensetivity_short);
Expand All @@ -172,4 +172,10 @@ namespace librealsense
for (auto o : _hw_options)
o.second->set_with_no_signal(-1);
}

void l500_controls::set_max_laser()
{
auto range = _hw_options[RS2_OPTION_LASER_POWER]->get_range();
_hw_options[RS2_OPTION_LASER_POWER]->set_with_no_signal(range.max);
}
}
1 change: 1 addition & 0 deletions src/l500/l500-controls.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ namespace librealsense
void change_preset(preset_values preset);
void move_to_custom ();
void reset_hw_controls();
void set_max_laser();

std::map<rs2_option, std::shared_ptr<signaled_option<l500_hw_controls>>> _hw_options;
std::shared_ptr< signaled_option<uvc_xu_option<int>>> _sensitivity;
Expand Down
2 changes: 1 addition & 1 deletion src/l500/l500-factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace librealsense

// l515
class rs515_device : public l500_depth,
public virtual l500_controls,
public l500_controls,
public l500_color,
public l500_motion,
public l500_serializable_base
Expand Down

0 comments on commit cc59ae7

Please sign in to comment.