Class AprilTagFieldLayout

java.lang.Object
edu.wpi.first.apriltag.AprilTagFieldLayout

public class AprilTagFieldLayout
extends Object
Class for representing a layout of AprilTags on a field and reading them from a JSON format.

The JSON format contains two top-level objects, "tags" and "field". The "tags" object is a list of all AprilTags contained within a layout. Each AprilTag serializes to a JSON object containing an ID and a Pose3d. The "field" object is a descriptor of the size of the field in meters with "width" and "length" values. This is to account for arbitrary field sizes when transforming the poses.

Pose3ds in the JSON are measured using the normal FRC coordinate system, NWU with the origin at the bottom-right corner of the blue alliance wall. setOrigin(OriginPosition) can be used to change the poses returned from getTagPose(int) to be from the perspective of a specific alliance.

Tag poses represent the center of the tag, with a zero rotation representing a tag that is upright and facing away from the (blue) alliance wall (that is, towards the opposing alliance).