Skip to content

Commit

Permalink
Fix ros_gz_sim.launch.py when create_own_container is enabled. (#620)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Agüero <caguero@openrobotics.org>
  • Loading branch information
caguero authored Oct 17, 2024
1 parent 2d32f1b commit a4d00a9
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions ros_gz_sim/launch/ros_gz_sim.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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()
Expand All @@ -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

0 comments on commit a4d00a9

Please sign in to comment.