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
FieldsModifier and TypeFieldDescriptionintNumber of failed data acquisitionsThe current module positionsThe current module statesThe target module statesdoubleThe measured odometry update period, in secondsThe current pose of the robotThe raw heading of the robot, unaffected by vision updates and odometry resetsThe current robot-centric velocityintNumber of successful data acquisitionsdoubleThe timestamp of the state capture, in the timebase ofUtils.getCurrentTimeSeconds() -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a deep copy of this state object.protected voidupdateFromJni(SwerveJNI.DriveState driveState)
-
Field Details
-
Pose
The current pose of the robot -
Speeds
The current robot-centric velocity -
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