Package frc.robot

Class RobotState

java.lang.Object
frc.robot.RobotState

public class RobotState extends Object
Primary Drivetrain State Estimator
  • Constructor Details

    • RobotState

      public RobotState(Viz2025 vis)
  • Method Details

    • init

      public void init(SwerveModulePosition[] positions, Rotation2d gyroYaw)
      Initialize this RobotState. Should only be called once (usually from the Swerve constructor).
    • resetPose

      public void resetPose(Pose2d pose, SwerveModulePosition[] positions, Rotation2d gyroYaw)
      Use prior information to set the pose. Should only be used at the start of the program, or start of individual autonomous routines.
    • getGlobalPoseEstimate

      public Pose2d 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

      public void addSwerveObservation(SwerveModulePosition[] positions, Rotation2d gyroYaw)
      Add information from swerve drive.