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.

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

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.

is the odometry using IQ or V5?

IQ has no shaft encoders for Odomā¦

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.

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.

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.

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:

- Turn the robot a certain known amount. A bigger turn is better, like 10 rotations, because error will be exaggerated, and easier to see.
- 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.
- Correct the distance values with a ratio between what the rotation should have been and what it actually was.
- 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.

Thank you very much! This helps a lot.

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.

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