Package Summary
RTAB-Map's SLAM package.
- Maintainer status: maintained
- Maintainer: Mathieu Labbe <matlabbe AT gmail DOT com>
- Author: Mathieu Labbe
- License: BSD
- Bug / feature tracker: https://github.com/introlab/rtabmap_ros/issues
- Source: git https://github.com/introlab/rtabmap_ros.git (branch: noetic-devel)
Contents
Nodes
rtabmap
This is the main node of this package. It is a wrapper of the RTAB-Map Core library. This is where the graph of the map is incrementally built and optimized when a loop closure is detected. The online output of the node is the local graph with the latest added data to the map. The default location of the RTAB-Map database is "~/.ros/rtabmap.db" and the workspace is also set to "~/.ros". To get a 3D point cloud or a 2D occupancy grid of the environment, subscribe to cloud_map or grid_map topics.
- There are two set of parameters: ROS and RTAB-Map's parameters. The ROS parameters are for connection stuff to interface the RTAB-Map library with ROS. The RTAB-Map's parameters are those from the RTAB-Map library.
One way to know RTAB-Map's parameters is to look at this file : Parameters.h. There is a description for each parameter. Here two examples (use string type for all RTAB-Map's parameters) by either using param member or by passing as arguments:
<launch> <node name="rtabmap" pkg="rtabmap_slam" type="rtabmap" args="--Grid/RangeMax 5"> <param name="Optimizer/Iterations" type="int" value="50"/> </node> </launch>
- Another way to show available parameters from the terminal is to call the node with "--params" argument:
$ rosrun rtabmap_slam rtabmap --params or $ rtabmap --params
By default, rtabmap is in mapping mode. To set in localization mode with a previously created map, you should set the memory not incremental (make sure that arguments don't contain "--delete_db_on_start" too!):
<launch> <node name="rtabmap" pkg="rtabmap_slam" type="rtabmap" args=""> <!-- LOCALIZATION MODE --> <param name="Mem/IncrementalMemory" type="string" value="false"/> </node> </launch>
Arguments
"--delete_db_on_start" or "-d": Delete the database before starting, otherwise the previous mapping session is loaded.
"--udebug": Show RTAB-Map's debug/info/warning/error logs.
"--uinfo": Show RTAB-Map's info/warning/error logs.
"--params": Show RTAB-Map's parameters related to this node and exit.
Subscribed Topics
odom (nav_msgs/Odometry)- Odometry stream. Required if parameters subscribe_depth or subscribe_stereo are true and odom_frame_id is not set.
- RGB/Mono image. Should be rectified when subscribe_depth is true. Not required if parameter subscribe_stereo is true (use left/image_rect instead).
- RGB camera metadata. Not required if parameter subscribe_stereo is true (use left/camera_info instead).
- Registered depth image. Required if parameter subscribe_depth is true.
- Laser scan stream. Required if parameter subscribe_scan is true.
- Laser scan point cloud stream. Required if parameter subscribe_scan_cloud is true.
- Left RGB/Mono rectified image. Required if parameter subscribe_stereo is true.
- Left camera metadata. Required if parameter subscribe_stereo is true.
- Right Mono rectified image. Required if parameter subscribe_stereo is true.
- Right camera metadata. Required if parameter subscribe_stereo is true.
- Planning Plan a path to reach this goal using the current online map. The goal should be close enough to the map's graph to be accepted (see RTAB-Map's parameter RGBD/LocalRadius). Note that only nodes in Working Memory are used, for exploration it may be ok, but it would be better to use service set_goal if you are coming back in a previously mapped area. See Planning published topics for corresponding generated outputs.
- RGB-D synchronized image, only when subscribe_rgbd is true and rgbd_cameras=1
- RGB-D synchronized image, only when subscribe_rgbd is true and rgbd_cameras>=2
- RGB-D/Stereo synchronized images (published by a rgbdx_sync node), only when subscribe_rgbd is true and rgbd_cameras=0.
- Can be used to add gravity constraints in the graph. The whole map will then be aligned with gravity. The quaternion should be already computed (see imu_filter_madgwick to compute it).
- Can be used to add GPS constraints in the graph. This could eventually be used to export poses in GPS format. With Optimizer/PriorsIgnored parameter set to false, the graph can be also optimized using the GPS values. See also this page on how GPS can be used to limit loop closure detection radius.
- Can be used to add global prior constraints in the graph. With Optimizer/PriorsIgnored parameter set to false, the graph can be optimized using the prior values.
- Can be used to add landmark constraints in the graph. Landmarks are used in graph optimization and also for loop closure detection. See also apriltag_ros repository.
- Can be used to add landmark constraints in the graph. Landmarks are used in graph optimization and also for loop closure detection. See also fiducials repository.
Published Topics
info (rtabmap_msgs/Info)- RTAB-Map's info.
- RTAB-Map's graph and latest node data.
- RTAB-Map's graph only.
- Mapping Occupancy grid generated with laser scans. Use parameters in Mapping group below and RTAB-Map's parameters starting with Grid/ prefix. Do rtabmap --params | grep Grid/ to see all of them.
- Mapping DEPRECATED: use /grid_map topic instead with Grid/FromDepth=true.
- Mapping 3D point cloud generated from the assembled local grids. Use parameters with prefixes map_ and cloud_ below.
- Mapping 3D point cloud of obstacles generated from the assembled local grids. Use parameters with prefixes map_ and cloud_ below.
- Mapping 3D point cloud of ground generated from the assembled local grids. Use parameters with prefixes map_ and cloud_ below.
- Mapping 3D point cloud generated with the 2D scans or 3D scans. Use parameters with prefixes map_ and scan_ below.
- Convenient way to show graph's labels in RVIZ.
- Planning Poses of the planned global path. Published only once for each path planned.
- Planning Upcoming local poses corresponding to those of the global path. Published on every map update.
- Planning Status message if the goal is successfully reached or not.
- Planning Current metric goal sent from the rtabmap's topological planner. For example, this can be connected to move_base_simple/goal topic of move_base.
- Get an OctoMap. Available only if rtabmap_slam is built with octomap.
- Get an OctoMap. Available only if rtabmap_slam is built with octomap.
- A point cloud of the occupied space (obstacles and ground) of the OctoMap. Available only if rtabmap_slam is built with octomap.
- A point cloud of the obstacles of the OctoMap. Available only if rtabmap_slam is built with octomap.
- A point cloud of the ground of the OctoMap. Available only if rtabmap_slam is built with octomap.
- A point cloud of empty space of the OctoMap. Available only if rtabmap_slam is built with octomap.
- The projection of the OctoMap into a 2D occupancy grid map. Available only if rtabmap_slam is built with octomap.
Services
get_map (nav_msgs/GetMap)- Call this service to get the standard 2D occupancy grid
- Call this service to get the map data
- Call this service to publish the map data
- Get current labels of the graph.
- The node will update with current parameters of the rosparam server
- Delete the map
- Pause mapping
- Resume mapping
- The node will begin a new map
- Backup the database to "database_path.back" (default ~/.ros/rtabmap.db.back)
- Set localization mode
- Set mapping mode
- Set a label to latest node or a specified node.
- Planning Set a topological goal (a node id or a node label in the graph). Plan a path to reach this goal using the whole map contained in memory (including nodes in Long-Term Memory). See Planning published topics for corresponding generated outputs.
- Get an OctoMap. Available only if rtabmap_slam is built with octomap.
- Get an OctoMap. Available only if rtabmap_slam is built with octomap.
Parameters
~subscribe_depth (bool, default: "true")- Subscribe to depth image
- Subscribe to laser scan
- Subscribe to laser scan point cloud
- Subscribe to stereo images
- Subsribe to rgbd_image topic.
- The frame attached to the mobile base.
- The frame attached to the map.
- The frame attached to odometry. If empty, rtabmap will subscribe to odom topic to get odometry. If set, odometry is got from tf (in this case, the covariance value is fixed by odom_tf_angular_variance and odom_tf_linear_variance).
- When odom_frame_id is used, the first 3 values of the diagonal of the 6x6 covariance matrix are set to this value.
- When odom_frame_id is used, the last 3 values of the diagonal of the 6x6 covariance matrix are set to this value.
- Size of message queue for each synchronized topic.
- Publish TF from /map to /odom.
- Rate at which the TF from /map to /odom is published (20 Hz).
- Prefix to add to generated tf.
- Wait (maximum wait_for_transform_duration sec) for transform when a tf transform is not still available.
- Wait duration for wait_for_transform.
- Path of a config files containing RTAB-Map's parameters. Parameters set in the launch file overwrite those in the config file.
- Path of the RTAB-Map's database.
- Generate laser scans from depth images (using the middle horizontal line of the depth image). Not generated if subscribe_scan or subscribe_scan_cloud are true.
- Maximum depth of the laser scans generated.
- Use approximate time synchronization of input messages. If false, note that the odometry input must have also exactly the same timestamps than the input images.
- Number of RGB-D cameras to use (when subscribe_rgbd is true). Well for now, a maximum of 4 cameras can be synchronized at the same time. If > 1, the rgbd_image topics should contain the camera index starting with 0. For example, if we have 2 cameras, you should set rgbd_image0 and rgbd_image1 topics. If you set to 0, the input rgbd_images topic is used instead.
- Planning Use actionlib to send the metric goals to move_base. The advantage over just connecting goal_out to move_base_simple/goal is that rtabmap can have a feedback if the goal is reached or if move_base has failed. See move_base Action API for more info.
- Adjust image and scan poses relatively to odometry pose for each node added to graph. For example, if an image received at t=1s has been synchronized with a scan at t=1.1s (and our reference stamp is the scan) and the robot is moving forward at 1 m/s, then we will ask TF to know the motion between t=1s and t=1.1s (which would be 0.1 m) for the camera to adjust its local transform (-10 cm) relative to scan frame at scan stamp. This also applies to multi-camera synchronization.
- Generate depth image from scan_cloud projection into RGB camera, taking into account displacement of the RGB camera accordingly to odometry and lidar frames. It works like pointcloud_to_depthimage node, but at slam frequency.
- Scale down image size of the camera info received (creating smaller depth image).
- Fill holes of empty pixels up to this size. Values are interpolated from neighbor depth values. 0 means disabled.
- Maximum depth error (m) to interpolate.
- Number of iterations to fill holes.
- Mapping Filter nodes before creating the maps. Only load data for one node in the filter radius (the latest data is used) up to filter angle (map_filter_angle). Set to 0.0 to disable node filtering. Used for all published maps.
- Mapping Angle used when filtering nodes before creating the maps. See also map_filter_radius. Used for all published maps.
- Mapping If there is no subscription to any map cloud_map, grid_map or proj_map, clear the corresponding data.
- Mapping If true, the last message published on the map topics will be saved and sent to new subscribers when they connect.
- Mapping Always update the occupancy grid map even if the graph has not been updated (e.g., by default when the robot is not moving, the graph is not growing). For example, if the environment is dynamic, we may want to update the map even when to robot is not moving. Another approach would be to force rtabmap to always update the graph (by setting RGBD/LinearUpdate to 0), which can be not efficient over time as the map will grow even if the robot doesn't move.
- Mapping Do ray tracing to fill unknown space for invalid 2D scan's rays (assuming invalid rays to be infinite). Used only when map_always_update is also true.
- Mapping Do a final voxel filtering after all clouds are assembled with a voxel size equals to Grid/CellSize. Used for cloud_map published topic.
- Mapping When appending a new cloud to cloud_map, filter points that have less neighbors than cloud_subtract_filtering_min_neighbors in the radius Grid/CellSize. This will helps to reconstruct the whole map's cloud faster when a loop closure happens. Used for cloud_map published topic.
- Mapping See cloud_subtract_filtering parameter's description.
Required tf Transforms
base_link → <the frame attached to sensors of incoming data>- usually a fixed value, broadcast periodically by a robot_state_publisher, or a tf static_transform_publisher.
- usually provided by the odometry system (e.g., the driver for the mobile base).
Provided tf Transforms
map → odom- the current odometry correction.