/
/
/
1from launch import LaunchDescription
2import os
3from ament_index_python.packages import get_package_share_directory
4
5from launch_ros.actions import Node
6from launch.actions import OpaqueFunction, IncludeLaunchDescription, TimerAction, DeclareLaunchArgument
7from launch.launch_description_sources import PythonLaunchDescriptionSource
8
9def generate_launch_description():
10
11 pkg_fast_slam_gz = get_package_share_directory("fast_slam_gz_description")
12 pkg_fast_slam_ros = get_package_share_directory("fast_slam_ros")
13
14 # Launch bot description
15 simulation = IncludeLaunchDescription(
16 PythonLaunchDescriptionSource(
17 os.path.join(pkg_fast_slam_gz, "launch", "simple_bot_gz.launch.py")
18 )
19 )
20
21 fast_slam_node = Node(
22 package='fast_slam_ros',
23 executable='fast_slam_ros',
24 output='screen',
25 parameters=[{'use_sim_time': True}]
26 )
27
28 rviz = Node(
29 package="rviz2",
30 executable="rviz2",
31 arguments=[
32 "-d",
33 os.path.join(pkg_fast_slam_ros, "rviz", "fast_slam_landmarks.rviz"),
34 ],
35 parameters=[{'use_sim_time': True}]
36 )
37
38 return LaunchDescription(
39 [
40 simulation,
41 fast_slam_node,
42 rviz
43 ]
44 )