Odom For IQ

I am trying to learn how to use odometry in VEX IQ and I am a bit confused about where to start.

I understand that odometry is used to track the robot’s position on the field by using sensor data, but I have a few questions:

  1. What sensors are normally used for odometry in VEX IQ?

  2. Can odometry be done using only motor encoders, or do I need additional sensors?

  3. How do you calculate the robot’s X and Y position as it moves?

  4. Is there a simple example or tutorial that explains the maths behind it?

  5. Is odometry accurate enough for autonomous runs, or should it be combined with other sensors?

I am using VEXcode IQ and would appreciate any code examples, diagrams, or explanations that could help me understand how it works.

Normally, odometry isn’t used in VEX IQ. The sensors aren’t that great, wheel encoders don’t exist, and the walls are too low for many robots to properly use odometry.

Still there? Great! So while everything I said above is true, there’s one more method: motor rotation. Assuming you have a wheel in the DEAD CENTER of your robot (let’s be honest, you probably don’t, but this is transferring over from V5 where you have encoders), you can track your X position using basic trigonometry: the adjacent side (change in X) is equal to the distance you’ve traveled times the cosines of your current gyro rotation. Apply this to Y as well, and you should have a position tracking method that’s reliable (its important to note that I’ve only been applying math I know to this, I haven’t been able to test it yet. Good luck!

Side note I forgot to mention: the reason teams in IQ don’t really use odometry is because this method is prone to becoming out of tune, as wheel slippage is an issue. To explain what wheel slippage is, imagine a car that isn’t moving. If the car goes from 0 to 65 mph, there will be a moment where the wheels are spinning but the car isn’t moving at the proportional speed. If this happens with your robot, it will believe it is moving when it isn’t.