# How can I calculate odometry given two poses?

I have the pose at times t - 1 and time t. We are given: that the the new pose, at time t, is

$$x_{t - 1} = [0,0,pi/6]$$ $$x_{t} = [0.2,0.1,(11*pi)/60]$$

(Where the vectors are [x, y, theta] with respect to some world frame.)

In my head, I have the two poses. I just need to calculate the difference of the two and that'll be odometry, right? So, subtracting the two vectors: [0.2,0.1,(11*pi)/60] - [0,0,pi/6] = [.2, .1, pi/60]

However, according to the answer checker that doesn't seem to be the right approach. Can someone suggest a strategy to go about this?

• What is your robot, and what do you mean by odometry? In general, you can’t get odometry from poses without a motion model — e.g., did you get between the poses by sliding and spinning, by driving with constant turning and forward velocities, or take a more meandering path?
– RLH
Apr 1, 2020 at 22:42
• If you are just trying to find the difference in poses w.r.t. time, the do as you have done and divide by the change in time. Odometry is a term typically applied to two different processes. You are getting at one, but @RLH is getting at the other, which is that odemetry information is used to estimate position. Apr 3, 2020 at 21:16
• @koverman47 I've only ever seen "odometry" in the sense of mapping actuator motions through physical constraints to vehicle-body motions. If there's another sense of "odometry" floating around, I'd very much like to know what it is -- do you have a reference you can point me at?
– RLH
Apr 4, 2020 at 1:14
• (There is also "visual odometry", but that just replaces the "actuator velocity -> constraints -> body velocity" sequence with "observed visual flow -> constraint that world elements are rigidly fixed to each other -> inferred body velocity" sequence, and doesn't incorporate direct pose measurements)
– RLH
Apr 4, 2020 at 1:26

Those POSEs are not 3D vectors or a 3D coordinate point. As such you can't subtract.

A pose is a state vector, and the last value is an angle.

From this, how can you calculate odometry?

• So using the distance, would the x-cord be 0.2236*cos(pi/60), y-cord = 0.2236*sin(pi/60), and theta = pi/60? Apr 1, 2020 at 19:55

Assume you are in a 2D grid.
At time x(t-1), we have the first pose as p_1 = [x_1, y_1, theta_1] and
at time x(t), we have the second pose as p_2 = [x_2, y_2, theta_2].

The distance traveled could be calculated using the Euclidean distance formula as in your case would be:

Distance = Sqrt[(0.2-0)^2 + (0.1-0)^2] = 0.2236.

And the angle traversed would be the difference between theta_2 and theta_1, so we have theta = Pi/60.

• So using the distance, would the x-cord be 0.2236*cos(pi/60), y-cord = 0.2236*sin(pi/60), and theta = pi/60? Apr 1, 2020 at 17:39