setCameraOffset

open fun setCameraOffset(forwardFromCenter: Measure<Distance>, leftFromCenter: Measure<Distance>, rotationOnRobot: Measure<Angle>): AprilTagPoseEstimator

Set a robot-relative offset of the webcam from the center of your robot, facing towards your defined robot's forward. This offset will be used to generate a more accurate pose estimate, as camera rotation and translation on a robot will impact the accuracy of the pose estimator.

If you do not call this method, your camera will be assumed to be at the center of the robot, facing forward. Note that the rotation offset is only used when paired with the heading estimator (see setHeadingEstimate).

Return

this

Parameters

forwardFromCenter

the forward (Cartesian Y) distance from the center of the robot to the camera, extending outwards FORWARD looking top down with your robot facing forward

leftFromCenter

the lateral (Cartesian X) distance from the center of the robot to the camera, extending outwards LEFT looking top down with your robot facing forward

rotationOnRobot

the angle at which, increasing ANTI-CLOCKWISE, your camera is pointing relative to your robot facing forward


open fun setCameraOffset(poseInchRad: Pose2d): AprilTagPoseEstimator

Set a robot-relative offset of the webcam from the center of your robot, facing towards your defined robot's forward. This offset will be used to generate a more accurate pose estimate, as camera rotation and translation on a robot will impact the accuracy of the pose estimator.

If you do not call this method, your camera will be assumed to be at the center of the robot, facing forward. Note that the rotation offset is only used when paired with the heading estimator (see setHeadingEstimate).

Return

this

Parameters

poseInchRad

an inches vector and radians pose conforming to the requirements as met by setCameraOffset, listed below.Pose X: the forward (Cartesian Y) distance (inches) from the center of the robot to the camera, extending outwards FORWARD looking top down with your robot facing forwardPose Y: the lateral (Cartesian X) distance (inches) from the center of the robot to the camera, extending outwards LEFT looking top down with your robot facing forwardPose Heading: the angle (radians) at which, increasing ANTI-CLOCKWISE, your camera is pointing relative to your robot facing forward

See also