Package frc.robot
Class AprilTag
java.lang.Object
frc.robot.AprilTag
- All Implemented Interfaces:
Comparable<AprilTag>
This class is used to store the pose of the AprilTag relative to the camera.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares one AptilTag to another.Gets the name of the camera.getPitch()Get the pitch of the tag.edu.wpi.first.math.geometry.Pose3dgetPose()Gets the pose of the tag relative to the camera.getRoll()Get the roll of the tag.intgetTagID()Gets the ID of the tag.getX()Get the X position of the tag.getY()Get the Y position of the tag.getYaw()Get the yaw of the tag.getZ()Get the Z position of the tag.toString()Gets string of position values x,y,z and also pose of image.
-
Constructor Details
-
AprilTag
public AprilTag(int id, String camName, edu.wpi.first.math.geometry.Translation3d camVector, edu.wpi.first.math.geometry.Translation3d transVector, edu.wpi.first.math.geometry.Rotation3d rotVector) Constructor for the AprilTag class.- Parameters:
id- The ID of the tagcamName- The name of the cameracamVector- The position of the camera relative to the tagtransVector- The position of the tag relative to the camerarotVector- The orientation of the tag relative to the camera
-
-
Method Details
-
getPose
public edu.wpi.first.math.geometry.Pose3d getPose()Gets the pose of the tag relative to the camera.- Returns:
- Pose3d The pose of the tag relative to the camera
-
getX
Get the X position of the tag.- Returns:
- The
doubleX position of the tag moving to the right and left
-
getY
Get the Y position of the tag.- Returns:
- The
doubleY position of the tag moving up and down, points down
-
getZ
Get the Z position of the tag.- Returns:
- The
doubleZ position of the tag or the forward direction
-
getRoll
Get the roll of the tag.- Returns:
- The
doubleroll of the tag in radians
-
getYaw
Get the yaw of the tag.- Returns:
- The
doubleyaw of the tag in radians
-
getPitch
Get the pitch of the tag.- Returns:
- The
doublepitch of the tag in radians
-
getCameraName
Gets the name of the camera.- Returns:
- The
Stringname of the camera
-
getTagID
public int getTagID()Gets the ID of the tag.- Returns:
- The
intID of the tag
-
toString
Gets string of position values x,y,z and also pose of image. -
compareTo
Compares one AptilTag to another.- Specified by:
compareToin interfaceComparable<AprilTag>- Parameters:
other-- Returns:
- An
intused to compare two AprilTags
-