Package com.ctre.phoenix6.swerve
Interface SwerveRequest
- All Known Subinterfaces:
SwerveRequest.NativeSwerveRequest
- All Known Implementing Classes:
SwerveRequest.ApplyFieldSpeeds,SwerveRequest.ApplyRobotSpeeds,SwerveRequest.FieldCentric,SwerveRequest.FieldCentricFacingAngle,SwerveRequest.Idle,SwerveRequest.PointWheelsAt,SwerveRequest.RobotCentric,SwerveRequest.RobotCentricFacingAngle,SwerveRequest.SwerveDriveBrake,SwerveRequest.SysIdSwerveRotation,SwerveRequest.SysIdSwerveSteerGains,SwerveRequest.SysIdSwerveTranslation
public interface SwerveRequest
Container for all the Swerve Requests. Use this to find all applicable swerve
drive requests.
This is also an interface common to all swerve drive control requests that allow the request to calculate the state to apply to the modules.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAccepts a generic field-centric ChassisSpeeds to apply to the drivetrain.static classAccepts a generic robot-centric ChassisSpeeds to apply to the drivetrain.static classDrives the swerve drivetrain in a field-centric manner.static classDrives the swerve drivetrain in a field-centric manner, maintaining a specified heading angle to ensure the robot is facing the desired directionstatic enumIn field-centric control, the direction of "forward" is sometimes different depending on perspective.static classDoes nothing to the swerve module state.static interfaceSwerve requests implemented in native code.static classSets the swerve drive modules to point to a specified direction.static classDrives the swerve drivetrain in a robot-centric manner.static classDrives the swerve drivetrain in a robot-centric manner, maintaining a specified heading angle to ensure the robot is facing the desired directionstatic classSets the swerve drive module states to point inward on the robot in an "X" fashion, creating a natural brake which will oppose any motion.static classSysId-specific SwerveRequest to characterize the rotational characteristics of a swerve drivetrain.static classSysId-specific SwerveRequest to characterize the steer module characteristics of a swerve drivetrain.static classSysId-specific SwerveRequest to characterize the translational characteristics of a swerve drivetrain. -
Method Summary
Modifier and TypeMethodDescriptionapply(SwerveDrivetrain.SwerveControlParameters parameters, SwerveModule<?, ?, ?>... modulesToApply) Applies this swerve request to the given modules.
-
Method Details
-
apply
StatusCode apply(SwerveDrivetrain.SwerveControlParameters parameters, SwerveModule<?, ?, ?>... modulesToApply) Applies this swerve request to the given modules. This is typically called by the SwerveDrivetrain odometry thread.For native swerve requests, this API can be called from a non-native request's
applyto compose the two together.- Parameters:
parameters- Parameters the control request needs to calculate the module statemodulesToApply- Modules to which the control request is applied- Returns:
- Status code of sending the request
-