ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

rtabmap realsense imu frame id changed

asked 2020-09-15 10:40:39 -0600

gbohus gravatar image

updated 2020-09-16 05:18:46 -0600

Hi all,

I am running rtabmap as described in, using a D435i. I am getting the following error many times a second:

IMU frame_id has changed from d400_gyro_frame to d400_accel_frame! Are multiple nodes publishing on same topic /rtabmap/imu? IMU buffer is cleared!

The setup is this:

roslaunch realsense2_camera rs_camera.launch camera:=d400 align_depth:=true unite_imu_method:=linear_interpolation enable_gyro:=true enable_accel:=true initial_reset:=true

rosrun imu_filter_madgwick imu_filter_node _use_mag:=false _publish_tf:=false _world_frame:="enu" /imu/data_raw:=/d400/imu /imu/data:=/rtabmap/imu

roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start --Optimizer/GravitySigma 0.3" depth_topic:=/d400/aligned_depth_to_color/image_raw rgb_topic:=/d400/color/image_raw camera_info_topic:=/d400/color/camera_info approx_sync:=false wait_imu_to_init:=true imu_topic:=/rtabmap/imu frame_id:=d400_link

According to rostopic /rtabmap/imu is only published by one publisher:

$ rostopic list -v | grep -i imu * /d400/imu [sensor_msgs/Imu] 1 publisher * /ImuFilter/parameter_updates [dynamic_reconfigure/Config] 1 publisher * /ImuFilter/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher * /rtabmap/imu [sensor_msgs/Imu] 1 publisher * /d400/imu_info [realsense2_camera/IMUInfo] 1 publisher * /rtabmap/imu [sensor_msgs/Imu] 2 subscribers * /d400/imu [sensor_msgs/Imu] 1 subscriber

Thanks for any help.


edit retag flag offensive close merge delete


Just tried with latest realsense2_camera node and /rtabmap/imu should have frame set to d400_imu_optical_frame. Do rostopic echo /d400/imu to see if the frame_id changes over time.

matlabbe gravatar image matlabbe  ( 2020-09-15 15:30:11 -0600 )edit

Thanks matlabbe. Indeed, the frame_id keeps switching back and forth, both for linear_interpolation and for copy.

I'm not sure what you mean by /rtabmap/imu should have frame set to d400_imu_optical_frame. /rtabmap/imu is a topic published by the imu_filter_madgwick node and is consumed by the rtabmap node. It is in the frame that is used by the imu data going into the madgwick node which is what /d400/imu uses which keeps changing. The weird thing is that I _think_ it used to work. Can it be a problem with the firmware which I have recently updated?

The output from rostopic echo doesn't fit here, but basically it's alternating between

frame_id: "d400_accel_frame" and frame_id: "d400_gyro_frame"

gbohus gravatar image gbohus  ( 2020-09-16 05:41:15 -0600 )edit

To comment on my own comment: I tried two other firmware versions and they did not make any difference.

gbohus gravatar image gbohus  ( 2020-09-16 07:17:52 -0600 )edit

Not sure why on my system, the realsense2 package returns always d400_imu_optical_frame in /d400/imu. Make sure you are using latest realsense_ros package. The synchronized imu topic is published here and the header of this topic is populated in this function using gyro frame. The gyro frame is set to d400_imu_optical_frame here when sync is enabled.

matlabbe gravatar image matlabbe  ( 2020-09-16 09:47:31 -0600 )edit

Thanks. I'll look at these and report back.

gbohus gravatar image gbohus  ( 2020-09-16 09:49:26 -0600 )edit

So, updating the realsense_ros package did the trick, although I had some problems there as well. (Don't want to diverge here, basically the version with the latest tag doesn't build for me, but if I just clone, it does.) Thanks again matlabbe.

gbohus gravatar image gbohus  ( 2020-09-17 10:29:36 -0600 )edit

Great, you can add an "Answer" to your question with that last comment and mark as solved.

matlabbe gravatar image matlabbe  ( 2020-09-17 10:56:25 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-09-18 02:44:40 -0600

gbohus gravatar image

So it seems that a somewhat older version of realsense-ros might have had a problem. Updated yesterday to the current version and it seems to work now.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-09-15 10:40:39 -0600

Seen: 249 times

Last updated: Sep 18 '20