Glossary

Fiducial marker (AprilTag)

Fiducial marker (AprilTag) – definition

An AprilTag is a square, visual fiducial marker designed for reliable detection and six-degree-of-freedom pose estimation from a calibrated camera image. It consists of a black border, an encoded binary pattern, and typically a white outer margin or contrasting background. The encoded pattern identifies the tag, while the known physical size of its square enables metric pose estimation.

In mobile robotics, an AprilTag provides a known visual reference between a camera frame and a physical object, wall, docking station, calibration target, or map location. A UGV can use this reference to estimate its position relative to infrastructure that has fixed and surveyed tag poses. AprilTags are commonly used for local localization correction, autonomous docking, repeatable waypoint alignment, sensor extrinsic calibration, and experiment setup validation.

AprilTag is a family of tag encodings and detection algorithms originally introduced by Edwin Olson in 2011. Later implementations include AprilTag 2 and AprilTag 3. AprilTag 3 is documented by Krogius, Jankowski and Olson and improves detection throughput and robustness for several tag families.

How AprilTag pose estimation works

An AprilTag detector processes an image, finds quadrilateral candidates, decodes the internal bit pattern, and matches it against a configured tag family. After decoding, the detector estimates the tag pose using the camera intrinsic parameters and the known marker size.

The estimated transform is commonly expressed as:

T_camera_tag = [ R  t ]
               [ 0  1 ]

Where R is the 3 × 3 rotation matrix and t is the position of the tag-frame origin expressed in the camera frame. In this convention, T_camera_tag transforms coordinates from the tag frame into the camera frame. Pose estimation requires:

  • a calibrated camera model, including focal lengths and principal point,
  • a declared physical tag size in metres,
  • an image in which the marker border and encoded cells are sufficiently resolved,
  • a detector configured for the correct tag family.

The tag size is not optional metadata. If the configured size differs from the printed marker size, the estimated translation scale will be incorrect. The configured dimension must use the convention expected by the detector, typically the edge length of the black tag border rather than any surrounding white margin. For example, a tag with a 0.16 m black-border edge length must be configured as size: 0.16 in a detector configuration that expects metres.

AprilTag families and identification capacity

A tag family defines the internal bit layout, number of valid IDs, and minimum Hamming distance between codewords. The Hamming distance determines the theoretical number of bit errors that can be detected or corrected during decoding. Tag family selection must match the physical markers used in the environment.

Tag family Key property Typical use Source
tag36h11 587 valid codes, minimum Hamming distance of 11 General robotics experiments and fixed infrastructure AprilTag reference implementation
tag25h9 Smaller code grid with 35 valid codes and a minimum Hamming distance of 9 Applications requiring relatively few IDs or lower-resolution tag decoding AprilTag reference implementation
tagStandard41h12 AprilTag 3 family with 2,115 valid codes and a minimum Hamming distance of 12 Systems requiring a larger identifier space AprilTag 3 source repository

A larger marker generally remains detectable at a greater distance because it occupies more pixels in the image. Detection range cannot be specified from tag size alone. It depends on camera resolution, focal length, lens distortion, exposure, motion blur, viewing angle, illumination, and detector settings.

AprilTags in ROS 2

ROS 2 does not define a single normative AprilTag message type or detector package. Integrators commonly use a ROS 2 wrapper around the upstream AprilTag library. The wrapper usually subscribes to sensor_msgs/msg/Image and sensor_msgs/msg/CameraInfo, then publishes detections and transforms.

For coordinate frames, a ROS 2 system should follow REP 103 and REP 105. REP 103 defines the optical camera frame convention as z forward, x right, and y down. REP 105 defines common mobile robot frames such as map, odom, and base_link.

An illustrative, package-specific configuration might look like:

apriltag_detector:
  ros__parameters:
    family: tag36h11
    tag_size: 0.16
    image_transport: raw
    camera_frame: camera_color_optical_frame
    tag_frames:
      tag_0: tag_0
      tag_1: tag_1

The exact parameter names, topics, and output messages vary between ROS 2 packages. Before connecting detections to a navigation or localization pipeline, verify whether the package publishes geometry_msgs/msg/PoseStamped, a package-specific detection array, or tf2 transforms. Also verify transform direction. Some nodes publish camera-to-tag transforms, while an application may require tag-to-camera or map-to-base_link transforms.

Use on Leo Rover and Raph Rover

On Leo Rover, AprilTags are useful as external references for indoor experiments where wheel odometry accumulates error. Leo Rover has a differential-drive base and can be integrated with ROS 2. A camera mounted on the platform can detect fixed tags at docking points, corridor intersections, charging locations, or calibration boards.

A practical ROS 2 transform chain for a Leo Rover setup is:

map -> tag_12 -> camera_color_optical_frame -> base_link

If the pose of tag_12 in map is known and the camera-to-base extrinsic transform is calibrated, the detected tag pose can provide a robot pose observation. The camera-to-tag pose reported by a detector must be inverted when constructing a tag_12-to-camera transform in this chain. This observation can be fused with wheel odometry and IMU data using a state estimator. It should not replace odometry without handling intermittent visibility and measurement covariance.

Raph Rover can use the same method when carrying heavier sensor payloads or a protected compute enclosure. In larger outdoor or semi-structured sites, tags are usually most useful near repeatable locations rather than as a replacement for GNSS, RTK, LiDAR localization, or visual-inertial odometry across the full route.

Limitations and integration considerations

AprilTags are visual landmarks. They fail when the marker is occluded, heavily blurred, overexposed, damaged, outside the camera field of view, or too small in the image. Low viewing angles also reduce the accuracy of planar pose estimation. A tag’s printed dimensions should be measured after printing and mounting, particularly when paper, adhesive, or protective lamination changes the usable border.

For reproducible UGV experiments, record the following configuration data:

  • tag family and ID,
  • measured tag edge length in metres,
  • camera calibration file and image resolution,
  • camera-to-base_link extrinsic transform,
  • fixed tag pose in the map frame,
  • detector version and ROS 2 package version.

Normative references and technical sources

The following sources define the coordinate conventions and technical background relevant to AprilTag integration in ROS-based mobile robots.

See also