Skip to content

Commit

Permalink
PR #2948 from Arun-Prasad-V: Disabling HDR during INIT
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Dec 18, 2023
2 parents 734f92a + 4610843 commit 7bf5176
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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

0 comments on commit 7bf5176

Please sign in to comment.