Package com.ctre.phoenix6.swerve
Class SwerveDrivetrain.SwerveDriveState
java.lang.Object
com.ctre.phoenix6.swerve.SwerveDrivetrain.SwerveDriveState
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- SwerveDrivetrain<DriveMotorT extends CommonTalon,
SteerMotorT extends CommonTalon, EncoderT extends ParentDevice>
Plain-Old-Data class holding the state of the swerve drivetrain.
This encapsulates most data that is relevant for telemetry or
decision-making from the Swerve Drive.
-
Field Summary
Modifier and TypeFieldDescriptionint
Number of failed data acquisitionsThe current module positionsThe current module statesThe target module statesdouble
The measured odometry update period, in secondsThe current pose of the robotThe raw heading of the robot, unaffected by vision updates and odometry resetsThe current velocity of the robotint
Number of successful data acquisitionsdouble
The timestamp of the state capture, in the timebase ofUtils.getCurrentTimeSeconds()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates a deep copy of this state object.protected void
updateFromJni
(SwerveJNI.DriveState driveState)
-
Field Details
-
Pose
The current pose of the robot -
Speeds
The current velocity of the robot -
ModuleStates
The current module states -
ModuleTargets
The target module states -
ModulePositions
The current module positions -
RawHeading
The raw heading of the robot, unaffected by vision updates and odometry resets -
Timestamp
The timestamp of the state capture, in the timebase ofUtils.getCurrentTimeSeconds()
-
OdometryPeriod
The measured odometry update period, in seconds -
SuccessfulDaqs
Number of successful data acquisitions -
FailedDaqs
Number of failed data acquisitions
-
-
Constructor Details
-
SwerveDriveState
public SwerveDriveState()
-
-
Method Details