slam.launch.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. import pathlib
  8. from ament_index_python.packages import get_package_share_directory
  9. from launch import LaunchDescription
  10. from launch.actions import IncludeLaunchDescription
  11. from launch.launch_description_sources import PythonLaunchDescriptionSource
  12. from launch_ros.actions import Node
  13. def generate_launch_description():
  14. return LaunchDescription([
  15. IncludeLaunchDescription(
  16. PythonLaunchDescriptionSource([str(pathlib.Path(
  17. get_package_share_directory('slam_toolbox')).joinpath(
  18. 'launch',
  19. 'online_async_launch.py'))]),
  20. launch_arguments={
  21. 'slam_params_file': str(pathlib.Path(__file__).parent.absolute().joinpath(
  22. 'config',
  23. 'slam_params.yaml'))
  24. }.items()
  25. ),
  26. Node(
  27. package='pointcloud_to_laserscan',
  28. executable='pointcloud_to_laserscan_node',
  29. name='pc_to_laserscan',
  30. parameters=[{
  31. 'min_height': 0.0,
  32. 'max_height': 0.5,
  33. 'range_min': 0.1
  34. }],
  35. remappings=[
  36. ('/cloud_in', '/pc'),
  37. ]
  38. )
  39. ])