2013-12-11 00:12:44 +00:00
<launch>
2015-08-07 14:04:45 -04:00
<!-- Your RGB-D sensor should be already started with "depth_registration:=true".
2015-07-19 19:57:54 -04:00
Examples:
$ roslaunch freenect_launch freenect.launch depth_registration:=true
$ roslaunch openni2_launch openni2.launch depth_registration:=true -->
2015-08-07 14:04:45 -04:00
<!-- Choose visualization -->
2015-07-19 19:57:54 -04:00
<arg name= "rviz" default= "false" />
<arg name= "rtabmapviz" default= "true" />
2015-05-03 18:23:56 -04:00
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-19 19:57:54 -04:00
<arg name= "frame_id" default= "camera_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 -->
2015-08-07 10:12:34 -04:00
<arg name= "launch_prefix" default= "" /> <!-- for debugging purpose, it fills launch-prefix tag of the nodes -->
2015-07-17 17:00:40 -04:00
2015-07-19 19:57:54 -04:00
<arg name= "rgb_topic" default= "/camera/rgb/image_rect_color" />
<arg name= "depth_registered_topic" default= "/camera/depth_registered/image_raw" />
<arg name= "camera_info_topic" default= "/camera/rgb/camera_info" />
2015-09-30 18:59:22 -04:00
<arg name= "compressed" default= "false" />
2015-10-09 12:28:20 -04:00
<arg name= "convert_depth_to_mm" default= "true" />
2015-07-17 17:00:40 -04:00
2015-07-19 19:57:54 -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" />
2015-08-07 14:04:45 -04:00
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-19 19:57:54 -04:00
<arg name= "namespace" default= "rtabmap" />
2015-08-14 15:01:51 -04:00
<arg name= "wait_for_transform" default= "0.1" />
2015-01-23 17:22:39 -05:00
2015-07-19 19:57:54 -04:00
<!-- Nodes -->
2015-07-17 17:00:40 -04:00
<group ns= "$(arg namespace)" >
2013-12-11 00:12:44 +00:00
2016-03-13 18:05:27 -04:00
<node if= "$(arg compressed)" name= "republish_rgb" type= "republish" pkg= "image_transport" args= "compressed in:=$(arg rgb_topic) raw out:=$(arg rgb_topic)" />
2015-09-30 18:59:22 -04:00
<node if= "$(arg compressed)" name= "republish_depth" type= "republish" pkg= "image_transport" args= "compressedDepth in:=$(arg depth_registered_topic) raw out:=$(arg depth_registered_topic)" />
2014-06-11 19:05:08 +00:00
<!-- Odometry -->
2016-03-11 16:57:49 -05:00
<node if= "$(arg visual_odometry)" pkg= "rtabmap_ros" type= "rgbd_odometry" name= "rgbd_odometry" output= "screen" args= "$(arg rtabmap_args)" launch-prefix= "$(arg launch_prefix)" >
2015-07-17 17:00:40 -04:00
<remap from= "rgb/image" to= "$(arg rgb_topic)" />
<remap from= "depth/image" to= "$(arg depth_registered_topic)" />
<remap from= "rgb/camera_info" to= "$(arg camera_info_topic)" />
2014-10-08 00:43:05 +00:00
2016-03-13 18:05:27 -04:00
<param name= "frame_id" type= "string" value= "$(arg frame_id)" />
<param name= "wait_for_transform_duration" type= "double" value= "$(arg wait_for_transform)" />
2015-07-20 16:13:56 -04:00
2016-03-13 18:05:27 -04:00
<param name= "Odom/FillInfoData" type= "string" value= "true" />
2014-06-11 19:05:08 +00:00
</node>
2013-12-11 00:12:44 +00:00
<!-- Visual SLAM (robot side) -->
2015-08-07 10:12:34 -04: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= "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)" />
<param name= "wait_for_transform_duration" type= "double" value= "$(arg wait_for_transform)" />
<param name= "database_path" type= "string" value= "$(arg database_path)" />
2013-12-11 00:12:44 +00:00
2015-07-17 17:00:40 -04:00
<remap from= "rgb/image" to= "$(arg rgb_topic)" />
<remap from= "depth/image" to= "$(arg depth_registered_topic)" />
<remap from= "rgb/camera_info" to= "$(arg camera_info_topic)" />
2015-07-19 19:57:54 -04:00
<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-19 19:57:54 -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-19 19:57:54 -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-19 19:57:54 -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" />
2013-12-11 00:12:44 +00:00
</node>
2015-01-23 17:22:39 -05:00
<!-- Visualisation RTAB-Map -->
2015-08-07 13:00:32 -04:00
<node if= "$(arg rtabmapviz)" pkg= "rtabmap_ros" type= "rtabmapviz" name= "rtabmapviz" args= "$(arg rtabmapviz_cfg)" output= "screen" launch-prefix= "$(arg launch_prefix)" >
2016-03-11 16:57:49 -05:00
<param name= "subscribe_depth" 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)" />
2013-12-11 00:12:44 +00:00
2015-07-17 17:00:40 -04:00
<remap from= "rgb/image" to= "$(arg rgb_topic)" />
<remap from= "depth/image" to= "$(arg depth_registered_topic)" />
<remap from= "rgb/camera_info" to= "$(arg camera_info_topic)" />
2015-07-19 19:57:54 -04:00
<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)" />
2013-12-11 00:12:44 +00:00
</node>
</group>
2015-01-23 17:22:39 -05:00
<!-- 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-01-23 17:22:39 -05:00
<!-- sync cloud with odometry and voxelize the point cloud (for fast visualization in rviz) -->
<node if= "$(arg rviz)" pkg= "nodelet" type= "nodelet" name= "standalone_nodelet" args= "manager" output= "screen" />
<node if= "$(arg rviz)" pkg= "nodelet" type= "nodelet" name= "data_odom_sync" args= "load rtabmap_ros/data_odom_sync standalone_nodelet" >
2015-07-17 17:00:40 -04:00
<remap from= "rgb/image_in" to= "$(arg rgb_topic)" />
<remap from= "depth/image_in" to= "$(arg depth_registered_topic)" />
<remap from= "rgb/camera_info_in" to= "$(arg camera_info_topic)" />
2015-08-07 14:04:45 -04:00
<remap if= "$(arg visual_odometry)" from= "odom_in" to= "rtabmap/odom" />
<remap unless= "$(arg visual_odometry)" from= "odom_in" to= "$(arg odom_topic)" />
2015-01-23 17:22:39 -05:00
<remap from= "rgb/image_out" to= "data_odom_sync/image" />
<remap from= "depth/image_out" to= "data_odom_sync/depth" />
<remap from= "rgb/camera_info_out" to= "data_odom_sync/camera_info" />
<remap from= "odom_out" to= "odom_sync" />
</node>
<node if= "$(arg rviz)" pkg= "nodelet" type= "nodelet" name= "points_xyzrgb" args= "load rtabmap_ros/point_cloud_xyzrgb standalone_nodelet" >
<remap from= "rgb/image" to= "data_odom_sync/image" />
<remap from= "depth/image" to= "data_odom_sync/depth" />
<remap from= "rgb/camera_info" to= "data_odom_sync/camera_info" />
<remap from= "cloud" to= "voxel_cloud" />
2015-07-19 19:57:54 -04:00
<param name= "decimation" type= "double" value= "2" />
<param name= "voxel_size" type= "double" value= "0.02" />
2015-01-23 17:22:39 -05:00
</node>
2013-12-11 00:12:44 +00:00
</launch>