Package org.team1126.lib.swerve
Class SwerveState
java.lang.Object
org.team1126.lib.swerve.SwerveState
Represents the state of the robot's drivetrain.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains information about swerve module states and positions.static final classRepresents the state of the odometry thread. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SwerveState.ModulesInformation about module states and positions.edu.wpi.first.math.geometry.Pose2dThe uncorrected blue origin relative odometry pose of the robot.The state of the odometry thread.edu.wpi.first.math.geometry.Rotation2dThe robot's pitch.edu.wpi.first.math.geometry.Pose2dThe current blue origin relative pose of the robot.final List<TimestampedPose> All pose estimates from the odometry thread since theSwerveStatehas been refreshed.edu.wpi.first.math.geometry.Rotation2dThe robot's roll.edu.wpi.first.math.geometry.Rotation2dThe robot's rotation (yaw) as reported from the pose estimator.final edu.wpi.first.math.kinematics.ChassisSpeedsThe current measured robot-relative speeds.final edu.wpi.first.math.kinematics.ChassisSpeedsThe next target robot-relative speeds.doubleThe timestamp of the swerve state in seconds (FPGA time).edu.wpi.first.math.geometry.Translation2dThe current blue origin relative translation of the robot.doubleThe directionless measured velocity of the robot. -
Method Summary
-
Field Details
-
modules
Information about module states and positions. -
odometryThread
The state of the odometry thread. -
poseHistory
All pose estimates from the odometry thread since theSwerveStatehas been refreshed. -
speeds
public final edu.wpi.first.math.kinematics.ChassisSpeeds speedsThe current measured robot-relative speeds. -
targetSpeeds
public final edu.wpi.first.math.kinematics.ChassisSpeeds targetSpeedsThe next target robot-relative speeds. Updated when usingapplySpeeds(). -
velocity
public double velocityThe directionless measured velocity of the robot. -
pose
public edu.wpi.first.math.geometry.Pose2d poseThe current blue origin relative pose of the robot. -
pitch
public edu.wpi.first.math.geometry.Rotation2d pitchThe robot's pitch. -
roll
public edu.wpi.first.math.geometry.Rotation2d rollThe robot's roll. -
odometryPose
public edu.wpi.first.math.geometry.Pose2d odometryPoseThe uncorrected blue origin relative odometry pose of the robot. -
translation
public edu.wpi.first.math.geometry.Translation2d translationThe current blue origin relative translation of the robot. -
rotation
public edu.wpi.first.math.geometry.Rotation2d rotationThe robot's rotation (yaw) as reported from the pose estimator. -
timestamp
public double timestampThe timestamp of the swerve state in seconds (FPGA time).
-