# A few questions about Team 5225 Position Tracking Document

While I’m not great at math, I have learned (and stumbled) my way through the math on 5225’s position tracking document. I’m stuck at a few parts. For equation 6, why is it 2rsin(θ) and not 2rsin(Δθ). How I understand it is that the equation is calculating the chord of the circle created by the arc of the perpendicular tracking wheel and concentric with the center of the robot’s tracking wheels. Therefore, when the change in position is calculated, it should be using the change in angle, not the absolute angle.

In step 9, why do you have to calculate the average angle? Up until this point in the algorithm, the position tracking will have been using the change in angle. Why can the change in angle not just be added to the absolute angle?

Last question: for step 10 how do you include the change in x, change in y, and change in angle in the conversion to polar coordinates. I understand that it would be possible to use y as r and the angle as θ, but how is x included?

I’m not looking for any code, just some help with the theory behind the math. Thanks.

1 Like

Polar coordinates are in the form (r, θ) and Cartesian Coordinates in the form (x, y)

To convert from r to x:
x = r × cos( θ )

To convert from θ to y
y = r × sin( θ )

Hope that helped

3 Likes

I believe equation 6 should be 2rsin(Δθ)

My understanding of average orientation is the direction that the robot moved, which has nothing to do with the orientation of the robot. Think about the starting point and the ending point of the robot’s translation. It is the angle of the line drawn directly between the two.

https://images.app.goo.gl/zLQVcmijKHWT8UhD9

This picture might help with the Cartesian-polar conversion

1 Like

I think I’m misunderstanding what average orientation means. I’ve tried to look it up but I can only find scholarly articles, which make it more confusing. If it is just meant to calculate the direction the robot moved but in step 10, it is used as θ in the polar coordinates, how is the new orientation ever included in the new position?

The polar coordinates (r, 𝜃) do not represent the location of the robot, they represent the distance ( r) and direction (𝜃) the robot moved from the point where it was last. The reason 𝜃𝑚 is used as 𝜃 in (r, 𝜃), is because that is the direction (angle) of the line from the point where the robot was, to the point where the robot is now.

Why does this work? Imagine the robot on the right side of the circumference a circle. Now imagine the robot moving around 1/4 of this circle (or 90 degrees or pi/2 radians), so that it is at the top of the circle. If there were two points, one at the starting position of the robot, and one at the ending position of the robot, imagine a right triangle between these points, and the center of the circle. Both legs of this triangle are the same length (the radius of the circle), which we can recognize as a special right triangle, with angles of 45, 45, and 90 degrees. You may notice now, that the angle to the from the starting point to the ending point is half of the angle the robot rotated (90 degrees). This idea will always be able to get you the direction of motion (𝜃), not just with special right triangles, and it could be implemented different ways.

How is average orientation calculated? From the document: 𝜃𝑚 = 𝜃0 + Δ𝜃/2 (m,and 0 should be subscript, it just didn’t copy correctly). 𝜃0 is the orientation of the robot at the last point, and Δ𝜃/2 is half of the recent change in angle. This boils down what I was talking about before: the direction the robot moved.

Average angle is included in the polar coordinates, because 𝜃 in (r, 𝜃) is the direction the robot moved, or, the average orientation. Remember, this is not where the robot is, it is how far (and in what direction) the robot moved, and that is why it ends up being changed into Cartesian coordinates. The new orientation has nothing to do with the location, or average orientation of the robot. It can always be calculated with equation 4 in the document, no matter where the robot is.

Edit: formatting

4 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.