Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to run rtabmap-ros against streams recorded in rosbag #3272

Open
jsreveal opened this issue Dec 6, 2024 · 1 comment
Open

Failing to run rtabmap-ros against streams recorded in rosbag #3272

jsreveal opened this issue Dec 6, 2024 · 1 comment
Labels

Comments

@jsreveal
Copy link

jsreveal commented Dec 6, 2024

Required Info
Camera Model D455
Firmware Version 5.16.01
Operating System & Version Linux (Ubuntu 22)
Kernel Version (Linux Only) 6.8.0-49-generic
Platform PC
Librealsense SDK Version 2.56.3
Segment others
ROS Distro Humble
RealSense ROS Wrapper Version 4.56.3

Issue Description

Hi guys,

I am running mapping with rtabmap-ros against realsense topics depth aligned and rgb, and imu. Mapping seems to work ok live, but does not work when we do it against a recorded rosbag. And we really need to run mapping from a recorded bag.

I am using the suggestions from rtabmap github issue 1071 but or it does not run or I get the following error message:
rgbd_odometry-1] [ERROR] [1733444410.557515875] [rtabmap.rgbd_odometry]: Could not transform IMU msg from frame "camera_imu_optical_frame" to frame "camera_link", TF not available at time 1733442584.769126

Launching realsense topics with the following command:
ros2 launch realsense2_camera rs_launch.py initial_reset:=true enable_gyro:=true enable_accel:=true unite_imu_method:=2 enable_sync:=true align_depth.enable:=true rgb_camera.color_profile:="848,480,30" publish_tf:=false

Filtering imu data with:

ros2 run imu_filter_madgwick imu_filter_madgwick_node --ros-args --remap /imu/data_raw:=/camera/camera/imu --remap /imu/data:=/rtabmap/imu --ros-args -p use_mag:=false -p publish_tf:=false

Recording rosbag with the command:
ros2 bag record /camera/camera/color/image_raw /camera/camera/aligned_depth_to_color/image_raw /rtabmap/imu /tf /tf_static

Playing rosbag with:
ros2 bag play rosbag_file --remap /tf_static:=/tf

Running rtabmap with:

ros2 launch rtabmap_launch rtabmap.launch.py args:="-d" rgb_topic:=/camera/camera/color/image_raw depth_topic:=/camera/camera/aligned_depth_to_color/image_raw camera_info_topic:=/camera/camera/color/camera_info frame_id:=camera_link wait_imu_to_init:=true imu_topic:="/rtabmap/imu"

Output of the bag info:

[INFO] [1733512426.985060243] [rosbag2_storage]: Opened database 'rosbag2_2024_12_06-19_13_04/rosbag2_2024_12_06-19_13_04_0.db3' for READ_ONLY.

Files:             rosbag2_2024_12_06-19_13_04/rosbag2_2024_12_06-19_13_04_0.db3
Bag size:          315.8 MiB
Storage id:        sqlite3
Duration:          10.827857461s
Start:             Dec  6 2024 19:13:04.890183034 (1733512384.890183034)
End:               Dec  6 2024 19:13:15.718040495 (1733512395.718040495)
Messages:          2495
Topic information: Topic: /tf | Type: tf2_msgs/msg/TFMessage | Count: 0 | Serialization Format: cdr
                   Topic: /camera/camera/imu | Type: sensor_msgs/msg/Imu | Count: 2171 | Serialization Format: cdr
                   Topic: /camera/camera/color/image_raw | Type: sensor_msgs/msg/Image | Count: 162 | Serialization Format: cdr
                   Topic: /camera/camera/aligned_depth_to_color/image_raw | Type: sensor_msgs/msg/Image | Count: 162 | Serialization Format: cdr

Other approaches attempted without success:

  • recording directly the /camera/camera/imu and only applying madgwick filter when playing the rosbag
  • launching realsense with publish_tf:=true (and recording the tf topics as well)
  • reducing frame rate of depth and color to 5 or 15
@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Dec 7, 2024

Hi @jsreveal In Intel's D435i SLAM guide for ROS1 and rtabmap_ros, when playing back a recorded bag they advise setting a parameter called use_sim_time to true and adding a --clock parameter to the bag play command.

https://github.com/IntelRealSense/realsense-ros/wiki/SLAM-with-D435i

Converting the details to ROS2 for use with your own ros2 bag play command, the instructions should be something like this:

ros2 param set /use_sim_time true
ros2 bag play rosbag_file  --remap /tf_static:=/tf --clock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants