Odometry Code?

Here’s a desmos graph I made a while ago which shows how my team did odometry last year:

Keep in mind that odometry uses basic trigonometry, so if you still don’t understand it you should try learning that first.

This version of odometry assumes the robot moves in straight lines, but it works good enough if you run it fast enough (we ran it every 10 milliseconds). The pilons document explains doing odometry using arcs which I think is more accurate, but my team hasn’t been able to compare them a lot yet.

Your best focus is probably less advanced paradigms like PID, until you are able to read and comprehend the Pilons document.

A simple version of odometry (2 tracking wheels perpendicular to each other and an IMU) finds the local x and y distance traveled then uses some trig and the IMU angle to translate the local x and y into global x and y change. By summing up all these change we can get a pretty good idea of where our robot is.

For anyone looking at this in the future, please use the version of the pylons doc on the BLRS wiki, as it contains some fixes to mistakes in the original doc that can cause lots of pain.