Package frc.robot
Class RobotState
java.lang.Object
frc.robot.RobotState
Primary Drivetrain State Estimator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSwerveObservation
(SwerveModulePosition[] positions, Rotation2d gyroYaw) Add information from swerve drive.void
addVisionObservation
(org.photonvision.targeting.PhotonPipelineResult result, Transform3d robotToCamera, int whichCamera) Add information from cameras.Get the current pose estimate using the global solver.void
init
(SwerveModulePosition[] positions, Rotation2d gyroYaw) Initialize thisRobotState
.void
resetPose
(Pose2d pose, SwerveModulePosition[] positions, Rotation2d gyroYaw) Use prior information to set the pose.
-
Constructor Details
-
RobotState
-
-
Method Details
-
init
Initialize thisRobotState
. Should only be called once (usually from theSwerve
constructor). -
resetPose
Use prior information to set the pose. Should only be used at the start of the program, or start of individual autonomous routines. -
getGlobalPoseEstimate
Get the current pose estimate using the global solver. -
addVisionObservation
public void addVisionObservation(org.photonvision.targeting.PhotonPipelineResult result, Transform3d robotToCamera, int whichCamera) Add information from cameras. -
addSwerveObservation
Add information from swerve drive.
-