Difficulty when using external odometry

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Difficulty when using external odometry

slam
Hello,

I am trying to run rtabmap built from source with external odometry (first trying it with only wheel odometry), but the mapping has a big delay and some overlappings, especially while turning.
I am using RealSense ZR300 (with depthcloud_to_depthimage) mounted on a small robot.

rosbag: https://drive.google.com/file/d/164PW2ljDI17JQWJx_fgNmkvzXGOLj19Z/view?usp=sharing

launch file: https://drive.google.com/file/d/15cIqIFO7NxcDTfkAau0sRmhoiHNiFys5/view?usp=sharing

database: https://drive.google.com/file/d/10k0CaswRSJ2P73aVWe9cJY6P9AMirjSV/view?usp=sharing

Could you tell me what causes this problem and what can be done to improve the mapping quality?
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty when using external odometry

matlabbe
Administrator
Hi,

The wheel odometry is late of around 4 seconds after the images are received. Compare with:
$ rostopic echo /camera/rgb/image_rect_color/header/stamp
$ rostopic echo /wheel_odom/header/stamp

Make also sure that transform between the center of wheel shaft (referential of wheel odometry) and the camera is accurate. The current one is:
$ rosrun tf tf_echo base_link camera_link
- Translation: [0.094, -0.030, 0.000]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
            in RPY (radian) [0.000, -0.000, 0.000]
            in RPY (degree) [0.000, -0.000, 0.000]
Look in RVIZ with TF display to see if it makes sense.

Before trying rtabmap, you may add DepthCloud display to RVIZ, set global fixed frame to odom and see if the current clouds follow the odometry.

For convenience, instead of manually modifying rtabmap.launch, you can use it directly as this:
$ roslaunch rtabmap_ros rtabmap.launch \
   rtabmap_args:="--delete_db_on_start" \
   depth_topic:=/camera/depth_registered/sw_registered/image_rect_raw \
   frame_id:=base_link \
   visual_odometry:=false \
   odom_topic:=/wheel_odom

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty when using external odometry

slam
Thank you!

The cause is that the camera timestamp drifts over time. I believe it uses a internal clock that counts the time since the camera power up and is not really synchronized with the system.
Since my wheel odometry is published using the system timestamp, the delay gets bigger with time...
Reply | Threaded
Open this post in threaded view
|

Re: Difficulty when using external odometry

slam
I edited the realsense source code (base_nodelet.cpp) and made it to always publish everything with timestamp=ros::Time::now(). (Maybe there is another way to fixed this?)
And set the bold parameters:
$ rosrun rtabmap_ros pointcloud_to_depthimage cloud:=/camera/depth/points camera_info:=/camera/rgb/camera_info image_raw:=/camera/depth/points/image_raw image:=/camera/depth/points/image _approx:=true _fill_holes_size:=2 _fixed_frame_id:="odom"

Now the mapping looks much better.