Author: Daniel Jordan Viray
Solution to error when trying to run VIO and RTAB-Map
May 19, 2026 · Autonomy & Mapping · by Daniel Jordan Viray

Note: Written by AI, verified by me. Article written based on my back-and-forth conversation with AI during development.
The Intel RealSense D455 publishes a raw IMU. RTAB-Map’s odometry needs an orientation quaternion. The D455 doesn’t provide one, so RTAB-Map silently discards every IMU message. This post explains why, the fix (imu_filter_madgwick), and how to validate the resulting VIO without RViz.
Context: RTAB-Map running in Docker on a Jetson Orin Nano, consuming camera topics from a host-side realsense2_camera node. The IMU itself is already exposed at the kernel level (separate problem, separate post).
Launch the camera with IMU enabled:
bash
ros2 launch realsense2_camera rs_launch.py \
depth_module.depth_profile:=424x240x30 \
rgb_camera.color_profile:=424x240x30 \
enable_gyro:=true enable_accel:=true \
unite_imu_method:=2unite_imu_method:=2 merges accel + gyro into one synchronized /camera/camera/imu topic (RTAB-Map expects a unified topic, not separate /accel and /gyro).
Launch RTAB-Map with imu_topic:=/camera/camera/imu. Odometry runs, but the log floods at ~200 Hz with:
CoreWrapper.cpp:2820::imuAsyncCallback() IMU received doesn't have orientation set, it is ignored.Every IMU message is dropped. The pipeline is visual-only, not visual-inertial.
A sensor_msgs/Imu message has three blocks:
Angular velocity — raw gyroscope (rad/s)
Linear acceleration — raw accelerometer (m/s², includes gravity)
Orientation — absolute attitude quaternion
The D455 IMU is a raw sensor: it provides (1) and (2). Block (3) is all zeros — an invalid quaternion.
Orientation is not measured; it’s estimated by fusing the raw sensors:
Gyro: integrate angular velocity → orientation change. Smooth, but integration drift accumulates unboundedly.
Accelerometer: when not translating, measures the gravity vector → absolute pitch/roll reference. Noisy, useless during acceleration, gives no yaw.
Neither is sufficient alone. A fusion filter uses the gyro for short-term smoothness and the accelerometer’s gravity vector to bound gyro drift, producing a stable orientation quaternion. (Same complementary-filter principle as VIO itself — accurate-but-slow corrects fast-but-drifting — applied one level lower, inside IMU processing.)
RTAB-Map’s odometry is visual; it uses the IMU only for a gravity/orientation constraint (knowing “down” corrects visual drift, particularly under rotation where visual odometry is weakest due to low parallax). It requires block (3). Receiving zeros, it correctly rejects every message.
Fix: insert an orientation estimator between the raw IMU and RTAB-Map.
/camera/camera/imu → imu_filter_madgwick → /imu/data → RTAB-Map
(raw, no orientation) (fuses → quaternion) (complete)The Madgwick filter is a low-cost orientation estimator (relevant on a CPU-constrained Orin Nano). This is the standard RealSense + RTAB-Map architecture.
Check the package (else apt install ros-humble-imu-filter-madgwick):
bash
ros2 pkg executables imu_filter_madgwickRun it:
bash
ros2 run imu_filter_madgwick imu_filter_madgwick_node \
--ros-args \
-r imu/data_raw:=/camera/camera/imu \
-r imu/data:=/imu/data \
-p use_mag:=false \
-p publish_tf:=falseParameters:
-r imu/data_raw:=/camera/camera/imu — filter input ← raw RealSense IMU
-r imu/data:=/imu/data — filter output → consumed by RTAB-Map
use_mag:=false — mandatory for D455. No magnetometer on the device; without this the filter waits indefinitely for magnetometer data and produces no output. Silent failure mode.
publish_tf:=false — RTAB-Map owns the TF tree; a competing transform from the filter causes conflicts.
Startup prints First IMU message received. then goes quiet (no per-message logging).
bash
ros2 topic echo /imu/data --onceCheck the orientation block is non-zero, and validate:
Unit quaternion: x²+y²+z²+w² ≈ 1. Example: 0.511² + (−0.577)² + 0.466² + (−0.433)² = 0.999. ✓
Accel magnitude: stationary, √(ax²+ay²+az²) ≈ 9.8 m/s² (gravity). Example: √(0.235² + 9.669² + 1.844²) ≈ 9.84. ✓
Non-zero orientation + correct gravity magnitude confirms real fusion, not noise.
Only change imu_topic to the filtered topic:
bash
ros2 launch rtabmap_launch rtabmap.launch.py \
rgb_topic:=/camera/camera/color/image_raw \
depth_topic:=/camera/camera/depth/image_rect_raw \
camera_info_topic:=/camera/camera/color/camera_info \
imu_topic:=/imu/data \
frame_id:=camera_link approx_sync:=true \
visual_odometry:=true odom_frame_id:=odom \
database_path:=/root/maps/rtabmap.db delete_db_on_start:=trueSuccess: the imuAsyncCallback ... doesn't have orientation set flood is gone.
Remember to delete any prior/stale databases. I ran into errors loading a stale DB from a differently-configured session, which triggers a vocabulary-mismatch flood:
VWDictionary.cpp:741::addWordRef() Not found word 178034 (dict size=4486)A publishing pose topic only proves data flow, not correctness. Validate physically with two terminals: one on RTAB-Map’s log (the Odom: quality=N field is a live feature-tracking health metric), one echoing the pose field under test.
Stationary stability:
bash
ros2 topic echo /rtabmap/odom --field pose.pose.positionCamera still, pointed at a textured scene. Expect mm-level position jitter (~±3 mm/axis observed). Confirms it correctly resolves “not moving.”
Translation (metric scale): glide the camera ~30 cm along one axis over 2–3 s. The corresponding position component should change by ~0.30 m, then hold stable when stopped. Metric scale comes from the depth camera — not arbitrary drift.
Rotation (symmetry test):
bash
ros2 topic echo /rtabmap/odom --field pose.pose.orientationDon’t read absolute quaternion values; test reversibility. Note resting quaternion, rotate ~90° yaw slowly (4–5 s; pure rotation is the hardest case for visual odometry — fast feature sweep, low parallax), rotate back. The quaternion should trace a smooth monotonic arc out and return near the start value. Example (dominant components): start z=−0.395, w=0.889 → peak z=−0.81, w=0.56 → return z=−0.378, w=0.924. Close return + smooth path (no jumps/NaNs/zero-resets) = pass.
Initial translation test failed:
OdometryF2M.cpp:622 Registration failed: "Not enough inliers 0/20 (matches=6)"
Odom: quality=0Pose output went to all-zeros. Cause: visual odometry matches features between frames; a low-texture surface (blank wall, bare floor) collapses match count to single digits, zero pass geometric validation, odometry resets. Reporting zeros is correct behavior, just not useful.
Aggravating factor: camera mounted ~10° down → when placed low it views a near-featureless floor. quality cratered 271 → 113 → 34 as the view degraded, with Memory.cpp:3217 Missing visual features.
Mitigations:
Test in a feature-rich scene (textured clutter, not blank wall/floor). With a textured scene, tracking went to quality=250–290 and all tests passed.
Don’t initialize with the camera pointed at the ground (worst-texture surface at the worst time).
Use quality live as a tracking-health diagnostic; correlate drops with where the camera points.
Flight implication: a downward-tilted camera over a textureless indoor floor is a potential position-hold failure risk, not just a bench artifact.
Working pipeline:
D455 → host realsense2_camera → /camera/camera/imu (raw, 200 Hz)
→ imu_filter_madgwick → /imu/data (with orientation)
→ RTAB-Map (SLAM + VIO, Docker) → /rtabmap/odomValidated: stationary stability, metric translation, reversible rotation.
Open item: odometry ~10 Hz; 20+ Hz wanted for flight control. Higher rate also improves motion-tracking robustness (the featureless-environment failure is partly a low-rate problem). Optimization (feature count, odometry strategy, full-SLAM vs odometry-only cost on the Orin Nano) is next.
Camera: enable_gyro:=true enable_accel:=true unite_imu_method:=2
D455 IMU has no orientation → RTAB-Map rejects it (expected, not a bug)
imu_filter_madgwick, use_mag:=false (mandatory — no magnetometer; silent no-op without it), input ← raw IMU, output → /imu/data
Verify /imu/data: unit quaternion, ~9.8 m/s² accel magnitude
RTAB-Map imu_topic:=/imu/data; confirm rejection flood gone
Vocabulary-mismatch errors → rm -f the DB file (launch param unreliable)
Validate physically (stationary mm jitter / 30 cm → 0.3 m / 90° rotation reversible). Requires a feature-rich scene.