0
$\begingroup$

Rosanswers logo

Hi, thanks for looking at my question:

I'm writing a class to control a Turtlebot. Within this class, I want to measure how many metres the turtlebot has moved, and how many radians it has turned. To achieve this, I have subscribed to "turtlebot_node/sensor_state" whose callback parameter provides delta values for distance and angle.

There's a problem: this callback parameter provides inconsistent delta values for angle radians at low angular velocities. For example, at 0.1 metres per second around the z-axis (yaw), zero radians are returned. I believe this is because the callback only runs at 10Hz.

What I've done now is subscribe directly to the "odom" topic. My callback function is working, but I don't know how to get from the nav_msgs::Odometry struture to useful delta values.

Can someone please help me with the mathematics here?


Originally posted by LogicalUnit on ROS Answers with karma: 1 on 2013-10-04

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The odometry message is the integrated deltas. If you want to compute any delta, just subtract the two poses. You just need to keep track of the initial pose and the final pose to find the distance traveled and angle changed.


Originally posted by tfoote with karma: 58457 on 2014-01-15

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Wentao on 2017-10-31:
I have same problems as above. Could you please give the specific example to describe what you say? I also want to calculate the path length. Thanks!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.