AprilTags - which packages to use and how to generate / where to buy

For context, AprilTags are a fiducial system that can be used both for IDs (similar to a QR code) and determining relative positions (i.e., they were specifically designed to maintain accuracy with this task).

Ideal specifications:

  • something close to a one-click order
  • adhesive backing, which is removable (OK if it takes a bit of effort)
  • three sizes (i.e., “small, medium, large”) (can also base it loosely off of Hiwonder’s defaults)
  • rigid
  • chemical compatibility becomes a consideration. I think I had looked into this a fair bit, but I’m having trouble finding where I put those notes. Maybe better if this is done through a lamination rather than trying to get it printed directly on

In terms of choosing a tag family:

For the vast majority of applications, the tagStandard41h12 family will be the correct choice. You can find the images for the tags in the apriltag-imgs repo. Scale up the images in your favorite editor and print them out.

Some heuristics for when to choose other tag families:

  1. If you need more tags, use tagStandard52h13
  2. If you need to maximize the use of space on a small circular object, use tagCircle49h12 (or tagCircle21h7).
  3. If you want to make a recursive tag use tagCustom48h12.
  4. If you want compatibility with the ArUcO detector use tag36h11

If none of these fit your needs, generate your own custom tag family here.

It seems apriltag-imgs/tagStandard41h12 at master · AprilRobotics/apriltag-imgs · GitHub has ~1115 images (2 at the start were other files). However, it wouldn’t be so bad to print other tag sets in that repo. For example, apriltag-imgs/tagCircle49h12 at master · AprilRobotics/apriltag-imgs · GitHub and apriltag-imgs/tagCustom48h12 at master · AprilRobotics/apriltag-imgs · GitHub (note: these are on the order of ~50000 files, but I could only print the first 1000 for example).

In terms of scaling to different sizes, the image repository also says:

Alternately, you can use the supplied native Python 3 script tag_to_svg.py to create a SVG (Scalable Vector Graphics) Version of a tag. For example:

python3 tag_to_svg.py tagStandard52h13/tag52_13_00007.png tag52_13_00007.svg --size=20mm

Some vendors based on Google Search

Likewise, in terms of AprilTag software, there is the official one which requires some manual installation:

Or a non-official, but pip-installable version: pupil-apriltags 1.0.4.post9.dev1+gfff8536 (which could be a reasonable version)

It would be awesome to have a pip-installable version attached with the main repo, though.

EDIT: GitHub - duckietown/lib-dt-apriltags: Python bindings to the Apriltags library provides Python bindings for the official repo (and is even mentioned in the official repo README), but it’s pinned to a 2021 version of apriltags and hasn’t been updated since 2023.

Also worth noting perhaps that there are some more recent implementations of AprilTags (I think on the official repo) that are annular (i.e., could be put around a vial).

It would probably help to compile a list of some adhesive label printing services that have decent chemical compatibility. As an aside, I bought a label printer that comes with a Python API with the intention of setting up an inventory system that auto-prints AprilTags as new items are added