# Odometry Help

At our club we are working on implementing odometry into our autonomous but have no idea of where to start from. Any help would be greatly appreciated.

1 Like
10 Likes

i think okapilib in PROS has some odometery. Correct me if im wrong

1 Like

Combination of a vertical gyro plus motor encoders and some circle geometry should work.

IMU is fine for odometry, but IME is not. The motor itself will influence the raw position reading you’re getting, therefore the input will be biased, resulting in an inaccurate measurement of global position. There is a reason why teams use tracking wheels for odometry.

2 Likes

is the odometry using IQ or V5?

1 Like

IQ has no shaft encoders for Odom…

3 Likes

As to not make another thread, I’ll post my question here:

How would I determine the tracking center of my robot? From what I understand, it should be perpendicularly equidistant from both side tracking wheels, but where should it be placed relative to the third (strafe) tracking wheel? In addition, how should I go about measuring the distance from the tracking center to each tracking wheel? Would I stop my measurement at the wheel or at the shaft encoder?

Right as I’m about to post this, I was thinking, and I’m guessing that the position of the tracking center relative to the strafe wheel would just be the same distance as it is to each side wheel, is that correct?

Much thanks.

1 Like

I believe that the tracking center is the center of rotation of your robot (ex: if you have a tank drive and set one side to move forward and the other side going backward; what point does your robot spin around? That point is the tracking center). The distances from the tracking center to each of the three wheels is computed into the math, so they do not all have to be the same (I think, but I am not sure. Regardless, it would make the math much easier). You would measure the distance from the center of the rim of the wheel (the part that touches the ground) to the tracking center. If you have not read it already, I would suggest you read the Intro to Position Tracking document put out by the Pilons (team 5225A).
This is also my first year setting up an odometry system, so take all the above information with a grain of salt.

3 Likes

The tracking center can be chosen arbitrarily, but motion control using odom is more predictable if you make the tracking center the center of rotation.

6 Likes

Thank you! If I could, I’d like to ask one more question, when measuring the distance from the tracking center to the wheels, would I measure from the center to the physical center of the wheel, or just where the axel goes through the encoder?

I only use two tracking wheels and an IMU, so for me, the wheel distances from the center are completely arbitrary, only deciding where the tracking center is. For this reason, I don’t really give the measurements much thought, I just try to get pretty close. However, if you are using three tracking wheels with two parallel for calculating the angle, the distances from center are pretty important; if they are wrong, your angle calculation will be wrong.

To figure out what the right values are, I recommend experimental tuning:

1. Turn the robot a certain known amount. A bigger turn is better, like 10 rotations, because error will be exaggerated, and easier to see.
2. The robot will have measured the rotation incorrectly. If it was more than expected, the distances to center were too small, if it was less, they were too large. This should be intuitive: the farther the tracking wheels are from the center, the more ticks the encoder will measure for a given turn, because it travels a greater distance. It also makes sense mathematically, because s_L and s_R are in the denominator of the angle equation from the position tracking document ( ∆θ = (∆L - ∆R)/(s_L + s_R)), and a greater denominator leads to a smaller result.
3. Correct the distance values with a ratio between what the rotation should have been and what it actually was.
4. Repeat until you think the angle measurement is accurate enough.

Also be aware that you should follow a similar process for tuning the diameters of the tracking wheels before tuning the center distances. The values VEX tells us for diameter usually don’t measure distance accurately, so it needs to be tuned as well. When I do this, I drive the robot a certain distance forward then adjust the wheel diameter value in my code. The center distances for turning are inversely proportional (because they are in the denominator), while the wheel diameter is directly proportional, because they are in the numerator when calculating distance. So, if the measured distance traveled was greater than it should have been, I decrease the diameter value in the code.

8 Likes

Thank you very much! This helps a lot.

1 Like

Could you give some insight on how you use 2 tracking wheels and the inertial sensor for odom. The 5225 document talks about 3 tracking wheels so I am just confused

Look carefully at the “Tracking Algorithm” section on pages 7 and 8.

ΔL, ΔR, and ΔS are the changes in rotation of each tracking wheel, where ΔL and ΔR are from the left and right (parallel) wheels.

The only time ΔL is used is in step #5 to calculate the new absolute orientation. (It’s also used in step #7, but that is only to check if the robot has not changed rotation by checking if ΔL == ΔR.) For the rest of the calculations, the document says only to use ΔR to measure how far the robot moved in the forward/backward direction. It could just as well use ΔL, but then it would need to account for the fact that the tracking wheel is in a different place on the robot in step #8 by subtracting s_L instead of adding s_R (if I’m remembering this correctly).

Basically, the algorithm doesn’t really need 3 tracking wheels, it needs 1 to measure forward/backward movement and 1 to measure left/right movement, and something to measure angle change. Because this algorithm was developed before the VEX Inertial Sensor came out, the Pilons opted to measure angle with two parallel wheels instead of the gyroscope. Now, however, the inertial sensor is a good replacement for the parallel wheels.

5 Likes

It seems that you are explaining why the left tracking wheel is not needed. However, I am trying to make a solution where the back one (ΔS) is not needed, and I only have the 2 parallels as well as inertial. Is this possible? Or can I only do: 1 right wheel, 1 back sideways, and inertial?

It is completely feasible, but you have to make sure that the robot does not move laterally, otherwise your calculations will be wrong.

Is it possible for the vertical tracking wheel to be directly placed in the center of the robot?

Yeah, you can kind of place it wherever you want.

So I will just have the right track distance set to 0 since its at the turning point already