ROBOTIS-GIT / turtlebot3

ROS packages for Turtlebot3
http://turtlebot3.robotis.com
Apache License 2.0
1.48k stars 1.02k forks source link

fixed the problem that /odom/twist is too small #1001

Open firefly1250 opened 9 months ago

firefly1250 commented 9 months ago

This fixes #977 .

Problem

In the duration calculation, only the "nanosec" part of "current time" was used and "sec" part was ignored. On the other hand both "nanosec" and "sec" part of "last time" were used correctly.

Therefore, duration became a negative value with a large absolute value, and as a result, the twist had a small absolute value with the opposite sign.

Solution

Fixed calculation of duration to be correct.