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

Disabling HDR during INIT #2948

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion realsense2_camera/src/dynamic_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,14 @@ namespace realsense2_camera
};
if (result_value != initial_value && func)
{
func(rclcpp::Parameter(param_name, result_value));
try
{
func(rclcpp::Parameter(param_name, result_value));
}
catch(const std::exception& e)
{
ROS_WARN_STREAM("Set parameter {" << param_name << "} failed: " << e.what());
}
}
return result_value;
}
Expand Down
8 changes: 8 additions & 0 deletions realsense2_camera/src/ros_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ RosSensor::~RosSensor()
void RosSensor::setParameters(bool is_rosbag_file)
{
std::string module_name = create_graph_resource_name(rs2_to_ros(get_info(RS2_CAMERA_INFO_NAME)));

// From FW version 5.14.x.x, if HDR is enabled, updating UVC controls like exposure, gain , etc are restricted.
// So, during init of the node, forcefully disabling the HDR upfront and update it with new values.
if((!is_rosbag_file) && supports(RS2_OPTION_HDR_ENABLED))
{
set_option(RS2_OPTION_HDR_ENABLED, false);
}

_params.registerDynamicOptions(*this, module_name);

// for rosbag files, don't set hdr(sequence_id) / gain / exposure options
Expand Down
Loading