Skip to content

Commit

Permalink
Added respawn delay to connector nodes (#1044)
Browse files Browse the repository at this point in the history
* Added respawn delay to connector nodes

* Changed errors in DVL, IMU, and Depth Sensor drivers to ROS_ERROR_THROTTLE
  • Loading branch information
Haengele authored Feb 28, 2024
1 parent c824a61 commit 824c481
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<!-- DVL -->
<group if="$(eval dvl and environment == 'real')">
<node pkg="subjugator_launch" type="dvl_conn" name="dvl_conn" respawn="true"/>
<node pkg="subjugator_launch" type="dvl_conn" name="dvl_conn" respawn="true" respawn_delay = "10"/>
<node pkg="nodelet" type="nodelet" name="dvl_driver" args="standalone rdi_explorer_dvl/nodelet">
<param name="port" type="string" value="/tmp/dvl"/>
<param name="frame_id" type="string" value="/dvl"/>
Expand All @@ -17,7 +17,7 @@

<!-- Depth Sensor -->
<group if="$(eval depth and environment == 'real')">
<node pkg="subjugator_launch" type="depth_conn" name="depth_conn" respawn="true"/>
<node pkg="subjugator_launch" type="depth_conn" name="depth_conn" respawn="true" respawn_delay = "10"/>
<node pkg="nodelet" type="nodelet" name="depth_driver" args="standalone depth_driver/nodelet">
<param name="port" type="string" value="/tmp/depth"/>
<param name="frame_id" type="string" value="/depth"/>
Expand All @@ -26,7 +26,7 @@

<!-- IMU -->
<group if="$(arg imu)" >
<node if="$(eval environment == 'real')" pkg="subjugator_launch" type="imu_conn" name="imu_conn" respawn="true"/>
<node if="$(eval environment == 'real')" pkg="subjugator_launch" type="imu_conn" name="imu_conn" respawn="true" respawn_delay = "10"/>
<node if="$(eval environment == 'real')" pkg="nodelet" type="nodelet" name="imu_driver"
args="standalone adis16400_imu/nodelet">
<param name="port" type="string" value="/tmp/imu"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Device
}
catch (const std::exception &exc)
{
ROS_ERROR("error on open(%s): %s; reopening after delay", port.c_str(), exc.what());
ROS_ERROR_THROTTLE(5, "error on open(%s): %s; reopening after delay", port.c_str(), exc.what());
boost::this_thread::sleep(boost::posix_time::seconds(1));
return false;
}
Expand All @@ -62,7 +62,7 @@ class Device
}
catch (const std::exception &exc)
{
ROS_ERROR("error on read: %s; reopening", exc.what());
ROS_ERROR_THROTTLE(5, "error on read: %s; reopening", exc.what());
open();
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Device
}
catch (const std::exception &exc)
{
ROS_ERROR("error on write: %s; dropping", exc.what());
ROS_ERROR_THROTTLE(5, "error on write: %s; dropping", exc.what());
}
}

Expand All @@ -82,7 +82,7 @@ class Device
}
catch (const std::exception &exc)
{
ROS_ERROR("error on read: %s; reopening", exc.what());
ROS_ERROR_THROTTLE(5, "error on read: %s; reopening", exc.what());
open();
return false;
}
Expand All @@ -98,7 +98,7 @@ class Device
}
catch (const std::exception &exc)
{
ROS_ERROR("error on open(%s): %s; reopening after delay", port.c_str(), exc.what());
ROS_ERROR_THROTTLE(5, "error on open(%s): %s; reopening after delay", port.c_str(), exc.what());
boost::this_thread::sleep(boost::posix_time::seconds(1));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Device
}
catch (const std::exception &exc)
{
ROS_ERROR_THROTTLE(0.5, "DVL: error on read: %s; reopening serial port", exc.what());
ROS_ERROR_THROTTLE(5, "DVL: error on read: %s; reopening serial port", exc.what());
open();
return false;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ class Device
}
catch (const std::exception &exc)
{
ROS_ERROR("DVL: error on open(port=%s): %s; reopening after delay", port.c_str(), exc.what());
ROS_ERROR_THROTTLE(5, "DVL: error on open(port=%s): %s; reopening after delay", port.c_str(), exc.what());
boost::this_thread::sleep(boost::posix_time::seconds(1));
}
}
Expand Down Expand Up @@ -268,7 +268,7 @@ class Device
}
catch (const std::exception &exc)
{
ROS_ERROR_THROTTLE(0.5, "DVL: error on write: %s; dropping heartbeat", exc.what());
ROS_ERROR_THROTTLE(5, "DVL: error on write: %s; dropping heartbeat", exc.what());
}
}

Expand Down

0 comments on commit 824c481

Please sign in to comment.