mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 16:57:46 +08:00
Merged master->ros2, added vlp16 launch example, added d435i stereo launch example
This commit is contained in:
@@ -17,6 +17,7 @@ def generate_launch_description():
|
||||
parameters=[{
|
||||
'frame_id':'camera_link',
|
||||
'subscribe_depth':True,
|
||||
'subscribe_odom_info':True,
|
||||
'approx_sync':False}]
|
||||
|
||||
remappings=[
|
||||
|
||||
@@ -15,6 +15,7 @@ def generate_launch_description():
|
||||
parameters=[{
|
||||
'frame_id':'camera_link',
|
||||
'subscribe_depth':True,
|
||||
'subscribe_odom_info':True,
|
||||
'approx_sync':False,
|
||||
'wait_imu_to_init':True}]
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ def generate_launch_description():
|
||||
parameters=[{
|
||||
'frame_id':'camera_link',
|
||||
'subscribe_depth':True,
|
||||
'subscribe_odom_info':True,
|
||||
'approx_sync':False,
|
||||
'wait_imu_to_init':True}]
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
# Requirements:
|
||||
# A realsense D435i
|
||||
# Install realsense2 ros2 package (ros-$ROS_DISTRO-realsense2-camera)
|
||||
# Example:
|
||||
# $ ros2 launch realsense2_camera rs_launch.py enable_gyro:=true enable_accel:=true unite_imu_method:=1 enable_infra1:=true enable_infra2:=true enable_sync:=true
|
||||
# $ ros2 param set /camera/camera depth_module.emitter_enabled 0
|
||||
#
|
||||
# $ ros2 launch rtabmap_ros realsense_d435i_stereo.launch.py
|
||||
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, SetEnvironmentVariable
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
|
||||
def generate_launch_description():
|
||||
parameters=[{
|
||||
'frame_id':'camera_link',
|
||||
'subscribe_stereo':True,
|
||||
'subscribe_odom_info':True,
|
||||
'wait_imu_to_init':True}]
|
||||
|
||||
remappings=[
|
||||
('imu', '/imu/data'),
|
||||
('left/image_rect', '/camera/infra1/image_rect_raw'),
|
||||
('left/camera_info', '/camera/infra1/camera_info'),
|
||||
('right/image_rect', '/camera/infra2/image_rect_raw'),
|
||||
('right/camera_info', '/camera/infra2/camera_info')]
|
||||
|
||||
return LaunchDescription([
|
||||
|
||||
# Nodes to launch
|
||||
Node(
|
||||
package='rtabmap_ros', executable='stereo_odometry', output='screen',
|
||||
parameters=parameters,
|
||||
remappings=remappings),
|
||||
|
||||
Node(
|
||||
package='rtabmap_ros', executable='rtabmap', output='screen',
|
||||
parameters=parameters,
|
||||
remappings=remappings,
|
||||
arguments=['-d']),
|
||||
|
||||
Node(
|
||||
package='rtabmap_ros', executable='rtabmapviz', output='screen',
|
||||
parameters=parameters,
|
||||
remappings=remappings),
|
||||
|
||||
# Compute quaternion of the IMU
|
||||
Node(
|
||||
package='imu_filter_madgwick', executable='imu_filter_madgwick_node', output='screen',
|
||||
parameters=[{'use_mag': False,
|
||||
'world_frame':'enu',
|
||||
'publish_tf':False}],
|
||||
remappings=[('imu/data_raw', '/camera/imu')]),
|
||||
|
||||
# The IMU frame is mising in TF tree, add it:
|
||||
Node(
|
||||
package='tf2_ros', executable='static_transform_publisher', output='screen',
|
||||
arguments=['0', '0', '0', '0', '0', '0', 'camera_gyro_optical_frame', 'camera_imu_optical_frame']),
|
||||
])
|
||||
@@ -24,7 +24,7 @@
|
||||
# SLAM:
|
||||
# $ ros2 launch rtabmap_ros turtlebot3_rgbd.launch.py
|
||||
# OR
|
||||
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint odom_topic:=/odom args:="-d" use_sim_time:=true rgb_topic:=/camera/image_raw depth_topic:=/camera/depth/image_raw camera_info_topic:=/camera/camera_info approx_sync:=true
|
||||
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint odom_topic:=/odom args:="-d" use_sim_time:=true rgb_topic:=/camera/image_raw depth_topic:=/camera/depth/image_raw camera_info_topic:=/camera/camera_info approx_sync:=true qos:=2
|
||||
#
|
||||
# Navigation (install nav2_bringup package):
|
||||
# $ ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
# SLAM:
|
||||
# $ ros2 launch rtabmap_ros turtlebot3_rgbd_sync.launch.py
|
||||
# OR
|
||||
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint subscribe_scan:=true approx_sync:=true approx_rgbd_sync:=false odom_topic:=/odom args:="-d --RGBD/NeighborLinkRefining true --Reg/Strategy 1 --Reg/Force3DoF true --Grid/RangeMin 0.2" use_sim_time:=true rgbd_sync:=true rgb_topic:=/camera/image_raw depth_topic:=/camera/depth/image_raw camera_info_topic:=/camera/camera_info
|
||||
# $ ros2 launch rtabmap_ros rtabmap.launch.py visual_odometry:=false frame_id:=base_footprint subscribe_scan:=true approx_sync:=true approx_rgbd_sync:=false odom_topic:=/odom args:="-d --RGBD/NeighborLinkRefining true --Reg/Strategy 1 --Reg/Force3DoF true --Grid/RangeMin 0.2" use_sim_time:=true rgbd_sync:=true rgb_topic:=/camera/image_raw depth_topic:=/camera/depth/image_raw camera_info_topic:=/camera/camera_info qos:=2
|
||||
#
|
||||
# Navigation (install nav2_bringup package):
|
||||
# $ ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# SLAM:
|
||||
# $ 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 --Reg/Force3DoF true --Grid/RangeMin 0.2" use_sim_time:=true
|
||||
# $ 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 --Reg/Force3DoF true --Grid/RangeMin 0.2" use_sim_time:=true qos:=2
|
||||
#
|
||||
# Navigation (install nav2_bringup package):
|
||||
# $ ros2 launch nav2_bringup navigation_launch.py use_sim_time:=True
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
# Example:
|
||||
# $ ros2 launch velodyne_driver velodyne_driver_node-VLP16-launch.py
|
||||
# $ ros2 launch velodyne_pointcloud velodyne_transform_node-VLP16-launch.py
|
||||
#
|
||||
# SLAM:
|
||||
# $ ros2 launch rtabmap_ros vlp16.launch.py
|
||||
|
||||
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
|
||||
def generate_launch_description():
|
||||
|
||||
use_sim_time = LaunchConfiguration('use_sim_time')
|
||||
deskewing = LaunchConfiguration('deskewing')
|
||||
|
||||
return LaunchDescription([
|
||||
|
||||
# Launch arguments
|
||||
DeclareLaunchArgument(
|
||||
'use_sim_time', default_value='false',
|
||||
description='Use simulation (Gazebo) clock if true'),
|
||||
|
||||
DeclareLaunchArgument(
|
||||
'deskewing', default_value='true',
|
||||
description='Enable lidar deskewing'),
|
||||
|
||||
# Nodes to launch
|
||||
Node(
|
||||
package='rtabmap_ros', executable='icp_odometry', output='screen',
|
||||
parameters=[{
|
||||
'frame_id':'velodyne',
|
||||
'odom_frame_id':'odom',
|
||||
'wait_for_transform':0.2,
|
||||
'expected_update_rate':15.0,
|
||||
'deskewing':deskewing,
|
||||
'use_sim_time':use_sim_time,
|
||||
}],
|
||||
remappings=[
|
||||
('scan_cloud', '/velodyne_points')
|
||||
],
|
||||
arguments=[
|
||||
'Icp/PointToPlane', 'true',
|
||||
'Icp/Iterations', '10',
|
||||
'Icp/VoxelSize', '0.1',
|
||||
'Icp/Epsilon', '0.001',
|
||||
'Icp/PointToPlaneK', '20',
|
||||
'Icp/PointToPlaneRadius', '0',
|
||||
'Icp/MaxTranslation', '2',
|
||||
'Icp/MaxCorrespondenceDistance', '1',
|
||||
'Icp/Strategy', '1',
|
||||
'Icp/OutlierRatio', '0.7',
|
||||
'Icp/CorrespondenceRatio', '0.01',
|
||||
'Odom/ScanKeyFrameThr', '0.6',
|
||||
'OdomF2M/ScanSubtractRadius', '0.1',
|
||||
'OdomF2M/ScanMaxSize', '15000',
|
||||
'OdomF2M/BundleAdjustment', 'false',
|
||||
]),
|
||||
|
||||
Node(
|
||||
package='rtabmap_ros', executable='point_cloud_assembler', output='screen',
|
||||
parameters=[{
|
||||
'max_clouds':10,
|
||||
'fixed_frame_id':'',
|
||||
'use_sim_time':use_sim_time,
|
||||
}],
|
||||
remappings=[
|
||||
('cloud', 'odom_filtered_input_scan')
|
||||
]),
|
||||
|
||||
Node(
|
||||
package='rtabmap_ros', executable='rtabmap', output='screen',
|
||||
parameters=[{
|
||||
'frame_id':'velodyne',
|
||||
'subscribe_depth':False,
|
||||
'subscribe_rgb':False,
|
||||
'subscribe_scan_cloud':True,
|
||||
'approx_sync':False,
|
||||
'wait_for_transform':0.2,
|
||||
'use_sim_time':use_sim_time,
|
||||
}],
|
||||
remappings=[
|
||||
('scan_cloud', 'assembled_cloud')
|
||||
],
|
||||
arguments=[
|
||||
'-d', # This will delete the previous database (~/.ros/rtabmap.db)
|
||||
'RGBD/ProximityMaxGraphDepth', '0',
|
||||
'RGBD/ProximityPathMaxNeighbors', '1',
|
||||
'RGBD/AngularUpdate', '0.05',
|
||||
'RGBD/LinearUpdate', '0.05',
|
||||
'RGBD/CreateOccupancyGrid', 'false',
|
||||
'Mem/NotLinkedNodesKept', 'false',
|
||||
'Mem/STMSize', '30',
|
||||
'Mem/LaserScanNormalK', '20',
|
||||
'Reg/Strategy', '1',
|
||||
'Icp/VoxelSize', '0.1',
|
||||
'Icp/PointToPlaneK', '20',
|
||||
'Icp/PointToPlaneRadius', '0',
|
||||
'Icp/PointToPlane', 'true',
|
||||
'Icp/Iterations', '10',
|
||||
'Icp/Epsilon', '0.001',
|
||||
'Icp/MaxTranslation', '3',
|
||||
'Icp/MaxCorrespondenceDistance', '1',
|
||||
'Icp/Strategy', '1',
|
||||
'Icp/OutlierRatio', '0.7',
|
||||
'Icp/CorrespondenceRatio', '0.2',
|
||||
]),
|
||||
|
||||
Node(
|
||||
package='rtabmap_ros', executable='rtabmapviz', output='screen',
|
||||
parameters=[{
|
||||
'frame_id':'velodyne',
|
||||
'odom_frame_id':'odom',
|
||||
'subscribe_odom_info':True,
|
||||
'subscribe_scan_cloud':True,
|
||||
'approx_sync':False,
|
||||
'use_sim_time':use_sim_time,
|
||||
}],
|
||||
remappings=[
|
||||
('scan_cloud', 'odom_filtered_input_scan')
|
||||
]),
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user