Best way to get Turtlebot's current velocity?
Hello all,
What's the best way to get the current velocity of the turtlebot?
I saw that I could listen to the Odom messages directly, or ask tf to getTwist(). Which method will give me the most accurate estimate? Or is there another way that's better?
Update
I'm doing SLAM on a known map, so I have localization information.
What I ended up doing
Here's what I ended up doing after some trial and error. This example is using the tf_tutorials, but the real robot is similar. Just change "turtle" to "base_link" and "world" to "map". "lin" has the linear acceleration and "ang" has the angular. The velocity is relative to the world frame.
(trans, rot) = listener.lookupTransform('/world', turtle, rospy.Time(0.0))
(lin, ang) = listener.lookupTwistFull(turtle, '/world', turtle, (0,0,0), '/world', rospy.Time(0.0), rospy.Duration(0.1))
Thanks in advance, -Brian