cartographer-project / cartographer_turtlebot

Provides TurtleBot integration for Cartographer.
Apache License 2.0
151 stars 96 forks source link

About the flat_world_imu_node_main node ,maybe it has a bug in line 52 #24

Closed hapi007 closed 7 years ago

hapi007 commented 7 years ago

i am using the Kobuki platform. I know that there's a driver bug that causes IMU messages to be published out of order. The flat_world_imu_node drops any packets that arrive out of order before they can reach the Cartographer node and cause a crash. but if an imu data sequence is :header.stamp =10, header.stamp = 5, header.stamp =6, header.stamp =11......, The Cartographer node will receive the data sequence like: 10, 6 ,11,.......... , it will also cause a crash . Cartographer node only want to received data:10 ,11 ......... So, i think that the line 52 may be need to rewrite into the " if ' scope. But, it will cause another question: if i change the system time manually or using NTP, it may drop too many packets.

damonkohler commented 7 years ago

Definitely looks like a bug, thanks! Pushing a fix.

hapi007 commented 7 years ago

thanks! However, how about the next question? i mean if i change the system time manually or using NTP,e.g. from 10:00 clock to 09:00, the imu stamp will always out of order in this hour, does it cause dropping too many packets?

SirVer commented 7 years ago

If you change the system time while your ROS system is running you will have a bad time - this node will not behave nicely but most others will not either. Cartographer SLAM will also crash since it expects each sensor stream to arrive time ordered. You should not change the system time of a running system.

hapi007 commented 7 years ago

thanks a lot! SirVer