@@ -41,6 +41,7 @@ def generate_launch_description():
4141 params_file = LaunchConfiguration ('params_file' )
4242 autostart = LaunchConfiguration ('autostart' )
4343 use_composition = LaunchConfiguration ('use_composition' )
44+ use_respawn = LaunchConfiguration ('use_respawn' )
4445
4546 # Map fully qualified names to relative ones so the node's namespace can be prepended.
4647 # In case of the transforms (tf), currently, there doesn't seem to be a better alternative
@@ -102,6 +103,10 @@ def generate_launch_description():
102103 'use_composition' , default_value = 'True' ,
103104 description = 'Whether to use composed bringup' )
104105
106+ declare_use_respawn_cmd = DeclareLaunchArgument (
107+ 'use_respawn' , default_value = 'False' ,
108+ description = 'Whether to respawn if a node crashes. Applied when composition is disabled.' )
109+
105110 # Specify the actions
106111 bringup_cmd_group = GroupAction ([
107112 PushRosNamespace (
@@ -123,6 +128,7 @@ def generate_launch_description():
123128 launch_arguments = {'namespace' : namespace ,
124129 'use_sim_time' : use_sim_time ,
125130 'autostart' : autostart ,
131+ 'use_respawn' : use_respawn ,
126132 'params_file' : params_file }.items ()),
127133
128134 IncludeLaunchDescription (
@@ -135,6 +141,7 @@ def generate_launch_description():
135141 'autostart' : autostart ,
136142 'params_file' : params_file ,
137143 'use_composition' : use_composition ,
144+ 'use_respawn' : use_respawn ,
138145 'container_name' : 'nav2_container' }.items ()),
139146
140147 IncludeLaunchDescription (
@@ -144,6 +151,7 @@ def generate_launch_description():
144151 'autostart' : autostart ,
145152 'params_file' : params_file ,
146153 'use_composition' : use_composition ,
154+ 'use_respawn' : use_respawn ,
147155 'container_name' : 'nav2_container' }.items ()),
148156 ])
149157
@@ -162,6 +170,7 @@ def generate_launch_description():
162170 ld .add_action (declare_params_file_cmd )
163171 ld .add_action (declare_autostart_cmd )
164172 ld .add_action (declare_use_composition_cmd )
173+ ld .add_action (declare_use_respawn_cmd )
165174
166175 # Add the actions to launch all of the navigation nodes
167176 ld .add_action (bringup_cmd_group )
0 commit comments