|
25 | 25 | from launch_ros.actions import Node |
26 | 26 | from launch_testing.legacy import LaunchTestService |
27 | 27 | from nav2_common.launch import RewrittenYaml |
28 | | -from nav2_simple_commander.utils import kill_os_processes |
29 | 28 |
|
30 | 29 |
|
31 | 30 | def generate_launch_description() -> LaunchDescription: |
32 | 31 | sim_dir = get_package_share_directory('nav2_minimal_tb3_sim') |
33 | 32 | nav2_bringup_dir = get_package_share_directory('nav2_bringup') |
34 | | - ros_gz_sim_dir = get_package_share_directory('ros_gz_sim') |
35 | 33 |
|
36 | 34 | world_sdf_xacro = os.path.join(sim_dir, 'worlds', 'tb3_sandbox.sdf.xacro') |
37 | 35 | robot_sdf = os.path.join(sim_dir, 'urdf', 'gz_waffle.sdf.xacro') |
@@ -72,11 +70,9 @@ def generate_launch_description() -> LaunchDescription: |
72 | 70 | 'GZ_SIM_RESOURCE_PATH', |
73 | 71 | str(Path(os.path.join(sim_dir)).parent.resolve()) |
74 | 72 | ), |
75 | | - IncludeLaunchDescription( |
76 | | - PythonLaunchDescriptionSource( |
77 | | - os.path.join(ros_gz_sim_dir, 'launch', 'gz_sim.launch.py') |
78 | | - ), |
79 | | - launch_arguments={'gz_args': ['-r -s ', world_sdf_xacro]}.items(), |
| 73 | + ExecuteProcess( |
| 74 | + cmd=['gz', 'sim', '-r', '-s', world_sdf_xacro], |
| 75 | + output='screen', |
80 | 76 | ), |
81 | 77 | IncludeLaunchDescription( |
82 | 78 | PythonLaunchDescriptionSource( |
@@ -133,7 +129,6 @@ def main(argv: list[str] = sys.argv[1:]): # type: ignore[no-untyped-def] |
133 | 129 | ls = LaunchService(argv=argv) |
134 | 130 | ls.include_launch_description(ld) |
135 | 131 | return_code = lts.run(ls) # type: ignore[no-untyped-call] |
136 | | - kill_os_processes('gz sim') |
137 | 132 | return return_code |
138 | 133 |
|
139 | 134 |
|
|
0 commit comments