ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can calculate between each odometry message the distance traveled by the robot with the formula :
dist = sqrt(dx² + dy²)
With dx = new_x - old_x
and dy = new_y - old_y
. So you have to save the previous odometry value and calculate the dx
and dy
after each odometry message received (or maybe each seconds instead).
2 | No.2 Revision |
You can calculate between each odometry message the distance traveled by the robot with the formula :
dist = sqrt(dx² + dy²)
With dx = new_x - old_x
and dy = new_y - old_y
. So you have to save the previous odometry value and calculate the dx
and dy
after each odometry message received (or maybe each seconds instead).instead). And then you add each dist
to get the total distance.