Wiki

Page

User

electric: Cannot load information on name: rtabmap_ros, distro: electric, which means that it is not yet in our index. Please see this page for information on how to submit your repository to our index.

fuerte: Cannot load information on name: rtabmap_ros, distro: fuerte, which means that it is not yet in our index. Please see this page for information on how to submit your repository to our index.

groovy: Cannot load information on name: rtabmap_ros, distro: groovy, which means that it is not yet in our index. Please see this page for information on how to submit your repository to our index.

Overview

This package is a ROS wrapper of RTAB-Map (Real-Time Appearance-Based Mapping), a RGB-D SLAM approach based on a global loop closure detector with real-time constraints. This package can be used to generate a 3D point clouds of the environment and/or to create a 2D occupancy grid map for navigation. The tutorials and demos show some examples of mapping with RTAB-Map.

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, grid_map or proj_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 an example (use string type for all RTAB-Map's parameters):

Another way to show available parameters from the terminal is to call the node with "--params" argument:

$ rosrun rtabmap_ros 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!):

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.

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.

Wait (maximum wait_for_transform_duration sec) for transform when a tf transform is not still available.

~wait_for_transform_duration (double, default: 0.1)

Wait duration for wait_for_transform.

~config_path (string, default: "")

Path of a config files containing RTAB-Map's parameters. Parameters set in the launch file overwrite those in the config file.

~database_path (string, default: "~/.ros/rtabmap.db")

Path of the RTAB-Map's database.

~gen_scan (bool, default: "false")

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.

~gen_scan_max_depth (double, default: 4.0)

Maximum depth of the laser scans generated.

~approx_sync (bool, default: "false")

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.

~depth_cameras (int, default: 1)

Number of RGB-D cameras to use. Well for now, a maximum of 2 cameras can be synchronized at the same time. If > 1, the rgb, depth and camera_info topics should contain the camera index starting with 0. For example, if we have 2 cameras, you should set rgb0/image, rgb0/camera_info, depth0/image, rgb1/image, rgb1/camera_info and depth1/image topics. subscribe_depth should be true as well.

~use_action_for_goal (bool, default: "false")

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.

~map_filter_radius (double, default: 0.5)

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.

~map_filter_angle (double, default: 30.0)

Mapping Angle used when filtering nodes before creating the maps. See also map_filter_radius. Used for all published maps.

~map_cleanup (bool, default: "true")

Mapping If there is no subscription to any map cloud_map, grid_map or proj_map, clear the corresponding data.

~latch (bool, default: "true")

Mapping If true, the last message published on the map topics will be saved and sent to new subscribers when they connect.

~cloud_decimation (int, default: 4)

Mapping Image decimation before creating clouds added to cloud map. Set 1 to disable decimation. Used for cloud_map published topic.

~cloud_max_depth (double, default: 4.0)

Mapping Maximum depth of the clouds added to cloud map. Set 0.0 to maximum depth filtering. Used for cloud_map published topic.

~cloud_voxel_size (double, default: 0.05)

Mapping Voxel size used to filter each cloud added to cloud map. Set 0.0 to disable voxel filtering. Used for cloud_map published topic.

~ cloud_floor_culling_height (double, default: 0.0)

Mapping Filter the floor at the specified height (m). Used for cloud_map published topic.

~cloud_output_voxelized (bool, default: "false")

Mapping Do a final voxel filtering after all clouds are assembled. Used for cloud_map published topic.

~cloud_frustum_culling (bool, default: "false")

Mapping Filter the point cloud in the frustum defined by the last camera pose. Used for cloud_map published topic.

~cloud_noise_filtering_radius (double, default: 0)

Mapping Filter points that have less neighbors than cloud_noise_filtering_min_neighbors in the radius cloud_noise_filtering_radius (0=disabled). Used for cloud_map published topic.

~cloud_noise_filtering_min_neighbors (double, default: 5)

Mapping Filter points that have less neighbors than cloud_noise_filtering_min_neighbors in the radius cloud_noise_filtering_radius (0=disabled). Used for cloud_map published topic.

~scan_voxel_size (double, default: 0.05)

Mapping Voxel size used to filter each scan added to scan map. Set 0.0 to disable voxel filtering. Used for scan_map published topic.

~scan_output_voxelized (bool, default: "false")

Mapping Do a final voxel filtering after all scans are assembled. Used for scan_map published topic.

~grid_cell_size (double, default: 0.05)

Mapping Grid cell size (m). Used for grid_map and proj_map published topics.

~grid_size (double, default: 0)

Mapping Initial size of the map (m). If 0, the map will grow as new data are added. If set, the map will still grow when the initial size is reached. Used for grid_map and proj_map published topics.

~grid_eroded (bool, default: "false")

Mapping Filter obstacle cells surrounded by empty space. Used for grid_map and proj_map published topics.

~grid_unknown_space_filled (bool, default: "false")

Mapping Fill empty space. Used for grid_map published topic.

~proj_max_ground_angle (double, default: 45)

Mapping Maximum angle (degrees) between point's normal to ground's normal to label it as ground. Points with higher angle difference are considered as obstacles. Used for proj_map published topic.

~proj_min_cluster_size (int, default: 20)

Mapping Minimum cluster size to project the points. The distance between clusters is defined by 2*grid_cell_size. Used for proj_map published topic.

~proj_max_height (double, default: 2.0)

Mapping Maximum height of points used for projection. Used for proj_map published topic.

Wait (maximum 1 sec) for transform when a tf transform is not still available.

~queue_size (int, default: 10)

Size of message queue for each synchronized topic.

~depth_cameras (int, default: 1)

Number of RGB-D cameras to use. Well for now, a maximum of 2 cameras can be synchronized at the same time. If > 1, the rgb, depth and camera_info topics should contain the camera index starting with 0. For example, if we have 2 cameras, you should set rgb0/image, rgb0/camera_info, depth0/image, rgb1/image, rgb1/camera_info and depth1/image topics. subscribe_depth should be true as well.

Required tf Transforms

usually provided by the odometry system (e.g., the driver for the mobile base).

map → odom

the current odometry correction.

Visual Odometry

Common odometry stuff for rgbd_odometry and stereo_odometry nodes. These nodes wrap the odometry approach of RTAB-Map. The approach is visual based so enough visual features must be present in images to compute the odometry. When a transformation cannot be computed, a null transformation is sent to notify the receiver that odometry is not updated or lost.

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.

Parameters available for odometry can be shown from the terminal by using the "--params" argument:

Required tf Transforms

Provided tf Transforms

odom → base_link

the current estimate of the robot's pose within the odometry frame.

rgbd_odometry

This node wraps the RGBD odometry approach of RTAB-Map. Using RGBD images, odometry is computed using visual features extracted from the RGB images with their depth information from the depth images. Using the feature correspondences between the images, a RANSAC approach computes the transformation between the consecutive images.

Subscribed Topics

Parameters

~depth_cameras (int, default: 1)

Number of RGB-D cameras to use. Well for now, only a maximum of 2 cameras can be synchronized at the same time. If > 1, the rgb, depth and camera_info topics should contain the camera index starting with 0. For example, with 2 cameras, you should set rgb0/image, rgb0/camera_info, depth0/image, rgb1/image, rgb1/camera_info and depth1/image topics.

stereo_odometry

This node wraps the stereo odometry approach of RTAB-Map. Using stereo images, odometry is computed using visual features extracted from the left images with their depth information computed by finding the same features on the right images. Using the feature correspondences, a RANSAC approach computes the transformation between the consecutive left images.

Parameters

~approx_sync (bool, default: "false")

Use approximate time synchronization of stereo messages. If false, the left/right images and the left/right camera infos must have the same timestamps.

camera

A node for image acquisition from an USB camera (OpenCV is used). A special option for this node is that it can be configured to read images from a directory or a video file. Parameters can be changed with the dynamic_reconfigure GUI from ROS. For dynamic parameters, see Camera.cfg

Subscribed Topics

Services

map_optimizer

This node is for advanced usage only as it is preferred to use graph optimization already inside rtabmap node (which is the default). See related parameters in rtabmap:

$rosrun rtabmap_ros rtabmap --params | grep Optimize

This node subscribes to rtabmap output topic "mapData" and optimize the graph, then republishes the optimized "mapData".

This node can be used to optimize the graph outside rtabmap node. The benefice to do that is that we can keep optimized the global map instead of the local map of rtabmap. You can then connect output mapData_optimized to map_assembler to get the optimized grid, proj and cloud maps assembled again. Note that processing time for map optimization using this node is not bounded (which is the case in rtabmap node).

You could also use your own graph optimization approach instead of this node by modifying poses values of the rtabmap_ros/MapData msg. However, implementing your graph optimization approach inside rtabmap is preferred (inherit Optimizer class and add it here with a new number, then you could select it after using the parameter RGBD/OptimizeStrategy).

When using graph optimization outside rtabmap node, you should set parameters RGBD/OptimizeIterations to 0, RGBD/OptimizeMaxError to 0 and publish_tf to false for rtabmap node.

Published Topics

rtabmap_ros/obstacles_detection

This nodelet extracts obstacles and the ground from a point cloud. The camera must see the ground to work reliably. Since the ground is not even, the ground is segmented by normal filtering: all points with normal in the +z direction (+- fixed angle) are labelled as ground, all the others are labelled as obstacles. The images below show an example.

Required tf Transforms

RVIZ plugins

Map Cloud Display

This rviz plugin subscribes to /mapData (rtabmap_ros/MapData) topic. A 3D map cloud will be created incrementally in RVIZ. When the graph is changed, all point clouds added in RVIZ will be transformed to new poses. It has the same properties as PointCloud display but with these new ones:

Properties

Name

Description

Valid Values

Default

Cloud decimation

How the input depth and RGB images are decimated before creating the point cloud

[1-16]

4

Cloud max depth (m)

Maximum depth of each point cloud added to map (0 means no maximum)

[0-9999]

4

Cloud voxel size (m)

Voxel size of the generated point clouds (0 means no voxel)

[0-1]

0.01

Filter floor (m)

Maximum height of the floor filtered (disabled=0).

[0-9999]

0

Node filtering radius (m)

Only keep one node in the specified radius (disabled=0).

[0-1]

0.2

Node filtering angle (degrees)

Only keep one node in the specified angle in the filtering radius (disabled=0).

[0-180]

30

Download Map

Download the map from rtabmap node. This may take a while if the map is big, be patient!