Skip to content

Commit

Permalink
fixing gz sim launch file by using gz directly (ros-navigation#4514)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMacenski authored Jul 3, 2024
1 parent bbd5b7b commit d1e8eee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
9 changes: 4 additions & 5 deletions nav2_bringup/launch/cloned_multi_tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,10 @@ def generate_launch_description():
world_sdf = tempfile.mktemp(prefix='nav2_', suffix='.sdf')
world_sdf_xacro = ExecuteProcess(
cmd=['xacro', '-o', world_sdf, ['headless:=', 'False'], world])
start_gazebo_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('ros_gz_sim'), 'launch',
'gz_sim.launch.py')),
launch_arguments={'gz_args': ['-r -s ', world_sdf]}.items())
start_gazebo_cmd = ExecuteProcess(
cmd=['gz', 'sim', '-r', '-s', world_sdf],
output='screen',
)

remove_temp_sdf_file = RegisterEventHandler(event_handler=OnShutdown(
on_shutdown=[
Expand Down
11 changes: 5 additions & 6 deletions nav2_bringup/launch/tb3_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,11 @@ def generate_launch_description():
world_sdf = tempfile.mktemp(prefix='nav2_', suffix='.sdf')
world_sdf_xacro = ExecuteProcess(
cmd=['xacro', '-o', world_sdf, ['headless:=', headless], world])
gazebo_server = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('ros_gz_sim'), 'launch',
'gz_sim.launch.py')),
launch_arguments={'gz_args': ['-r -s ', world_sdf]}.items(),
condition=IfCondition(use_simulator))
gazebo_server = ExecuteProcess(
cmd=['gz', 'sim', '-r', '-s', world_sdf],
output='screen',
condition=IfCondition(use_simulator)
)

remove_temp_sdf_file = RegisterEventHandler(event_handler=OnShutdown(
on_shutdown=[
Expand Down
11 changes: 5 additions & 6 deletions nav2_bringup/launch/tb4_simulation_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,11 @@ def generate_launch_description():
world_sdf = tempfile.mktemp(prefix='nav2_', suffix='.sdf')
world_sdf_xacro = ExecuteProcess(
cmd=['xacro', '-o', world_sdf, ['headless:=', headless], world])
gazebo_server = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('ros_gz_sim'), 'launch',
'gz_sim.launch.py')),
launch_arguments={'gz_args': ['-r -s ', world_sdf]}.items(),
condition=IfCondition(use_simulator))
gazebo_server = ExecuteProcess(
cmd=['gz', 'sim', '-r', '-s', world_sdf],
output='screen',
condition=IfCondition(use_simulator)
)

remove_temp_sdf_file = RegisterEventHandler(event_handler=OnShutdown(
on_shutdown=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,10 @@ def generate_launch_description():
world_sdf = tempfile.mktemp(prefix='nav2_', suffix='.sdf')
world_sdf_xacro = ExecuteProcess(
cmd=['xacro', '-o', world_sdf, ['headless:=', 'False'], world])
start_gazebo_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(get_package_share_directory('ros_gz_sim'), 'launch',
'gz_sim.launch.py')),
launch_arguments={'gz_args': ['-r -s ', world_sdf]}.items())
start_gazebo_cmd = ExecuteProcess(
cmd=['gz', 'sim', '-r', '-s', world_sdf],
output='screen',
)

remove_temp_sdf_file = RegisterEventHandler(event_handler=OnShutdown(
on_shutdown=[
Expand Down

0 comments on commit d1e8eee

Please sign in to comment.