Files
rtabmap_ros/launch/ros2/turtlebot3_scan.launch.py
T

53 lines
1.7 KiB
Python
Raw Normal View History

2020-01-30 17:18:48 -05:00
# Requirements:
# Install Turtlebot3 packages
# Example:
# $ export TURTLEBOT3_MODEL=waffle
2020-01-30 17:18:48 -05:00
# $ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
# $ ros2 run turtlebot3_teleop teleop_keyboard
#
2020-01-30 17:18:48 -05:00
# $ ros2 launch rtabmap_ros turtlebot3_scan.launch.py
# OR
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint subscribe_scan:=true depth:=false approx_sync:=true odom_topic:=/odom args:="-d --RGBD/NeighborLinkRefining true --Reg/Strategy 1" use_sim_time:=true
2020-01-30 17:18:48 -05:00
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable
from launch.substitutions import LaunchConfiguration
2020-10-16 18:02:08 +03:00
from launch_ros.actions import Node
2020-01-30 17:18:48 -05:00
def generate_launch_description():
use_sim_time = LaunchConfiguration('use_sim_time')
parameters=[{
'frame_id':'base_footprint',
'use_sim_time':use_sim_time,
'subscribe_depth':False,
'subscribe_rgb':False,
'subscribe_scan':True,
'approx_sync':True,
'Reg/Strategy':'1',
'RGBD/NeighborLinkRefining':'True'}]
remappings=[
('scan', '/scan')]
return LaunchDescription([
# Launch arguments
DeclareLaunchArgument(
'use_sim_time', default_value='true',
description='Use simulation (Gazebo) clock if true'),
# Nodes to launch
Node(
2021-07-13 09:05:07 +02:00
package='rtabmap_ros', executable='rtabmap', output='screen',
2020-01-30 17:18:48 -05:00
parameters=parameters,
remappings=remappings,
arguments=['-d']),
Node(
2021-07-13 09:05:07 +02:00
package='rtabmap_ros', executable='rtabmapviz', output='screen',
2020-01-30 17:18:48 -05:00
parameters=parameters,
remappings=remappings),
])