Package frc.robot
Class RobotState
java.lang.Object
frc.robot.RobotState
Primary Drivetrain State Estimator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSwerveObservation(SwerveModulePosition[] positions, Rotation2d gyroYaw) Add information from swerve drive.voidaddVisionObservation(org.photonvision.targeting.PhotonPipelineResult result, Transform3d robotToCamera, int whichCamera) Add information from cameras.Get the current pose estimate using the global solver.voidinit(SwerveModulePosition[] positions, Rotation2d gyroYaw) Initialize thisRobotState.booleanvoidresetPose(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 theSwerveconstructor). -
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. -
isInitialized
public boolean isInitialized()
-