Hello, we have one tracker odom on our robot (just the forward tracker) and I was looking through the odom code in the JAR template and got confused on the part of the code shown in the screenshot.
Why is it being converted to polar coordinates and then back to cartesian coordinates? I noticed that it does make one tracker odom work, but I don’t quite understand why that is.
atan2(y_position, 0)
always returns 90 degrees, and the local_polar_length
is always just equal to local_Y_position
. How are these values used then to get the X coordinate of the robot with just a tracker on the Y axis?
Also, is the global_polar_angle
variable meant to just get the angle of the vector from (1, 0) as shown below?
Thank you for the help.