mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
ab1288cccc846bb60c142c82265151d0ecd1d0cf
OdometryROS: refactored imu sync (#331). Using tf to compute baseline if Rtabmap/ImagesAlreadyRectified is true (for convenience with realsense rectified IR images but right camera info Tx not set)
Added netvlad_tf_ros.py script, added compression.py script to compress/uncompress data from rtabmap
rtabmap_ros 
RTAB-Map's ROS2 package (branch ros2). ROS2 Foxy minimum required: currently most nodes are ported to ROS2, however they are not all tested yet. The interface is the same than on ROS1 (parameters and topic names should still match ROS1 documentation on rtabmap_ros).
rtabmap.launch is also ported to ROS2 with same arguments. If you see ROS1 examples like this:
$ roslaunch zed_wrapper zed_no_tf.launch
$ roslaunch rtabmap_ros rtabmap.launch \
rtabmap_args:="--delete_db_on_start" \
rgb_topic:=/zed/zed_node/rgb/image_rect_color \
depth_topic:=/zed/zed_node/depth/depth_registered \
camera_info_topic:=/zed/zed_node/rgb/camera_info \
frame_id:=base_link \
approx_sync:=false
The ROS2 equivalent is (with those lines set to false to avoid TF conflicts):
$ ros2 launch zed_wrapper zed.launch.py
$ ros2 launch rtabmap_ros rtabmap.launch.py \
rtabmap_args:="--delete_db_on_start" \
rgb_topic:=/zed/zed_node/rgb/image_rect_color \
depth_topic:=/zed/zed_node/depth/depth_registered \
camera_info_topic:=/zed/zed_node/rgb/camera_info \
frame_id:=base_link \
approx_sync:=false
Installation
-
RTAB-Map ROS2 package:
$ cd ~/ros2_ws $ git clone https://github.com/introlab/rtabmap.git src/rtabmap $ git clone --branch ros2 https://github.com/introlab/rtabmap_ros.git src/rtabmap_ros $ export MAKEFLAGS="-j6" # Can be ignored if you have a lot of RAM $ colcon build --symlink-install -
To build with
rgbd_cameras>1support and/orsubscribe_user_datasupport:$ colcon build --symlink-install --cmake-args -DRTABMAP_SYNC_MULTI_RGBD=ON -DRTABMAP_SYNC_USER_DATA=ON
Example with Turtlebot3
-
Launch Turtlebot3 simulator:
$ export TURTLEBOT3_MODEL=waffle $ ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py $ export TURTLEBOT3_MODEL=waffle $ ros2 run turtlebot3_teleop teleop_keyboard -
Launch RTAB-Map:
$ ros2 launch rtabmap_ros turtlebot3_scan.launch.py # OR with rtabmap.launch.py $ ros2 launch rtabmap_ros rtabmap.launch.py \ visual_odometry:=false \ frame_id:=base_footprint \ subscribe_scan:=true depth:=false \ approx_sync:=true \ odom_topic:=/odom \ scan_topic:=/scan \ args:="-d --RGBD/NeighborLinkRefining true --Reg/Strategy 1" \ use_sim_time:=true
See launch/ros2 subfolder for some other ROS2 examples with turtlebot3 in simulation and a RGB-D camera.
Languages
C++
84.9%
Python
11.9%
CMake
1.6%
Dockerfile
1%
C
0.4%
Other
0.2%