Odometry(libraries, docs, etc.) for VEX IQ

Sorry if my writing is bad, since this is my first time putting anything on the VEX Forum.

I’ll be blunt about it; I’ve been looking for anything about odometry for VEX IQ for a few weeks, and all I’ve found are libraries, forum posts, etc. for V5. Does anyone know of anything like the JAR-Template or Okapilib for VEX IQ?(yes, I read the Pilons doc). Sorry again if I’m missing some critical thing about IQ motors or encoders or something. Thanks for helping.

1 Like

There was another thread not that long ago where someone was asking about it, so you should be able to search and find it.

Vex IQ doesn’t have much in the way of odometry at this point because of the limited sensors available, and the competition limit on motors.

At present, you can only really track movement with a motor, and 6 motors is the limit, whether they’re powered or not. There are no shaft rotational-type sensors or other encoders available.

Theoretically, you could rely on the motor encoders that are moving the drivetrain motors, but if you can trust them, then the need for odometry complexity is probably largely offset, since you can use other methods to calculate/drive position.

1 Like

Also, if there’s a reason that nobody’s replying please tell me so I can ask my question better next time. Thanks.

I don’t think it’s possible to actually do odometry because VEX IQ has no rotation sensors, I guess you could use a motor, but that’s a waste. Unfortunately you have to stick with simple PID for now :l

Don’t want to sound rude, but what other ways are there to track position/drive to a point?

Note, I am not an odometry expert, I know the basics of it, so requisite grain of salt should be assumed here.

V5/U/AI have more sensors to use, primarily to my knowledge shaft rotary encoders that can tell how much a shaft has rotated, within a certain amount of error in degrees. These are attached to axels that are attached to wheels without a motor, typically in X & Y planes to be able to independently track distance, without the drivetrain causing error (via gear backlash, gear slips, or other causes). Since these move independently, you have a much more true accounting for where you are.

IQ doesn’t (at this point) have that type of sensor, so the closest you’re going to get for IQ will be to use the motor encoders in the drivetrain. Again, unless you want to sacrifice 2 of your 6 motors, put in coast mode, to use as your tracking wheels; maybe it’s doable with pneumatics as a PTO to let your last two motors switch between multiple functions, but seems like it would be a massive disadvantage to me.

The only other way I see you having a relatively more “true” sense of where the robot is on the field would be to use a distance sensor to try to keep track of where you are. I’m sure someone could do the math to make it happen, but I’m not sure if the IQ brain has enough horsepower to do all the math at a fast enough rate to make it work.

4 Likes

What about the values of the brain inertial do those work for odometer on IQ ?

1 Like

There are lines on the field tiles that can be used for position.

2 Likes

You can also use distance from wall, but it is kinda unreliable in teamwork and only works in auton skills.

Hi,

You can absolutly do odom on a IQ robot (not sure about the processing / multithread ability). The only thing required for odom is a change in rotation from a wheel on the robot and a brain. If you want to see the math Pilons has a paper that’s linked to in the blrs wiki and you can also go to a template such as Ez template, Lemlib, or Jar Template to see a code implementation.

The basic idea is that you use the distance traveled by the wheel to calculate a vector of travel (basically how far the robot moved relative to the robot), then rotate that travel vector so it is aligned with the global frame of the field. Doing this at small timestamps (10msec in the case of v5) and adding up all of vectors will give a approximation of the position of the robot. Some implementations will add features like using two parrellel wheels to find the angle change, and a chordlength calculation so the vector from the wheel fits the path actually travelled a little better.

Things to keep in mind:

  • If you are doing odom in iq I’d suggest using a set of rubber wheels so you don’t slide sideways (hard to track without being holonomic becuase you can’t run a dead wheel like they do in v5).
  • Having a chain based drive (was common when I did Iq) could add lots of slope into the odom, making it very inaccurate.
  • Prolly best to code in text cause OOP is very nice for odometry.
  • Idk how well multithreading on the iq brain (especially with V2 brain) works so actually executing a seperate odom thread + the code to use odom while driving might not be very effective.

Gl with your adventures, may they bring you glory,

Andrew - 2131H

2 Likes