Package Summary
RTAB-Map's various useful nodes and nodelets.
- 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
-
Nodelets
- rtabmap_util/rgbd_relay
- rtabmap_util/point_cloud_xyzrgb
- rtabmap_util/point_cloud_xyz
- rtabmap_util/disparity_to_depth
- rtabmap_util/pointcloud_to_depthimage
- rtabmap_util/point_cloud_assembler
- rtabmap_util/point_cloud_aggregator
- rtabmap_util/imu_to_tf
- rtabmap_util/obstacles_detection
- rtabmap_util/lidar_deskewing
Nodes
map_assembler
Note: It is recommend to use directly cloud_map or proj_map published topics from rtabmap node instead of using this node.
This node subscribes to rtabmap output topic "mapData" and assembles the 3D map incrementally, then publishes the same maps than rtabmap. See all Mapping related topics and parameters of rtabmap node. You can also use all Grid parameters from rtabmap:
$ rosrun rtabmap_slam rtabmap --params | grep Grid/
For example, setting the voxel sixe of the resulting grid/point cloud to 10 cm:
<launch> <node name="map_assembler" pkg="rtabmap_util" type="map_assembler"> <param name="Grid/CellSize" type="double" value="0.1"/> </node> </launch>
Subscribed Topics
mapData (rtabmap_msgs/MapData)- RTAB-Map's graph and latest node data.
Services
~reset (std_srvs/Empty)- Reset the cache.
Parameters
~regenerate_local_grids (bool, default: "false")- (>=0.20.5) If local occupancy grids are already included in mapData, set this to true to regenerate them. For example, this can be used to generate the local occupancy grids with a different sensor (e.g., Grid/FromDepth is different than one used in rtabmap).
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_slam 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_msgs/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.
This node should not be used if rtabmap node is in localization mode.
Subscribed Topics
mapData (rtabmap_msgs/MapData)- RTAB-Map's graph and latest node data.
Published Topics
[mapData]_optimized (rtabmap_msgs/MapData)- RTAB-Map's optimized graph and latest node data.
- RTAB-Map's optimized graph.
Parameters
~map_frame_id (string, default: "map")- The frame attached to the map.
- The frame attached to odometry.
- Optimization approach used: 0=TORO, 1=g2o and 2=GTSAM.
- 3DoF (x,y,yaw) optimization instead of 6DoF (x,y,z,roll,pitch,yaw).
- Activate Vertigo robust graph optimization when g2o or GTSAM strategy is used.
- Optimize the global map. If false, only the local map is optimized.
- Map optimization iterations.
- Stop graph optimization when error is less than epsilon (0=ignore epsilon).
- Ignore constraints' variance. If checked, identity information matrix is used for each constraint in TORO. Otherwise, an information matrix is generated from the variance saved in the links.
- Optimize from the last node. If false, the graph is optimized from the oldest node linked to the current map.
- Publish TF from /map to /odom.
- Rate at which the TF from /map to /odom is published (20 Hz).
Nodelets
rtabmap_util/rgbd_relay
A relay for rtabmap_msgs/RGBDImage messages. It works like a topic_tools/relay, but can also compress or uncompress data for convenience.Subscribed Topics
rgbd_image (rtabmap_msgs/RGBDImage)- RGB-D image input stream.
Published Topics
[rgbd_image]_relay (rtabmap_msgs/RGBDImage)- RGB-D image output stream.
Parameters
~queue_size (int, default: 10)- Size of message queue.
- Publish compressed RGB-D image data.
- Publish uncompressed RGB-D image data.
rtabmap_util/point_cloud_xyzrgb
Construct a point cloud from RGB and depth images or stereo images. Optional decimation, depth, voxel and noise filtering can be applied.Subscribed Topics
rgb/image (sensor_msgs/Image)- RGB image stream.
- Registered depth image stream.
- RGB camera metadata.
- Left RGB/Mono rectified image.
- Left camera metadata.
- Right Mono rectified image.
- Right camera metadata.
Published Topics
cloud (sensor_msgs/PointCloud2)- Generated RGB point cloud.
Parameters
~queue_size (int, default: 10)- Size of message queue for each synchronized topic.
- Use approximate time synchronization of the input topics. If false, the input topics must have the same timestamp (set to "false" for stereo images).
- Decimation of the images before creating the point cloud. Set to 1 to not decimate the images.
- Voxel size (m) of the generated cloud. Set 0.0 to deactivate voxel filtering.
- Min depth (m) of the generated cloud.
- Max depth (m) of the generated cloud. Set 0.0 to deactivate depth filtering.
- Max radius (m) for searching point neighbors. Set 0.0 to deactivate noise filtering.
- Minimum neighbors of a point to keep it.
- Compute normals using k nearest neighbors (0=disabled).
- Compute normals using nearest neighbors inside the radius (m) (0=disabled).
- Remove NaNs points from output cloud (convert organized to dense point cloud)
- Region of interest ratios [left, right, top, bottom] (e.g., "0 0 0 0.2" will cut 20% of the bottom of the image).
rtabmap_util/point_cloud_xyz
Construct a point cloud from a depth or disparity image. Optional decimation, depth, voxel and noise filtering can be applied.Subscribed Topics
depth/image (sensor_msgs/Image)- Depth image stream.
- Depth camera metadata.
- Disparity image stream.
- Disparity camera metadata.
Published Topics
cloud (sensor_msgs/PointCloud2)- Generated point cloud.
Parameters
~queue_size (int, default: 10)- Size of message queue for each synchronized topic.
- Use approximate time synchronization of messages. If false, the image and camera info must have the same timestamps.
- Decimation of the RGB/depth images before creating the point cloud. Set to 1 to not decimate the images.
- Voxel size (m) of the generated cloud. Set 0.0 to deactivate voxel filtering.
- Min depth (m) of the generated cloud.
- Max depth (m) of the generated cloud. Set 0.0 to deactivate depth filtering.
- Max radius (m) for searching point neighbors. Set 0.0 to deactivate noise filtering.
- Minimum neighbors of a point to keep it.
- Compute normals using k nearest neighbors (0=disabled).
- Compute normals using nearest neighbors inside the radius (m) (0=disabled).
- Remove NaNs points from output cloud (convert organized to dense point cloud)
- Region of interest ratios [left, right, top, bottom] (e.g., "0 0 0 0.2" will cut 20% of the bottom of the image).
rtabmap_util/disparity_to_depth
Convert a disparity image to a depth image.Subscribed Topics
disparity (stereo_msgs/DisparityImage)- Disparity image stream.
Published Topics
depth (sensor_msgs/Image)- Depth image stream in m. Format TYPE_32FC1.
- Depth image stream in mm. Format TYPE_16UC1.
rtabmap_util/pointcloud_to_depthimage
Reproject a point cloud into a camera frame to create a depth image. When fixed_frame_id is set (e.g., "odom"), movement is taken into account by transforming the point cloud accordingly to camera timestamp. An example of usage of this nodelet can be found in the Tango ROS Streamer tutorial.Subscribed Topics
camera_info (stereo_msgs/CameraInfo)- Camera info in which we want to reproject the points.
- The cloud to reproject in the camera.
Published Topics
image (sensor_msgs/Image)- Depth image stream in m. Format TYPE_32FC1.
- Depth image stream in mm. Format TYPE_16UC1.
Parameters
~queue_size (int, default: 10)- Size of message queue for each synchronized topic.
- This frame should be set when using approximate time synchronization (approx is true). If the robot is moving, it could be "odom". If not moving, it could be "base_link".
- Approximate time synchronization.
- Wait duration for transform when a tf transform is not still available.
- 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.
rtabmap_util/point_cloud_assembler
This nodelet can assemble a number of clouds (max_clouds or for a time assembling_time) coming from the same topic, taking into account the displacement of the robot based on fixed_frame_id, then publish the resulting cloud. If fixed_frame_id is set to "" (empty), the nodelet will subscribe to an odom topic that should have the exact same stamp than to input cloud. The output cloud has the same stamp and frame than the last assembled cloud.Subscribed Topics
cloud (sensor_msgs/PointCloud2)- Point cloud topic to assemble.
- Odometry topic used to assembled clouds, when fixed_frame_id is not set. Assuming exact synchronization with input cloud.
- Used to assemble only keyframe scans from icp_odometry, when subscribe_odom_info is true. Assuming exact synchronization with input cloud.
Published Topics
assembled_cloud (sensor_msgs/PointCloud2)- The assembled cloud.
Parameters
~queue_size (int, default: 10)- Size of message queue for each synchronized topic.
- The fixed frame used to estimate displacement between assembled clouds. If not set, an odometry topic will be required.
- Frame id of the output assembled cloud. If not set, same frame id as input cloud is used.
- The assembled cloud is published after reaching this number of input clouds received. max_clouds or assembling_time should be set.
- The assembled cloud is published after the assembling time (seconds). max_clouds or assembling_time should be set.
- Number of input clouds to skip.
- Instead of accumulating all the clouds before publishing the assembled cloud, the input clouds are kept in a circular buffer (of size max_clouds or a assembling_time) and the assebmled cloud is published every time a new scan is received. When circular_buffer is false, the temporary buffer to accumulate the clouds is cleared after each publishing.
- If displacement between the last cloud and the new cloud received is under this value (meters), the new cloud is skipped. If circular_buffer is enabled, the assembled cloud is still published with the new cloud, but the new cloud is removed from the circular buffer instead of the oldest one. 0 means disabled.
- If rotation between the last cloud and the new cloud received is under this value (rad), the new cloud is skipped. If circular_buffer is enabled, the assembled cloud is still published with the new cloud, but the new cloud is removed from the circular buffer instead of the oldest one. 0 means disabled.
- Time to wait to get TF value between fixed frame and cloud frame at the stamp of the input cloud.
- Filter input clouds with a minimum range. 0 means disabled.
- Filter input clouds with a maximum range. 0 means disabled.
- Apply voxel filter to output assembled cloud. 0 means disabled.
- Apply radius outlier filter to output assembled cloud (meters). 0 means disabled.
- Apply radius outlier filter to output assembled cloud (minimum number of neighbors of a point in noise_radius to keep it). 0 means disabled, noise_radius should also be set.
- Remove z field from assembled cloud before publishing it to make it 2D. Useful if you are assembling laser scans created with laser_geometry scan to cloud (or hector_laserscan_to_pointcloud).
rtabmap_util/point_cloud_aggregator
Nodelet used to merge point clouds from different sensors into a single assembled cloud. If fixed_frame_id is set and approx_sync is true, the clouds are adjusted to include the displacement of the robot in the output cloud.Subscribed Topics
cloud1 (sensor_msgs/PointCloud2)- Point cloud topic to combine. This is the reference topic for output timestamp (and frame_id if not overridden by parameter).
- Second point cloud topic to combine.
- Third point cloud topic to combine. Optional, only if count>=3.
- Second point cloud topic to combine. Optional, only if count=4.
Published Topics
combined_cloud (sensor_msgs/PointCloud2)- The combined cloud.
Parameters
~queue_size (int, default: 10)- Size of message queue for each synchronized topic.
- The fixed frame used to estimate displacement between combined clouds. Recommended if approx_sync is true.
- Frame id of the output combined cloud. If not set, same frame id as input cloud1 is used.
- Use approximate time policy to synchronize input topics.
- Number of input topics to combine.
- Time to wait to get TF value between fixed frame and cloud frame at the stamp of the input cloud.
rtabmap_util/imu_to_tf
Nodelet used to convert orientation set in a sensor_msgs/IMU msg into a TF in a target frame (that may be or not the frame of the IMU msg). For example, the resulting TF could be used as fixed or guess frame for lidar deskewing or rtabmap_odom respectively.Subscribed Topics
imu/data (sensor_msgs/IMU)- The IMU topic to get orientation from. The orientation should be already estimated. If not, you may use an IMU filter package to estimate the orientation (e.g., imu_filter_madgwick or imu_complementary_filter).
Parameters
~fixed_frame_id (string, default: "odom")- Parent frame of the output tf.
- The target child frame of the output tf (e.g., base_link). IMU orientation will be transformed to estimate orientation of that frame (not the IMU frame). If not set, frame inside IMU topic is used.
- Time to wait to get TF value between base_frame_id and the IMU frame at the stamp of the IMU.
Required tf Transforms
base_frame_id → <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.
Provided tf Transforms
fixed_frame_id → base_frame_id- the resulting tf representing the IMU orientation.
rtabmap_util/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.
Warning: this node will use a lot of CPU ressources if the raw point clouds are fed to it directly. A pcl::VoxelGrid can be used to downsample the raw point cloud (e.g. like 5 cm voxel) or rtabmap_util/point_cloud_xyz nodelet can be used to generate a downsampled cloud from a depth image (e.g. decimating the depth image by 4 before creating a cloud). That filtered point cloud would be fed to obstacles_detection.
|
|
|
|
Subscribed Topics
cloud (sensor_msgs/PointCloud2)- A point cloud generated from a RGB-D camera or a stereo camera.
Published Topics
ground (sensor_msgs/PointCloud2)- The segmented ground.
- The segmented obstacles.
Parameters
~frame_id (string, default: "base_link")- The frame attached to the mobile base.
- Size of message queue for each synchronized topic.
- Normal estimation radius (m).
- Maximum angle from the +z axis of the point's normal to be labelled as ground.
- Minimum size of the segmented clusters to keep.
- Maximum height of obstacles.
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.
rtabmap_util/lidar_deskewing
For sensor_msgs/PointCloud2 input_cloud (3D LiDAR), each point will be deskewed based on their timestamp during the rotation of the LiDAR using fixed_frame_id fixed frame. The input_cloud topic should have timestamp channel as t, time or stamps. Supported timestamp formats are FLOAT32 (seconds since header's timestamp) and UINT32 (nanoseconds since header's timestamp). If input_cloud is organized, deskewing will be faster (transformed per columns instead per points). For sensor_msgs/LaserScan input_scan (2D LiDAR), laser_geometry::LaserProjection class is used directly to project the scan while accounting for robot motion.
Subscribed Topics
input_scan (sensor_msgs/LaserScan)- A laser scan (2D LiDAR). Use either input_scan or input_cloud.
- A point cloud generated from one rotation of a 3D LiDAR. Use either input_scan or input_cloud.
Published Topics
[input_scan]/deskewed (sensor_msgs/PointCloud2)- The deskewed laser scan converted to a point cloud. Output frame is the same than the frame of the input topic.
- The deskewed point cloud. Output frame is the same than the frame of the input topic.
Parameters
~fixed_frame_id (string, default: "")- The fixed frame used for deskewing (e.g., "odom").
- How much time to wait for TF to be ready.
- When enable, a lookup transform for TF will only be done for the first and last stamp, then points with in between timestamps will be deskewed by interpolating between the oldest and latest poses. This can be faster than the default approach looking for transform for very timestamps (though later approach would be more accurate).
Required tf Transforms
fixed_frame_id → <the frame attached to sensors of incoming data>- high frame rate (faster than LiDAR rate) and locally accurate transform, e.g., IMU TF or odometry TF.