https://github.com/ros-controls/ros2_controllers/blob/a09e7af552c873ce29940b10167af99568252fb2/diff_drive_controller/src/odometry.cpp#L81C26-L81C34
I've noticed that the Odometry::updateFromVelocity
function calculates linear displacement using the following formula:
linear = (left_vel + right_vel) * 0.5
While this correctly calculates the average linear velocity, it might not be directly equivalent to linear displacement without considering the time interval (dt
) between measurements.
It's worth double-checking this calculation.