From 739cb42a5846cd12a526b97ba051a2d8cdbe034b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 09:46:27 +0200 Subject: [PATCH] Fix ros_gz_sim.launch.py when create_own_container is enabled. (#620) (#621) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Agüero (cherry picked from commit a4d00a90a1a5f753a0d0fbfe8e1e142540aebadd) Co-authored-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