koide3 / hdl_graph_slam

3D LIDAR-based Graph SLAM
BSD 2-Clause "Simplified" License
1.98k stars 726 forks source link

Approximate time sync for odom/scan input to HdlGraphSlamNodelet #128

Closed tim-fan closed 4 years ago

tim-fan commented 4 years ago

Hello, this is a pull request for the diff I posted in #74 .

It allows the HdlGraphSlamNodelet to use odometry when the odom message timestamps do not exactly match the pointcloud message timestamps - as would be typical if using, say, wheel encoder odometry.

This is achieved by switching the time synchroniser for sync::ApproximateTime. http://wiki.ros.org/message_filters/ApproximateTime

From my understanding of the filter, it will have the same behaviour as before if timestamps match exactly, and if they don't then odometry will be matched to point clouds based on proximity in time.

I've tested on the provided hdl_501_filtered.bag, I didn't notice any difference in the resulting map before and after this change.

koide3 commented 4 years ago

Thanks a lot for the pull request. It would be helpful for many users :+1: