2015-07-20 16:13:56 -04:00
<launch>
<!-- Your camera should be calibrated and publishing rectified left and right
images + corresponding camera_info msgs. You can use stereo_image_proc for image rectification.
Example:
$ roslaunch rtabmap_ros bumblebee.launch -->
2015-08-07 13:00:32 -04:00
<!-- Choose visualization -->
2015-07-20 16:13:56 -04:00
<arg name= "rtabmapviz" default= "true" />
2015-08-07 13:00:32 -04:00
<arg name= "rviz" default= "false" />
2016-03-13 18:05:27 -04:00
<!-- Localization-only mode -->
<arg name= "localization" default= "false" />
2015-08-07 13:00:32 -04:00
<!-- Corresponding config files -->
<arg name= "rtabmapviz_cfg" default= "-d $(find rtabmap_ros)/launch/config/rgbd_gui.ini" />
<arg name= "rviz_cfg" default= "-d $(find rtabmap_ros)/launch/config/rgbd.rviz" />
2015-07-20 16:13:56 -04:00
<arg name= "frame_id" default= "base_link" /> <!-- Fixed frame id, you may set "base_link" or "base_footprint" if they are published -->
<arg name= "time_threshold" default= "0" /> <!-- (ms) If not 0 ms, memory management is used to keep processing time on this fixed limit. -->
<arg name= "optimize_from_last_node" default= "false" /> <!-- Optimize the map from the last node. Should be true on multi-session mapping and when time threshold is set -->
2015-07-26 16:52:52 -04:00
<arg name= "database_path" default= "~/.ros/rtabmap.db" />
<arg name= "rtabmap_args" default= "" /> <!-- delete_db_on_start, udebug -->
2016-03-11 16:57:49 -05:00
<arg name= "launch_prefix" default= "" />
2015-07-26 16:52:52 -04:00
2015-09-14 15:09:33 -04:00
<arg name= "stereo_namespace" default= "/stereo_camera" />
<arg name= "left_image_topic" default= "$(arg stereo_namespace)/left/image_rect_color" />
<arg name= "right_image_topic" default= "$(arg stereo_namespace)/right/image_rect" /> <!-- using grayscale image for efficiency -->
<arg name= "left_camera_info_topic" default= "$(arg stereo_namespace)/left/camera_info" />
<arg name= "right_camera_info_topic" default= "$(arg stereo_namespace)/right/camera_info" />
2015-08-07 13:00:32 -04:00
<arg name= "approximate_sync" default= "false" /> <!-- if timestamps of the stereo images are not synchronized -->
2015-09-30 18:59:22 -04:00
<arg name= "compressed" default= "false" />
2016-03-11 16:57:49 -05:00
<arg name= "convert_depth_to_mm" default= "true" />
2015-07-20 16:13:56 -04:00
<arg name= "subscribe_scan" default= "false" /> <!-- Assuming 2D scan if set, rtabmap will do 3DoF mapping instead of 6DoF -->
<arg name= "scan_topic" default= "/scan" />
2016-03-13 18:05:27 -04:00
<arg name= "subscribe_scan_cloud" default= "false" /> <!-- Assuming 3D scan if set -->
<arg name= "scan_cloud_topic" default= "/scan_cloud" />
2015-08-07 14:04:45 -04:00
<arg name= "visual_odometry" default= "true" /> <!-- Generate visual odometry -->
<arg name= "odom_topic" default= "/odom" /> <!-- Odometry topic used if visual_odometry is false -->
2015-07-20 16:13:56 -04:00
<arg name= "namespace" default= "rtabmap" />
2015-08-14 15:01:51 -04:00
<arg name= "wait_for_transform" default= "0.1" />
2015-07-20 16:13:56 -04:00
<!-- Nodes -->
<group ns= "$(arg namespace)" >
2015-09-30 18:59:22 -04:00
<node if= "$(arg compressed)" name= "republish_left" type= "republish" pkg= "image_transport" args= "compressed in:=$(arg left_image_topic) raw out:=$(arg left_image_topic)" />
<node if= "$(arg compressed)" name= "republish_right" type= "republish" pkg= "image_transport" args= "compressed in:=$(arg right_image_topic) raw out:=$(arg right_image_topic)" />
2015-07-20 16:13:56 -04:00
<!-- Odometry -->
2016-03-11 16:57:49 -05:00
<node if= "$(arg visual_odometry)" pkg= "rtabmap_ros" type= "stereo_odometry" name= "stereo_odometry" output= "screen" args= "$(arg rtabmap_args)" launch-prefix= "$(arg launch_prefix)" >
2015-07-20 16:13:56 -04:00
<remap from= "left/image_rect" to= "$(arg left_image_topic)" />
<remap from= "right/image_rect" to= "$(arg right_image_topic)" />
<remap from= "left/camera_info" to= "$(arg left_camera_info_topic)" />
<remap from= "right/camera_info" to= "$(arg right_camera_info_topic)" />
2015-08-07 13:00:32 -04:00
<param name= "frame_id" type= "string" value= "$(arg frame_id)" />
2015-08-14 16:21:40 -04:00
<param name= "wait_for_transform_duration" type= "double" value= "$(arg wait_for_transform)" />
2015-08-07 13:00:32 -04:00
<param name= "approx_sync" type= "bool" value= "$(arg approximate_sync)" />
2015-07-20 16:13:56 -04:00
2016-03-11 16:57:49 -05:00
<param name= "Odom/FillInfoData" type= "string" value= "true" />
2015-07-20 16:13:56 -04:00
</node>
<!-- Visual SLAM (robot side) -->
<!-- args: "delete_db_on_start" and "udebug" -->
2016-03-11 16:57:49 -05:00
<node name= "rtabmap" pkg= "rtabmap_ros" type= "rtabmap" output= "screen" args= "$(arg rtabmap_args)" launch-prefix= "$(arg launch_prefix)" >
2016-03-13 18:05:27 -04:00
<param name= "subscribe_depth" type= "bool" value= "false" />
<param name= "subscribe_stereo" type= "bool" value= "true" />
<param name= "subscribe_scan" type= "bool" value= "$(arg subscribe_scan)" />
<param name= "subscribe_scan_cloud" type= "bool" value= "$(arg subscribe_scan_cloud)" />
<param name= "frame_id" type= "string" value= "$(arg frame_id)" />
2015-08-14 16:21:40 -04:00
<param name= "wait_for_transform_duration" type= "double" value= "$(arg wait_for_transform)" />
2016-03-13 18:05:27 -04:00
<param name= "database_path" type= "string" value= "$(arg database_path)" />
<param name= "stereo_approx_sync" type= "bool" value= "$(arg approximate_sync)" />
2015-07-20 16:13:56 -04:00
<remap from= "left/image_rect" to= "$(arg left_image_topic)" />
<remap from= "right/image_rect" to= "$(arg right_image_topic)" />
<remap from= "left/camera_info" to= "$(arg left_camera_info_topic)" />
<remap from= "right/camera_info" to= "$(arg right_camera_info_topic)" />
<remap from= "scan" to= "$(arg scan_topic)" />
2016-03-13 18:05:27 -04:00
<remap from= "scan_cloud" to= "$(arg scan_cloud_topic)" />
2015-08-07 14:04:45 -04:00
<remap unless= "$(arg visual_odometry)" from= "odom" to= "$(arg odom_topic)" />
2015-07-20 16:13:56 -04:00
2016-03-11 16:57:49 -05:00
<param name= "Rtabmap/TimeThr" type= "string" value= "$(arg time_threshold)" />
<param name= "RGBD/OptimizeFromGraphEnd" type= "string" value= "$(arg optimize_from_last_node)" />
<param name= "Mem/SaveDepth16Format" type= "string" value= "$(arg convert_depth_to_mm)" />
2015-07-20 16:13:56 -04:00
2016-03-13 18:05:27 -04:00
<!-- localization mode -->
<param if= "$(arg localization)" name= "Mem/IncrementalMemory" type= "string" value= "false" />
<param unless= "$(arg localization)" name= "Mem/IncrementalMemory" type= "string" value= "true" />
<param name= "Mem/InitWMWithAllNodes" type= "string" value= "$(arg localization)" />
2015-07-20 16:13:56 -04:00
<!-- when 2D scan is set -->
2016-03-13 18:05:27 -04:00
<param if= "$(arg subscribe_scan)" name= "Optimizer/Slam2D" type= "string" value= "true" />
<param if= "$(arg subscribe_scan)" name= "Icp/CorrespondenceRatio" type= "string" value= "0.25" />
<param if= "$(arg subscribe_scan)" name= "Reg/Strategy" type= "string" value= "1" />
<param if= "$(arg subscribe_scan)" name= "Reg/Force3DoF" type= "string" value= "true" />
<!-- when 3D scan is set -->
<param if= "$(arg subscribe_scan_cloud)" name= "Reg/Strategy" type= "string" value= "1" />
2015-07-20 16:13:56 -04:00
</node>
<!-- Visualisation RTAB-Map -->
2016-03-11 16:57:49 -05:00
<node if= "$(arg rtabmapviz)" pkg= "rtabmap_ros" type= "rtabmapviz" name= "rtabmapviz" args= "$(arg rtabmapviz_cfg)" output= "screen" launch-prefix= "$(arg launch_prefix)" >
<param name= "subscribe_depth" type= "bool" value= "false" />
<param name= "subscribe_stereo" type= "bool" value= "true" />
2016-03-13 18:05:27 -04:00
<param name= "subscribe_scan" type= "bool" value= "$(arg subscribe_scan)" />
<param name= "subscribe_scan_cloud" type= "bool" value= "$(arg subscribe_scan_cloud)" />
2016-03-11 16:57:49 -05:00
<param name= "subscribe_odom_info" type= "bool" value= "$(arg visual_odometry)" />
<param name= "frame_id" type= "string" value= "$(arg frame_id)" />
2015-08-14 16:21:40 -04:00
<param name= "wait_for_transform_duration" type= "double" value= "$(arg wait_for_transform)" />
2015-07-20 16:13:56 -04:00
<remap from= "left/image_rect" to= "$(arg left_image_topic)" />
<remap from= "right/image_rect" to= "$(arg right_image_topic)" />
<remap from= "left/camera_info" to= "$(arg left_camera_info_topic)" />
<remap from= "right/camera_info" to= "$(arg right_camera_info_topic)" />
<remap from= "scan" to= "$(arg scan_topic)" />
2016-03-13 18:05:27 -04:00
<remap from= "scan_cloud" to= "$(arg scan_cloud_topic)" />
2015-08-07 14:04:45 -04:00
<remap unless= "$(arg visual_odometry)" from= "odom" to= "$(arg odom_topic)" />
2015-07-20 16:13:56 -04:00
</node>
</group>
<!-- Visualization RVIZ -->
2015-08-07 13:00:32 -04:00
<node if= "$(arg rviz)" pkg= "rviz" type= "rviz" name= "rviz" args= "$(arg rviz_cfg)" />
2015-07-20 16:13:56 -04:00
<node if= "$(arg rviz)" pkg= "nodelet" type= "nodelet" name= "points_xyzrgb" args= "standalone rtabmap_ros/point_cloud_xyzrgb" >
<remap from= "left/image" to= "$(arg left_image_topic)" />
<remap from= "right/image" to= "$(arg right_image_topic)" />
<remap from= "left/camera_info" to= "$(arg left_camera_info_topic)" />
<remap from= "right/camera_info" to= "$(arg right_camera_info_topic)" />
<remap from= "cloud" to= "voxel_cloud" />
2015-08-07 13:00:32 -04:00
<param name= "decimation" type= "double" value= "2" />
<param name= "voxel_size" type= "double" value= "0.02" />
<param name= "approx_sync" type= "bool" value= "$(arg approximate_sync)" />
2015-07-20 16:13:56 -04:00
</node>
</launch>