Skip to main content

WPIcal (infused with holiness)

Here are the docs I will be mostly referencing on this page:

https://docs.wpilib.org/en/stable/docs/software/wpilib-tools/wpical/index.html 

WPIcal is a tool made by the ever-lovely Worcester Polytechnic Institute based off of Cow-libration (see future pages) that help your robot understand where it is and account for small variations in tag placements.

Calibrate your camera

Start by filming a video with your camera of a ChArUco board (with an odd height if you choose the OpenCV option) making sure to capture various angles to ensure proper calibration.

Example video: Video of online ChArUco board to calibrate camera

A ChArUco board can be generated from this link: calib.io

After filling out all the fields on WPIcal and selecting Calibrate, check the video displayed and if any squares aren’t detected or there’s other weird looking stuff film your video again.

Film your videos

When filming videos of the field, you need at least two AprilTags in each video, and it is preferred if there are more. Don’t sacrifice quality for quantity though, you want WPIcal to still identify the tags you’re filming.

Make sure to always “connect” your videos by having tags in common between them. For example, if your first video is of tags 1, 2, & 3, your next video should include at least one of those three days so the relative distances can be calculated. 

Calibrate each pinned tag

Pinned tags are the ones most visible by the camera and the ones you are the most confident in. We recommend sorting your videos into folders based on the pinned tag and calibrating those folders individually before combining all the field calibrations.

Before uploading the ideal field map, double check what type of field (ie. AndyMark or welded) is being used at the competition or field you’re calibrating. 

You can select which tags are calibrated using the field calibration of WPIcal if only some AprilTags are needed to be more accurate. 

After the calibration, select “Visualize calibration” to compare your tags and check that there aren’t crazy differences between the original position and the calibrated position.

Finally, take the final field calibration json and put it in your code to use!