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 22, 2023
1 parent 218e327 commit 44a0d93
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions realsense2_camera/src/ros_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ void RosSensor::UpdateSequenceIdCallback()
if (!supports(RS2_OPTION_SEQUENCE_ID))
return;

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

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 +154,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 44a0d93

Please sign in to comment.