File tree 1 file changed +18
-6
lines changed
launch_ros/launch_ros/actions 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 38
38
from launch .utilities import perform_substitutions
39
39
from launch_ros .parameter_descriptions import ParameterFile
40
40
41
+ from rclpy .exceptions import InvalidHandle
42
+
41
43
from .composable_node_container import ComposableNodeContainer
42
44
43
45
from ..descriptions import ComposableNode
@@ -116,14 +118,24 @@ def _load_node(
116
118
:param request: service request to load a node
117
119
:param context: current launch context
118
120
"""
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
+ )
124
129
)
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
125
136
)
126
- return
137
+ )
138
+ return
127
139
128
140
# Asynchronously wait on service call so that we can periodically check for shutdown
129
141
event = threading .Event ()
You can’t perform that action at this time.
0 commit comments