2023-01-15 06:53:09 -08:00
<?xml version="1.0"?>
2022-10-16 21:36:11 -07:00
<!-- -->
<launch>
2023-01-15 07:00:31 -08:00
<!--
2022-10-16 21:36:11 -07:00
Hand-held 3D lidar mapping example using only a Velodyne PUCK and external odometry (using t265 as example).
Prerequisities: rtabmap should be built with libpointmatcher
We use T265 only for lidar deskewing and icp_odometry guess in this example.
Example:
$ roslaunch rtabmap_ros test_velodyne_t265_deskewing.launch
$ rosrun rviz rviz -f map
$ Show TF and /rtabmap/cloud_map topics
-->
<arg name= "rtabmapviz" default= "true" />
<arg name= "scan_20_hz" default= "false" /> <!-- If we launch the velodyne with "rpm:=1200" argument -->
<arg name= "deskewing" default= "true" />
<arg name= "slerp" default= "false" /> <!-- If true, a slerp between the first and last time will be used to deskew each point, which is faster than using tf for every point but less accurate -->
<arg name= "scan_topic" default= "/velodyne_points" />
<arg name= "use_sim_time" default= "false" />
<param if= "$(arg use_sim_time)" name= "use_sim_time" value= "true" />
<arg name= "odom_frame_id" default= "t265_odom_frame" /> <!-- input odometry: here we use T265 odometry, but it could be wheel odometry -->
<arg name= "frame_id" default= "velodyne" /> <!-- base frame of the robot: for this example, we use velodyne as base frame -->
<arg name= "queue_size" default= "10" />
<arg name= "queue_size_odom" default= "1" />
<arg name= "loop_ratio" default= "0.2" />
<arg name= "resolution" default= "0.05" /> <!-- set 0.05-0.3 for indoor, set 0.3-0.5 for outdoor -->
<arg name= "iterations" default= "10" />
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<!-- Grid parameters -->
<arg name= "ground_is_obstacle" default= "true" />
<arg name= "grid_max_range" default= "20" />
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<!-- For F2M Odometry -->
<arg name= "ground_normals_up" default= "false" /> <!-- set to true when velodyne is always horizontal to ground (ground robot, car) -->
<arg name= "local_map_size" default= "15000" />
<arg name= "key_frame_thr" default= "0.6" />
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<!-- For FLOAM Odometry -->
<arg name= "floam" default= "false" /> <!-- RTAB-Map should be built with FLOAM http://official-rtab-map-forum.206.s1.nabble.com/icp-odometry-with-LOAM-crash-tp8261p8563.html -->
<arg name= "floam_sensor" default= "0" /> <!-- 0=16 rings (VLP16), 1=32 rings, 2=64 rings -->
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<!-- Static transform between velodyne and T265: TODO: Adjust with real position/orientation!!! -->
<node unless= "$(arg use_sim_time)" pkg= "tf" type= "static_transform_publisher" name= "T265_to_velodyne_tf" args= "-0.01 0 0.055 0 0 0 t265_link velodyne 100" />
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<!-- Velodyne sensor VLP16 -->
<include unless= "$(arg use_sim_time)" file= "$(find velodyne_pointcloud)/launch/VLP16_points.launch" >
<arg if= "$(arg scan_20_hz)" name= "rpm" value= "1200" />
<arg unless= "$(arg scan_20_hz)" name= "rpm" value= "600" />
<arg name= "organize_cloud" value= "true" /> <!-- should be organized for deskewing -->
</include>
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<!-- T265 -->
<group unless= "$(arg use_sim_time)" ns= "t265" >
<include file= "$(find realsense2_camera)/launch/includes/nodelet.launch.xml" >
<arg name= "device_type" value= "t265" />
<arg name= "serial_no" value= "" />
<arg name= "tf_prefix" value= "t265" />
<arg name= "initial_reset" value= "false" />
<arg name= "enable_fisheye1" value= "false" />
<arg name= "enable_fisheye2" value= "false" />
<arg name= "topic_odom_in" value= "" />
<arg name= "calib_odom_file" value= "" />
<arg name= "enable_pose" value= "true" />
</include>
</group>
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<!-- Lidar Deskewing -->
<node if= "$(arg deskewing)" pkg= "nodelet" type= "nodelet" name= "lidar_deskewing" args= "standalone rtabmap_ros/lidar_deskewing" output= "screen" >
<param name= "wait_for_transform" value= "0.01" />
<param name= "fixed_frame_id" value= "$(arg odom_frame_id)" />
<param name= "slerp" value= "$(arg slerp)" />
<remap from= "input_cloud" to= "$(arg scan_topic)" />
</node>
<arg if= "$(arg deskewing)" name= "scan_topic_deskewed" default= "$(arg scan_topic)/deskewed" />
<arg unless= "$(arg deskewing)" name= "scan_topic_deskewed" default= "$(arg scan_topic)" />
<group ns= "rtabmap" >
<node pkg= "rtabmap_ros" type= "icp_odometry" name= "icp_odometry" output= "screen" >
<remap from= "scan_cloud" to= "$(arg scan_topic_deskewed)" />
<param name= "guess_frame_id" type= "string" value= "$(arg odom_frame_id)" />
<param name= "frame_id" type= "string" value= "$(arg frame_id)" />
<param name= "odom_frame_id" type= "string" value= "odom" />
<param name= "queue_size" type= "int" value= "$(arg queue_size_odom)" />
<param name= "wait_for_transform_duration" type= "double" value= "0.2" />
<param if= "$(arg scan_20_hz)" name= "expected_update_rate" type= "double" value= "25" />
<param unless= "$(arg scan_20_hz)" name= "expected_update_rate" type= "double" value= "15" />
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<!-- ICP parameters -->
<param name= "Icp/PointToPlane" type= "string" value= "true" />
<param name= "Icp/Iterations" type= "string" value= "$(arg iterations)" />
<param if= "$(arg floam)" name= "Icp/VoxelSize" type= "string" value= "0" />
<param unless= "$(arg floam)" name= "Icp/VoxelSize" type= "string" value= "$(arg resolution)" />
<param name= "Icp/DownsamplingStep" type= "string" value= "1" /> <!-- cannot be increased with ring-like lidar -->
<param name= "Icp/Epsilon" type= "string" value= "0.001" />
<param if= "$(arg floam)" name= "Icp/PointToPlaneK" type= "string" value= "0" />
<param unless= "$(arg floam)" name= "Icp/PointToPlaneK" type= "string" value= "20" />
<param name= "Icp/PointToPlaneRadius" type= "string" value= "0" />
<param name= "Icp/MaxTranslation" type= "string" value= "2" />
<param name= "Icp/MaxCorrespondenceDistance" type= "string" value= "$(eval resolution*10)" />
2023-01-15 07:00:31 -08:00
<param name= "Icp/PM" type= "string" value= "true" />
2022-10-16 21:36:11 -07:00
<param name= "Icp/PMOutlierRatio" type= "string" value= "0.7" />
2023-01-15 07:00:31 -08:00
<param name= "Icp/CorrespondenceRatio" type= "string" value= "0.01" />
2022-10-16 21:36:11 -07:00
<param if= "$(arg ground_normals_up)" name= "Icp/PointToPlaneGroundNormalsUp" type= "string" value= "0.8" />
2023-01-15 07:00:31 -08:00
<!-- Odom parameters -->
2022-10-16 21:36:11 -07:00
<param name= "Odom/ScanKeyFrameThr" type= "string" value= "$(arg key_frame_thr)" />
<param if= "$(arg floam)" name= "Odom/Strategy" type= "string" value= "11" />
<param unless= "$(arg floam)" name= "Odom/Strategy" type= "string" value= "0" />
<param name= "OdomF2M/ScanSubtractRadius" type= "string" value= "$(arg resolution)" />
<param name= "OdomF2M/ScanMaxSize" type= "string" value= "$(arg local_map_size)" />
2023-01-15 07:00:31 -08:00
<param name= "OdomLOAM/Sensor" type= "string" value= "$(arg floam_sensor)" />
2022-10-16 21:36:11 -07:00
<param name= "OdomLOAM/Resolution" type= "string" value= "$(arg resolution)" />
<param if= "$(eval not deskewing and scan_20_hz)" name= "OdomLOAM/ScanPeriod" type= "string" value= "0.05" />
<param if= "$(eval not deskewing and not scan_20_hz)" name= "OdomLOAM/ScanPeriod" type= "string" value= "0.1" />
<param if= "$(arg deskewing)" name= "OdomLOAM/ScanPeriod" type= "string" value= "0" />
</node>
2023-01-15 07:00:31 -08:00
<node pkg= "rtabmap_ros" type= "rtabmap" name= "rtabmap" output= "screen" args= "-d" >
<param name= "frame_id" type= "string" value= "$(arg frame_id)" />
2022-10-16 21:36:11 -07:00
<param name= "subscribe_depth" type= "bool" value= "false" />
<param name= "subscribe_rgb" type= "bool" value= "false" />
<param name= "subscribe_scan_cloud" type= "bool" value= "true" />
<param name= "approx_sync" type= "bool" value= "false" />
<param name= "wait_for_transform_duration" type= "double" value= "0.2" />
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<remap from= "scan_cloud" to= "assembled_cloud" />
2023-01-15 07:00:31 -08:00
2022-10-16 21:36:11 -07:00
<!-- RTAB-Map's parameters -->
2023-01-15 07:00:31 -08:00
<param name= "Rtabmap/DetectionRate" type= "string" value= "1" />
2022-10-16 21:36:11 -07:00
<param name= "RGBD/NeighborLinkRefining" type= "string" value= "false" />
<param name= "RGBD/ProximityBySpace" type= "string" value= "true" />
<param name= "RGBD/ProximityMaxGraphDepth" type= "string" value= "0" />
<param name= "RGBD/ProximityPathMaxNeighbors" type= "string" value= "1" />
<param name= "RGBD/AngularUpdate" type= "string" value= "0.05" />
<param name= "RGBD/LinearUpdate" type= "string" value= "0.05" />
<param name= "Mem/NotLinkedNodesKept" type= "string" value= "false" />
<param name= "Mem/STMSize" type= "string" value= "30" />
<param name= "Mem/LaserScanNormalK" type= "string" value= "20" />
2023-01-15 07:00:31 -08:00
<param name= "Reg/Strategy" type= "string" value= "1" />
2022-10-16 21:36:11 -07:00
<param name= "Grid/CellSize" type= "string" value= "$(arg resolution)" />
<param name= "Grid/RangeMax" type= "string" value= "$(arg grid_max_range)" />
<param name= "Grid/ClusterRadius" type= "string" value= "1" />
<param name= "Grid/GroundIsObstacle" type= "string" value= "$(arg ground_is_obstacle)" />
<param name= "Optimizer/GravitySigma" type= "string" value= "0.3" />
<!-- ICP parameters -->
<param name= "Icp/VoxelSize" type= "string" value= "$(arg resolution)" />
<param name= "Icp/PointToPlaneK" type= "string" value= "20" />
<param name= "Icp/PointToPlaneRadius" type= "string" value= "0" />
<param name= "Icp/PointToPlane" type= "string" value= "true" />
<param name= "Icp/Iterations" type= "string" value= "$(arg iterations)" />
<param name= "Icp/Epsilon" type= "string" value= "0.001" />
<param name= "Icp/MaxTranslation" type= "string" value= "3" />
<param name= "Icp/MaxCorrespondenceDistance" type= "string" value= "$(eval resolution*10)" />
2023-01-15 07:00:31 -08:00
<param name= "Icp/PM" type= "string" value= "true" />
2022-10-16 21:36:11 -07:00
<param name= "Icp/PMOutlierRatio" type= "string" value= "0.7" />
<param name= "Icp/CorrespondenceRatio" type= "string" value= "$(arg loop_ratio)" />
</node>
<node if= "$(arg rtabmapviz)" name= "rtabmapviz" pkg= "rtabmap_ros" type= "rtabmapviz" output= "screen" >
<param name= "frame_id" type= "string" value= "$(arg frame_id)" />
<param name= "odom_frame_id" type= "string" value= "odom" />
<param name= "subscribe_odom_info" type= "bool" value= "true" />
<param name= "subscribe_scan_cloud" type= "bool" value= "true" />
<param name= "approx_sync" type= "bool" value= "false" />
<remap from= "scan_cloud" to= "odom_filtered_input_scan" />
<remap from= "odom_info" to= "odom_info" />
</node>
<node pkg= "nodelet" type= "nodelet" name= "point_cloud_assembler" args= "standalone rtabmap_ros/point_cloud_assembler" output= "screen" >
<remap from= "cloud" to= "$(arg scan_topic_deskewed)" />
<remap from= "odom" to= "odom" />
<param if= "$(arg scan_20_hz)" name= "max_clouds" type= "int" value= "20" />
<param unless= "$(arg scan_20_hz)" name= "max_clouds" type= "int" value= "10" />
<param name= "fixed_frame_id" type= "string" value= "" />
<param name= "queue_size" type= "int" value= "$(arg queue_size)" />
</node>
</group>
</launch>