From b620114ce087ebef456540ef9621d52b5b801aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ag=C3=BCero?= Date: Thu, 17 Oct 2024 21:25:59 +0200 Subject: [PATCH] Fix ros_gz_sim.launch.py when create_own_container is enabled. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Agüero --- ros_gz_sim/launch/ros_gz_sim.launch.py | 27 +++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ros_gz_sim/launch/ros_gz_sim.launch.py b/ros_gz_sim/launch/ros_gz_sim.launch.py index ad32e801..aba047ee 100644 --- a/ros_gz_sim/launch/ros_gz_sim.launch.py +++ b/ros_gz_sim/launch/ros_gz_sim.launch.py @@ -83,6 +83,17 @@ def generate_launch_description(): description='SDF world string' ) + gz_server_description = IncludeLaunchDescription( + PythonLaunchDescriptionSource( + [PathJoinSubstitution([FindPackageShare('ros_gz_sim'), + 'launch', + 'gz_server.launch.py'])]), + launch_arguments=[('world_sdf_file', world_sdf_file), + ('world_sdf_string', world_sdf_string), + ('container_name', container_name), + ('create_own_container', create_own_container), + ('use_composition', use_composition), ]) + bridge_description = IncludeLaunchDescription( PythonLaunchDescriptionSource( [PathJoinSubstitution([FindPackageShare('ros_gz_bridge'), @@ -92,20 +103,10 @@ def generate_launch_description(): ('config_file', config_file), ('container_name', container_name), ('namespace', namespace), + ('create_own_container', str(False)), ('use_composition', use_composition), ('use_respawn', use_respawn), - ('bridge_log_level', bridge_log_level)]) - - gz_server_description = IncludeLaunchDescription( - PythonLaunchDescriptionSource( - [PathJoinSubstitution([FindPackageShare('ros_gz_sim'), - 'launch', - 'gz_server.launch.py'])]), - launch_arguments=[('world_sdf_file', world_sdf_file), - ('world_sdf_string', world_sdf_string), - ('container_name', container_name), - ('create_own_container', create_own_container), - ('use_composition', use_composition), ]) + ('bridge_log_level', bridge_log_level), ]) # Create the launch description and populate ld = LaunchDescription() @@ -122,7 +123,7 @@ def generate_launch_description(): ld.add_action(declare_world_sdf_file_cmd) ld.add_action(declare_world_sdf_string_cmd) # Add the actions to launch all of the bridge + gz_server nodes - ld.add_action(bridge_description) ld.add_action(gz_server_description) + ld.add_action(bridge_description) return ld