Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ros_gz_sim.launch.py when create_own_container is enabled (backport #620) #621

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading