class frc_apriltags.Utilities.AprilTag(id: int = 0, pose: Pose3d = Pose3d(Translation3d(x=0.000000, y=0.000000, z=0.000000), Rotation3d(x=0.000000, y=0.000000, z=0.000000)))

Bases: object

Use this class to generate an object with the properties of an AprilTag.

Parameters:
  • id – The id of the AprilTag.

  • pose – The Pose3d of the AprilTag.

classmethod fromDetailed(id: int, x: float, y: float, z: float, roll: float, pitch: float, yaw: float)

Constructor for the AprilTag class.

Parameters:
  • id – The id of the AprilTag.

  • x – The x offset in meters.

  • y – The y offset in meters.

  • z – The z offset in meters.

  • roll – Rotaton around the tag’s z axis in radians.

  • pitch – Rotation around the tags’s x axis in radians.

  • yaw – Rotation around the tag’s y axis in radians.

classmethod fromMatrix(id: int, x: float, y: float, z: float, rMatrix)

Constructor for the AprilTag class.

Parameters:
  • id – The id of the AprilTag.

  • x – The x offset in meters.

  • y – The y offset in meters.

  • z – The z offset in meters.

  • rMatrix – The 3x3 Rotation Matrix.

classmethod fromPoseComponents(id: int, trans: Translation3d, rot: Rotation3d)

Constructor for the AprilTag class.

Parameters:
  • id – The id of the AprilTag.

  • trans – The Translation3d of the AprilTag.

  • rot – The Rotation3d of the AprilTag.

classmethod fromQuaternion(id: int, x: float, y: float, z: float, q: Quaternion)

Constructor for the AprilTag class.

Parameters:
  • id – The id of the AprilTag.

  • x – The x offset in meters.

  • y – The y offset in meters.

  • z – The z offset in meters.

  • q – The 4x4 Quaterion.

getId() int

Gets the id of the given tag.

Returns:

The id of the AprilTag.

getPose() Pose3d

Gets the pose of the given tag.

Returns:

The Pose3d of the AprilTag.