navigation.launch.py 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. import pathlib
  2. from ament_index_python.packages import get_package_share_directory
  3. from launch import LaunchDescription
  4. from launch.actions import IncludeLaunchDescription
  5. from launch.launch_description_sources import PythonLaunchDescriptionSource
  6. from launch_ros.actions import Node
  7. def generate_launch_description():
  8. return LaunchDescription([
  9. IncludeLaunchDescription(
  10. PythonLaunchDescriptionSource([str(pathlib.Path(__file__).parent.absolute().joinpath('slam.launch.py'))])
  11. ),
  12. IncludeLaunchDescription(
  13. PythonLaunchDescriptionSource([str(pathlib.Path(get_package_share_directory("nav2_bringup")).joinpath('launch', 'navigation_launch.py'))]),
  14. launch_arguments = {
  15. 'params_file': str(pathlib.Path(__file__).parent.absolute().joinpath('config', 'navigation_params.yaml'))
  16. }.items()
  17. ),
  18. Node(
  19. package='rviz2',
  20. executable='rviz2',
  21. name='slam',
  22. output={
  23. 'stdout': 'log',
  24. },
  25. arguments=[
  26. '-d', str(pathlib.Path(__file__).parent.absolute().joinpath('config', 'config.rviz')),
  27. ]
  28. ),
  29. ])