Class SwerveRequest.SwerveDriveBrake
java.lang.Object
com.ctre.phoenix6.mechanisms.swerve.SwerveRequest.SwerveDriveBrake
- All Implemented Interfaces:
SwerveRequest
- Enclosing interface:
- SwerveRequest
public static class SwerveRequest.SwerveDriveBrake extends Object implements SwerveRequest
Sets the swerve drive module states to point inward on the
robot in an "X" fashion, creating a natural brake which will
oppose any motion.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ctre.phoenix6.mechanisms.swerve.SwerveRequest
SwerveRequest.ApplyChassisSpeeds, SwerveRequest.FieldCentric, SwerveRequest.FieldCentricFacingAngle, SwerveRequest.ForwardReference, SwerveRequest.Idle, SwerveRequest.PointWheelsAt, SwerveRequest.RobotCentric, SwerveRequest.SwerveControlRequestParameters, SwerveRequest.SwerveDriveBrake, SwerveRequest.SysIdSwerveRotation, SwerveRequest.SysIdSwerveSteerGains, SwerveRequest.SysIdSwerveTranslation
-
Field Summary
Fields Modifier and Type Field Description SwerveModule.DriveRequestType
DriveRequestType
The type of control request to use for the drive motor.SwerveModule.SteerRequestType
SteerRequestType
The type of control request to use for the steer motor. -
Constructor Summary
Constructors Constructor Description SwerveDriveBrake()
-
Method Summary
Modifier and Type Method Description StatusCode
apply(SwerveRequest.SwerveControlRequestParameters parameters, SwerveModule... modulesToApply)
Applies this swerve request to the given modules.SwerveRequest.SwerveDriveBrake
withDriveRequestType(SwerveModule.DriveRequestType driveRequestType)
Sets the type of control request to use for the drive motor.SwerveRequest.SwerveDriveBrake
withSteerRequestType(SwerveModule.SteerRequestType steerRequestType)
Sets the type of control request to use for the steer motor.
-
Field Details
-
DriveRequestType
The type of control request to use for the drive motor. -
SteerRequestType
The type of control request to use for the steer motor.
-
-
Constructor Details
-
SwerveDriveBrake
public SwerveDriveBrake()
-
-
Method Details
-
apply
public StatusCode apply(SwerveRequest.SwerveControlRequestParameters parameters, SwerveModule... modulesToApply)Description copied from interface:SwerveRequest
Applies this swerve request to the given modules. This is typically called by the SwerveDrivetrain.- Specified by:
apply
in interfaceSwerveRequest
- 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
-
withDriveRequestType
public SwerveRequest.SwerveDriveBrake withDriveRequestType(SwerveModule.DriveRequestType driveRequestType)Sets the type of control request to use for the drive motor.- Parameters:
driveRequestType
- The type of control request to use for the drive motor- Returns:
- this request
-
withSteerRequestType
public SwerveRequest.SwerveDriveBrake withSteerRequestType(SwerveModule.SteerRequestType steerRequestType)Sets the type of control request to use for the steer motor.- Parameters:
steerRequestType
- The type of control request to use for the steer motor- Returns:
- this request
-