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
…#621)

Signed-off-by: Carlos Agüero <[email protected]>
(cherry picked from commit a4d00a9)

Co-authored-by: Carlos Agüero <[email protected]>
  • Loading branch information
mergify[bot] and caguero authored Oct 18, 2024
1 parent b404dbd commit 739cb42
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 739cb42

Please sign in to comment.