Skip to content

Commit

Permalink
Disabling hdr while updating exposure & gain values
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-Prasad-V committed Nov 29, 2023
1 parent 218e327 commit 81c42c5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions realsense2_camera/src/ros_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ void RosSensor::UpdateSequenceIdCallback()
if (!supports(RS2_OPTION_SEQUENCE_ID))
return;

bool is_hdr_enabled = static_cast<bool>(get_option(RS2_OPTION_HDR_ENABLED));

// From FW version 5.14.x.x, if HDR is enabled, updating UVC controls like exposure, gain , etc are restricted.
// So, disable it before updating.
if (is_hdr_enabled)
{
set_option(RS2_OPTION_HDR_ENABLED, false);
}

int original_seq_id = static_cast<int>(get_option(RS2_OPTION_SEQUENCE_ID)); // To Set back to default.
std::string module_name = create_graph_resource_name(rs2_to_ros(get_info(RS2_CAMERA_INFO_NAME)));

Expand Down Expand Up @@ -147,6 +156,11 @@ void RosSensor::UpdateSequenceIdCallback()
return;
}

if (is_hdr_enabled)
{
set_option(RS2_OPTION_HDR_ENABLED, true);
}

}

void RosSensor::set_sensor_parameter_to_ros(rs2_option option)
Expand Down

0 comments on commit 81c42c5

Please sign in to comment.