Skip to content

Commit

Permalink
PR #2946 from gwen2018: fix ros random crash with error hw monitor co…
Browse files Browse the repository at this point in the history
…mmand for asic temperature failed
  • Loading branch information
Nir-Az authored Dec 15, 2023
2 parents 4679aa4 + 573d6a7 commit 91c0f35
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions realsense2_camera/src/base_realsense_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,10 +1140,18 @@ void BaseRealSenseNode::startDiagnosticsUpdater()
{
for (rs2_option option : _monitor_options)
{
if (sensor->supports(option))
try
{
status.add(rs2_option_to_string(option), sensor->get_option(option));
got_temperature = true;
if (sensor->supports(option))
{
status.add(rs2_option_to_string(option), sensor->get_option(option));
got_temperature = true;
}
}
catch(const std::exception& ex)
{
got_temperature = false;
ROS_WARN_STREAM("An error has occurred during monitoring: " << ex.what());
}
}
if (got_temperature) break;
Expand Down

0 comments on commit 91c0f35

Please sign in to comment.