ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Most encoders are incremental, and the software that reads them expects them to wrap around. I'm not deeply familiar with the differential_drive package, but it should handle the wraparound correctly.

That said, having that wraparound happen every 300mS is a little extreme; if the ROS system is running very slowly, there's some potential for it missing the wraparound event. If you track your encoders with a larger type ( int32_t ) on the arduino and then divide that by something like 10 or 20 before converting to an Int16 and publishing, you increase the time between overflows in your Int16 to a more reasonable value of 3 to 6 seconds.