Does ROS Navstack use the Twist part of the Odom message
The nav_msgs/Odometry
message type contains the Twist
as well as the Pose
message types. Generally odometry only means the Pose
i.e. the position and the orientation of the robot. Does ROS NavStack use this Twist
in the nav_msgs/Odometry
message to control the velocities? Or does it just refer to the Pose
part of the Odom
message?
EDIT :
I started analysing the source code of base_local_planner
(1 and 2) and I noticed that it only the Twist
part of the message is being used. Now, this is confusing me even more as the stack should use the position and orientation (Pose
) of the robot to correct the velocity commands being sent to it.
Can someone explain where exactly I'm going wrong?
Thanks
Asked by electrophod on 2022-02-10 23:10:53 UTC
Answers
The ROS navigation stack has two different functions: 1) estimate where the robot is, and 2) given a goal, move the robot to that goal. These two are mostly independent of each other. Odometry is in (1), so that Twist does not directly have anything to do with moving the robot - it's merely an estimate of what the robot is doing right now (position and velocity).
The Local Planner is in (2). It sends Twist messages to a "controller", which after another calculation, results in the robot wheels turning. This Twist message is not taken directly from the Odom message. Instead, part of the job of the Local Planner is examine the difference between its next-internal-short-term goal and the current odometry, and decide on a new Twist msg to publish. For a robot with wheels, typically Local Planners do this about 5 times per second.
Asked by Mike Scheutzow on 2022-02-13 11:12:34 UTC
Comments
Another side question is that does ROS Navstack have the feature of velocity control? Does it make sure that the robot moves with the velocity it told to go?
Asked by electrophod on 2022-02-11 00:05:36 UTC