Open Sourcing AprilTag position estimation library

Hi all, our team (3642C) built an AprilTag position estimation library for our own use but we saw a couple people asking how to do it on the forum so we figured we’d just open source it.

It’s tuned for the AI Vision sensor so you can see an apriltag and get back 3d coordinates and rotation in realtime, the constants are set for the AI Vision sensor lens and the tags on the goals for Override already, just check the example code and get rockin’ with it!

It’s brand new and I’ve never made a library for this before so lmk if there are any issues!

A couple of comments

Add a license to your repo so users know what they can do with the source and any modifications they may make.

Not sure where this came from

tag_size 0.0381 Physical tag width in meters (1.5 inches)

We consider the tag size to be about 18mm (inside edge of the black square)

As I said before, there are two sensor versions with different effective fov, anyone using the library should be aware of that.

and remember, code should reflect the skill of the team, so teams using this should also research how the code works and the math behind it.

Oh I didn’t realize that there were two, I sourced my info from Here , the 1.5in is from the outside edge to the adjacent one (just with a ruler), for what it’s worth the code has been working accurately on our vision sensor!

Is there a way to get the current FOV from VexOS or PROS so those calculations can be done programmatically?

The underlying math is based on the AprilRobotics library which is BSD-Clause 2, I’ve added that already.

I had left it up to the user to read through the library and understand it, same vain as lemlib or EZ-template in my mind.

Thank you for the feedback - trying to get into open source development so any help i can get is appreciated

sure, and you kept copyright notice as required.

but pros_pose.cpp is not their code, it’s yours (and I’m sure some other files), that needs the license.

Not at this time, future VEXcode SDK, so perhaps teams using PROS will just have to test their aivision sensors and adjust accordingly.

Sure, I’m just pointing out that VEX (I guess that’s me) uses the quadrilateral where we draw the outline of the apriltag on the V5 dashboard and vision utility as the place where the size of the tag is measured. I’m not saying you should change your calculations, just our documentation at some point will probably use the 18mm number.

Awesome! Thanks, I got the chance to confirm the tag size with our builder and it is 18mm… whoops!

Should be fixed by the time this gets reply approved

I was literally just about to start on making this myself! What luck to see that someone has already done it!

It’d be great if, instead of passing in a 2d array of corners into the pose_estimator, you could just pass the tag itself in by reference and have all of the corner work done within the library. Not a necessity, but something to make the syntax more concise.

Hey good point, I’m refactoring a ton of our codebase right now so it might happen..

Hopefully it works well for you, let me know if there are any issues :slight_smile: