# Calculating with the back tracking wheels Odometry

When calculating change in position due to strafing, most sources just use:

That is, they use the change in distance with the back motor encoder, find the radius and apply the law of cosines to find the change in x. But when they combine this into one equation, they use the same theta as used for the two side tracking wheels. If you look at where it says
final equations" there is only one theta variable used, for both movement and strafing. Purdue, JAR, Lemlib and other sources seem to do all the same thing. But this makes no sense. The heading for forward and backwards movement has nothing to do with the heading for side to side movement. Why do we then use the same theta value for strafing and movement?

When strafing your theta or heading will not change, only when turning.

Yes it does. They are the same heading, because the robot has turned by the same amount in both cases.

So how do you calculate the strafe change without knowing the angle and only having 1 tracking wheel

why is this? If someone pushed out robot while driving, the change in theta for strafing would be bigger than for just the driving.

That isn’t possible. In those equations the change in heading and change in the back wheel are knowns, and the change in absolute position is the unknown.

but how do we know the change in heading. Of course, from the parallel encoders we know the change in heading is just left - right/distance. But when we start strafing, we only have the back encoder, so how do we know the angle for that arc?

What teambirb said. That’s like a special case and it’s obvious how the robot’s moved if the heading is the same as the previous cycle. You can see that in JAR’s odom code it’s like the only if statement.

Okay, I think I may have the wrong idea of what accounting for strafing means. At the picture above, isn’t the heading of the robot clearly changing? But heading isn’t suppose to change when the robot is “strafing”?

Why not? Nothing stops both from happening at the same time.

I mean look at teambrib’s comment?

Think for yourself a bit. Is it possible to make an arc as shown in the picture you sent with your robot? If so, then the back tracking wheel is changing its position (strafing) and the heading is also changing (turning).

exactly that’s why I was confused by his comment

sorry for the confusion, heading can change while strafing, but only when strafing and turning at the same time