File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
launch_ros/launch_ros/actions Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 3838from launch .utilities import perform_substitutions
3939from launch_ros .parameter_descriptions import ParameterFile
4040
41+ from rclpy .exceptions import InvalidHandle
42+
4143from .composable_node_container import ComposableNodeContainer
4244
4345from ..descriptions import ComposableNode
@@ -116,14 +118,24 @@ def _load_node(
116118 :param request: service request to load a node
117119 :param context: current launch context
118120 """
119- while not self .__rclpy_load_node_client .wait_for_service (timeout_sec = 1.0 ):
120- if context .is_shutdown :
121- self .__logger .warning (
122- "Abandoning wait for the '{}' service, due to shutdown." .format (
123- self .__rclpy_load_node_client .srv_name
121+ try :
122+ while not self .__rclpy_load_node_client .wait_for_service (timeout_sec = 1.0 ):
123+ if context .is_shutdown :
124+ self .__logger .warning (
125+ "Abandoning wait for the '{}' service, "
126+ 'due to shutdown.' .format (
127+ self .__rclpy_load_node_client .srv_name
128+ )
124129 )
130+ return
131+ except InvalidHandle :
132+ self .__logger .warning (
133+ "Abandoning wait for the '{}' service, "
134+ 'due to invalid rclpy handle.' .format (
135+ self .__rclpy_load_node_client .srv_name
125136 )
126- return
137+ )
138+ return
127139
128140 # Asynchronously wait on service call so that we can periodically check for shutdown
129141 event = threading .Event ()
You can’t perform that action at this time.
0 commit comments