Package com.ctre.phoenix6.swerve
Class SwerveDrivetrain.SwerveControlParameters
java.lang.Object
com.ctre.phoenix6.swerve.SwerveDrivetrain.SwerveControlParameters
- Enclosing class:
- SwerveDrivetrain<DriveMotorT extends CommonTalon,
SteerMotorT extends CommonTalon, EncoderT extends ParentDevice>
Contains everything the control requests need to calculate the module state.
-
Field Summary
FieldsModifier and TypeFieldDescriptionedu.wpi.first.math.kinematics.ChassisSpeedsThe current robot-centric chassis speedsedu.wpi.first.math.geometry.Pose2dThe current pose of the robotintID of the native drivetrain instance, used for JNI callsedu.wpi.first.math.kinematics.SwerveDriveKinematicsThe kinematics object used for controldoubleThe max speed of the robot at 12 V output, in m/sedu.wpi.first.math.geometry.Translation2d[]The locations of the swerve modulesedu.wpi.first.math.geometry.Rotation2dThe forward direction from the operator perspectivedoubleThe timestamp of the current control apply, in the timebase ofUtils.getCurrentTimeSeconds()doubleThe update period of control apply -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidupdateFromJni(SwerveJNI.ControlParams controlParams)
-
Field Details
-
drivetrainId
public int drivetrainIdID of the native drivetrain instance, used for JNI calls -
kinematics
public edu.wpi.first.math.kinematics.SwerveDriveKinematics kinematicsThe kinematics object used for control -
moduleLocations
public edu.wpi.first.math.geometry.Translation2d[] moduleLocationsThe locations of the swerve modules -
kMaxSpeedMps
public double kMaxSpeedMpsThe max speed of the robot at 12 V output, in m/s -
operatorForwardDirection
public edu.wpi.first.math.geometry.Rotation2d operatorForwardDirectionThe forward direction from the operator perspective -
currentChassisSpeed
public edu.wpi.first.math.kinematics.ChassisSpeeds currentChassisSpeedThe current robot-centric chassis speeds -
currentPose
public edu.wpi.first.math.geometry.Pose2d currentPoseThe current pose of the robot -
timestamp
public double timestampThe timestamp of the current control apply, in the timebase ofUtils.getCurrentTimeSeconds() -
updatePeriod
public double updatePeriodThe update period of control apply
-
-
Constructor Details
-
SwerveControlParameters
public SwerveControlParameters()
-
-
Method Details
-
updateFromJni
-