Odometry Code?

Hello,

I am relatively new to C++ and want to know how to create odometry for my robot for next year. I know what it is and how the concept works, however, I do not know how to implement it into a vex v5 pro project. Is there a tutorial that covers this specifically, or a step-by-step guide that explains it?

1 Like

While I’m sure that there are resources showing you exactly how to create this code, it will be a much better learning experience for you to create it on your own. Here is a video that really helps explain the concept:
REX 1727B - Robot Position Tracking - Vex Nothing But Net - YouTube

Once you fully understand the concept, try to derive the math equations required to make odometry, then implement it in code. Following a guide that shows you how to make the whole thing will teach you close to nothing.

5 Likes

The pilons guide is the closest to step to step you’re going to get. The dawgma article while for pure pursuit contains a simplified version of odometry (with the formula) in the beginning. Like @Electrobotz said, a complete step by step tutorial will teach you close to nothing.
Articles

2 Likes

This is an extremely underrated video that explains the concept pretty clearly. You can use this along with the other linked resources to start an implementation. Intro to Odometry, Part 1 - YouTube

I’d also suggest doing some searches around GitHub if you’re looking for references. People publicly post their programs there, and they’re very valuable for learning from.

2 Likes

Also: I made this guide a while back, although its an extremely basic implementation that doesn’t take into account sideways motion. This only works on tank drives and might drift over time (especially if you only use omni-wheels):

1 Like

Use PROS and use Okapi! There are built-in odometry libraries in Okapi that make it much easier to program and use.

1 Like

You can do this, but you should keep in mind that Okapi is both abandoned and doesnt support a lot of modern odometry setups (such as using an IMU). It’s also notoriously a pain to setup properly for a lot of people.

2 Likes

Im using vex code at the moment. But Is there a Odometry library in Pros?

There are libraries for both PROS and VEXcode

1 Like

Here’s a template that has odometry Introducing JAR-Template: A Vexcode Pro Library featuring Custom PID and Odometry

1 Like

lemlib for PROS
it has pure pursuit as well

1 Like

oh wow, i had no idea Okapi wasn’t updated anymore, and in my experience it was easy to set up but if there’s anything better then what would you suggest?

Where do I find the library for vex code?

IDK about a vex code library but tbh it’s summer, I recommend just learning about it and creating your own code, for me I created Odom with about 20 lines of code including the initializing of the Odom variables and such. Personally, I think the Pilons document is great however I think they also overcomplicate it. If you’re fine with it I don’t mind teaching you myself how to do Odom

1 Like
2 Likes

Tutosingenieria has a really easy to follow video on the math that I would recommend for code. In terms of on the bot i would recommend puting the encoders on unpowered wheels to reduce slipping errors.

Do you think that you could teach me how to do to Odom because everything else I’ve seen makes no sense?

http://thepilons.ca/wp-content/uploads/2018/10/Tracking.pdf

1 Like

I looked at that and I didn’t understand. I’m in MS and it was really the math that got me confused and I was wondering if somebody could verbally explain it to me?

If you are in MS I am not sure if you will be able to understand it. Have you taken Geometry yet? If not, try to learn about sine and cosine functions. There is another document which is simpler that is on my laptop, I will send it tomorrow.

2 Likes