rtabmap realsense imu frame id changed
Hi all,
I am running rtabmap as described in http://wiki.ros.org/rtabmap_ros/Tutor..., 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.
G
Just tried with latest realsense2_camera node and /rtabmap/imu should have frame set to
d400_imu_optical_frame
. Dorostopic echo /d400/imu
to see if theframe_id
changes over time.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"
To comment on my own comment: I tried two other firmware versions and they did not make any difference.
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.Thanks. I'll look at these and report back.
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.
Great, you can add an "Answer" to your question with that last comment and mark as solved.