2015-10-28 20:05:04 -04:00
|
|
|
|
|
|
|
|
<launch>
|
|
|
|
|
<!-- Convenience launch file to launch odometry, rtabmap and rtabmapviz nodes at once -->
|
|
|
|
|
|
2016-07-06 20:08:23 -04:00
|
|
|
<!-- For stereo:=false
|
2015-10-28 20:05:04 -04:00
|
|
|
Your RGB-D sensor should be already started with "depth_registration:=true".
|
|
|
|
|
Examples:
|
|
|
|
|
$ roslaunch freenect_launch freenect.launch depth_registration:=true
|
|
|
|
|
$ roslaunch openni2_launch openni2.launch depth_registration:=true -->
|
|
|
|
|
|
|
|
|
|
<!-- For stereo:=true
|
|
|
|
|
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 -->
|
|
|
|
|
|
|
|
|
|
<!-- Choose between RGB-D and stereo -->
|
|
|
|
|
<arg name="stereo" default="false"/>
|
|
|
|
|
|
|
|
|
|
<!-- Choose visualization -->
|
|
|
|
|
<arg name="rtabmapviz" default="true" />
|
|
|
|
|
<arg name="rviz" default="false" />
|
|
|
|
|
|
2016-06-02 14:21:07 -04:00
|
|
|
<!-- Localization-only mode -->
|
|
|
|
|
<arg name="localization" default="false"/>
|
|
|
|
|
|
2015-10-28 20:05:04 -04:00
|
|
|
<!-- Corresponding config files -->
|
2016-03-17 14:41:35 -04:00
|
|
|
<arg name="cfg" default="" /> <!-- To change RTAB-Map's parameters, set the path of config file (*.ini) generated by the standalone app -->
|
2016-03-17 16:15:49 -04:00
|
|
|
<arg name="gui_cfg" default="~/.ros/rtabmap_gui.ini" />
|
2015-10-28 20:05:04 -04:00
|
|
|
<arg name="rviz_cfg" default="-d $(find rtabmap_ros)/launch/config/rgbd.rviz" />
|
|
|
|
|
|
|
|
|
|
<arg name="frame_id" default="camera_link"/> <!-- Fixed frame id, you may set "base_link" or "base_footprint" if they are published -->
|
|
|
|
|
<arg name="namespace" default="rtabmap"/>
|
|
|
|
|
<arg name="database_path" default="~/.ros/rtabmap.db"/>
|
|
|
|
|
<arg name="queue_size" default="10"/>
|
2016-03-17 17:14:43 -04:00
|
|
|
<arg name="wait_for_transform" default="0.2"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<arg name="rtabmap_args" default=""/> <!-- delete_db_on_start, udebug -->
|
|
|
|
|
<arg name="launch_prefix" default=""/> <!-- for debugging purpose, it fills launch-prefix tag of the nodes -->
|
2016-09-28 12:08:11 -04:00
|
|
|
|
|
|
|
|
<!-- if timestamps of the input topics are synchronized using approximate or exact time policy-->
|
|
|
|
|
<arg if="$(arg stereo)" name="approx_sync" default="false"/>
|
|
|
|
|
<arg unless="$(arg stereo)" name="approx_sync" default="true"/>
|
2016-06-30 12:49:20 -04:00
|
|
|
|
2015-10-28 20:05:04 -04:00
|
|
|
<!-- RGB-D related topics -->
|
|
|
|
|
<arg name="rgb_topic" default="/camera/rgb/image_rect_color" />
|
|
|
|
|
<arg name="depth_topic" default="/camera/depth_registered/image_raw" />
|
|
|
|
|
<arg name="camera_info_topic" default="/camera/rgb/camera_info" />
|
|
|
|
|
|
|
|
|
|
<!-- stereo related topics -->
|
|
|
|
|
<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" />
|
|
|
|
|
|
|
|
|
|
<arg name="compressed" default="false"/> <!-- If you want to subscribe to compressed image topics -->
|
2016-01-27 10:46:20 -05:00
|
|
|
<arg name="rgb_image_transport" default="compressed"/> <!-- Common types: compressed, theora (see "rosrun image_transport list_transports") -->
|
2016-10-02 17:32:32 -04:00
|
|
|
<arg name="depth_image_transport" default="compressedDepth"/> <!-- Common types: compressed, theora (see "rosrun image_transport list_transports") -->
|
2015-10-28 20:05:04 -04:00
|
|
|
|
|
|
|
|
<arg name="subscribe_scan" default="false"/>
|
|
|
|
|
<arg name="scan_topic" default="/scan"/>
|
2016-03-13 18:05:27 -04:00
|
|
|
|
|
|
|
|
<arg name="subscribe_scan_cloud" default="false"/>
|
|
|
|
|
<arg name="scan_cloud_topic" default="/scan_cloud"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
|
|
|
|
|
<arg name="visual_odometry" default="true"/> <!-- Launch rtabmap visual odometry node -->
|
|
|
|
|
<arg name="odom_topic" default="/odom"/> <!-- Odometry topic used if visual_odometry is false -->
|
2016-08-05 16:18:47 -04:00
|
|
|
<arg name="odom_frame_id" default=""/> <!-- If set, TF is used to get odometry instead of the topic -->
|
2016-03-17 14:41:35 -04:00
|
|
|
<arg name="odom_args" default="$(arg rtabmap_args)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
|
2016-01-27 10:46:20 -05:00
|
|
|
<!-- These arguments should not be modified directly, see referred topics without "_relay" suffix above -->
|
|
|
|
|
<arg if="$(arg compressed)" name="rgb_topic_relay" default="$(arg rgb_topic)_relay"/>
|
|
|
|
|
<arg unless="$(arg compressed)" name="rgb_topic_relay" default="$(arg rgb_topic)"/>
|
|
|
|
|
<arg if="$(arg compressed)" name="depth_topic_relay" default="$(arg depth_topic)_relay"/>
|
|
|
|
|
<arg unless="$(arg compressed)" name="depth_topic_relay" default="$(arg depth_topic)"/>
|
|
|
|
|
<arg if="$(arg compressed)" name="left_image_topic_relay" default="$(arg left_image_topic)_relay"/>
|
|
|
|
|
<arg unless="$(arg compressed)" name="left_image_topic_relay" default="$(arg left_image_topic)"/>
|
|
|
|
|
<arg if="$(arg compressed)" name="right_image_topic_relay" default="$(arg right_image_topic)_relay"/>
|
|
|
|
|
<arg unless="$(arg compressed)" name="right_image_topic_relay" default="$(arg right_image_topic)"/>
|
|
|
|
|
|
2015-10-28 20:05:04 -04:00
|
|
|
<!-- Nodes -->
|
|
|
|
|
<group ns="$(arg namespace)">
|
|
|
|
|
|
|
|
|
|
<!-- RGB-D Odometry -->
|
2016-07-06 20:08:23 -04:00
|
|
|
<group unless="$(arg stereo)">
|
2016-01-27 10:46:20 -05:00
|
|
|
<node if="$(arg compressed)" name="republish_rgb" type="republish" pkg="image_transport" args="$(arg rgb_image_transport) in:=$(arg rgb_topic) raw out:=$(arg rgb_topic_relay)" />
|
2016-10-02 17:32:32 -04:00
|
|
|
<node if="$(arg compressed)" name="republish_depth" type="republish" pkg="image_transport" args="$(arg depth_image_transport) in:=$(arg depth_topic) raw out:=$(arg depth_topic_relay)" />
|
2015-10-28 20:05:04 -04:00
|
|
|
|
2016-03-17 14:41:35 -04:00
|
|
|
<node if="$(arg visual_odometry)" pkg="rtabmap_ros" type="rgbd_odometry" name="rgbd_odometry" output="screen" args="$(arg odom_args)" launch-prefix="$(arg launch_prefix)">
|
2016-01-27 10:46:20 -05:00
|
|
|
<remap from="rgb/image" to="$(arg rgb_topic_relay)"/>
|
|
|
|
|
<remap from="depth/image" to="$(arg depth_topic_relay)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
|
|
|
|
|
|
|
|
|
|
<param name="frame_id" type="string" value="$(arg frame_id)"/>
|
|
|
|
|
<param name="wait_for_transform_duration" type="double" value="$(arg wait_for_transform)"/>
|
2016-06-30 12:49:20 -04:00
|
|
|
<param name="approx_sync" type="bool" value="$(arg approx_sync)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<param name="config_path" type="string" value="$(arg cfg)"/>
|
|
|
|
|
<param name="queue_size" type="int" value="$(arg queue_size)"/>
|
|
|
|
|
</node>
|
|
|
|
|
</group>
|
|
|
|
|
|
|
|
|
|
<!-- Stereo Odometry -->
|
|
|
|
|
<group if="$(arg stereo)">
|
2016-01-27 10:46:20 -05: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_relay)" />
|
|
|
|
|
<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_relay)" />
|
2015-10-28 20:05:04 -04:00
|
|
|
|
2016-07-17 15:39:08 -04:00
|
|
|
<node if="$(arg visual_odometry)" pkg="rtabmap_ros" type="stereo_odometry" name="stereo_odometry" output="screen" args="$(arg odom_args)" launch-prefix="$(arg launch_prefix)">
|
2016-01-27 10:46:20 -05:00
|
|
|
<remap from="left/image_rect" to="$(arg left_image_topic_relay)"/>
|
|
|
|
|
<remap from="right/image_rect" to="$(arg right_image_topic_relay)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<remap from="left/camera_info" to="$(arg left_camera_info_topic)"/>
|
|
|
|
|
<remap from="right/camera_info" to="$(arg right_camera_info_topic)"/>
|
|
|
|
|
|
|
|
|
|
<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="approx_sync" type="bool" value="$(arg approx_sync)"/>
|
|
|
|
|
<param name="config_path" type="string" value="$(arg cfg)"/>
|
|
|
|
|
<param name="queue_size" type="int" value="$(arg queue_size)"/>
|
|
|
|
|
</node>
|
|
|
|
|
</group>
|
|
|
|
|
|
|
|
|
|
<!-- Visual SLAM (robot side) -->
|
|
|
|
|
<!-- args: "delete_db_on_start" and "udebug" -->
|
2016-02-08 11:24:06 -05:00
|
|
|
<node name="rtabmap" pkg="rtabmap_ros" type="rtabmap" output="screen" args="$(arg rtabmap_args)" launch-prefix="$(arg launch_prefix)">
|
2016-07-06 20:08:23 -04:00
|
|
|
<param if="$(arg stereo)" name="subscribe_depth" type="bool" value="false"/>
|
|
|
|
|
<param unless="$(arg stereo)" name="subscribe_depth" type="bool" value="true"/>
|
2016-03-13 18:05:27 -04:00
|
|
|
<param name="subscribe_stereo" type="bool" value="$(arg stereo)"/>
|
|
|
|
|
<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)"/>
|
2016-08-05 16:18:47 -04:00
|
|
|
<param name="odom_frame_id" type="string" value="$(arg odom_frame_id)"/>
|
2015-10-28 20:05:04 -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)"/>
|
2016-06-30 12:49:20 -04:00
|
|
|
<param name="approx_sync" type="bool" value="$(arg approx_sync)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<param name="config_path" type="string" value="$(arg cfg)"/>
|
2016-03-13 18:05:27 -04:00
|
|
|
<param name="queue_size" type="int" value="$(arg queue_size)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
|
2016-01-27 10:46:20 -05:00
|
|
|
<remap from="rgb/image" to="$(arg rgb_topic_relay)"/>
|
|
|
|
|
<remap from="depth/image" to="$(arg depth_topic_relay)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
|
|
|
|
|
|
2016-01-27 10:46:20 -05:00
|
|
|
<remap from="left/image_rect" to="$(arg left_image_topic_relay)"/>
|
|
|
|
|
<remap from="right/image_rect" to="$(arg right_image_topic_relay)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<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-10-28 20:05:04 -04:00
|
|
|
<remap unless="$(arg visual_odometry)" from="odom" to="$(arg odom_topic)"/>
|
2016-06-02 14:21:07 -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-10-28 20:05:04 -04:00
|
|
|
</node>
|
|
|
|
|
|
|
|
|
|
<!-- Visualisation RTAB-Map -->
|
2016-03-17 16:15:49 -04:00
|
|
|
<node if="$(arg rtabmapviz)" pkg="rtabmap_ros" type="rtabmapviz" name="rtabmapviz" args="-d $(arg gui_cfg)" output="screen" launch-prefix="$(arg launch_prefix)">
|
2016-07-06 20:08:23 -04:00
|
|
|
<param if="$(arg stereo)" name="subscribe_depth" type="bool" value="false"/>
|
|
|
|
|
<param unless="$(arg stereo)" name="subscribe_depth" type="bool" value="true"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<param name="subscribe_stereo" type="bool" value="$(arg stereo)"/>
|
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)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<param name="subscribe_odom_info" type="bool" value="$(arg visual_odometry)"/>
|
|
|
|
|
<param name="frame_id" type="string" value="$(arg frame_id)"/>
|
2016-08-05 16:18:47 -04:00
|
|
|
<param name="odom_frame_id" type="string" value="$(arg odom_frame_id)"/>
|
2016-03-13 18:05:27 -04:00
|
|
|
<param name="wait_for_transform_duration" type="double" value="$(arg wait_for_transform)"/>
|
|
|
|
|
<param name="queue_size" type="int" value="$(arg queue_size)"/>
|
2016-09-28 12:08:11 -04:00
|
|
|
<param name="approx_sync" type="bool" value="$(arg approx_sync)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
|
2016-01-27 10:46:20 -05:00
|
|
|
<remap from="rgb/image" to="$(arg rgb_topic_relay)"/>
|
|
|
|
|
<remap from="depth/image" to="$(arg depth_topic_relay)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
|
|
|
|
|
|
2016-01-27 10:46:20 -05:00
|
|
|
<remap from="left/image_rect" to="$(arg left_image_topic_relay)"/>
|
|
|
|
|
<remap from="right/image_rect" to="$(arg right_image_topic_relay)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<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-10-28 20:05:04 -04:00
|
|
|
<remap unless="$(arg visual_odometry)" from="odom" to="$(arg odom_topic)"/>
|
|
|
|
|
</node>
|
|
|
|
|
|
|
|
|
|
</group>
|
|
|
|
|
|
|
|
|
|
<!-- Visualization RVIZ -->
|
|
|
|
|
<node if="$(arg rviz)" pkg="rviz" type="rviz" name="rviz" args="$(arg rviz_cfg)"/>
|
|
|
|
|
<node if="$(arg rviz)" pkg="nodelet" type="nodelet" name="points_xyzrgb" args="standalone rtabmap_ros/point_cloud_xyzrgb">
|
2016-01-27 10:46:20 -05:00
|
|
|
<remap from="left/image" to="$(arg left_image_topic_relay)"/>
|
|
|
|
|
<remap from="right/image" to="$(arg right_image_topic_relay)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<remap from="left/camera_info" to="$(arg left_camera_info_topic)"/>
|
|
|
|
|
<remap from="right/camera_info" to="$(arg right_camera_info_topic)"/>
|
2016-01-27 10:46:20 -05:00
|
|
|
<remap from="rgb/image" to="$(arg rgb_topic_relay)"/>
|
|
|
|
|
<remap from="depth/image" to="$(arg depth_topic_relay)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
<remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
|
|
|
|
|
<remap from="cloud" to="voxel_cloud" />
|
|
|
|
|
|
|
|
|
|
<param name="decimation" type="double" value="2"/>
|
|
|
|
|
<param name="voxel_size" type="double" value="0.02"/>
|
2016-06-30 12:49:20 -04:00
|
|
|
<param name="approx_sync" type="bool" value="$(arg approx_sync)"/>
|
2015-10-28 20:05:04 -04:00
|
|
|
</node>
|
|
|
|
|
|
|
|
|
|
</launch>
|