Package com.marswars.swerve_lib
Class ChassisRequest.SwerveDriveBrake
java.lang.Object
com.marswars.swerve_lib.ChassisRequest.SwerveDriveBrake
- All Implemented Interfaces:
ChassisRequest
- Enclosing interface:
- ChassisRequest
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.marswars.swerve_lib.ChassisRequest
ChassisRequest.ApplyChassisSpeeds, ChassisRequest.ApplyFieldSpeeds, ChassisRequest.ChassisRequestParameters, ChassisRequest.FieldCentric, ChassisRequest.FieldCentricFacingAngle, ChassisRequest.Idle, ChassisRequest.PointWheelsAt, ChassisRequest.RobotCentric, ChassisRequest.RobotCentricFacingAngle, ChassisRequest.SwerveDriveBrake, ChassisRequest.XPositiveReference -
Field Summary
FieldsModifier and TypeFieldDescriptionThe type of control request to use for the drive motor.The type of control request to use for the steer motor. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ChassisRequest.ChassisRequestParameters parameters, Module... modulesToApply) Applies this swerve request to the given modules.withDriveRequestType(Module.DriveControlMode driveRequestType) Sets the type of control request to use for the drive motor.withSteerRequestType(Module.SteerControlMode 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
Applies this swerve request to the given modules. This is typically called by the SwerveDrivetrain.- Specified by:
applyin interfaceChassisRequest- Parameters:
parameters- Parameters the control request needs to calculate the module statemodulesToApply- Modules to which the control request is applied
-
withDriveRequestType
public ChassisRequest.SwerveDriveBrake withDriveRequestType(Module.DriveControlMode 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 ChassisRequest.SwerveDriveBrake withSteerRequestType(Module.SteerControlMode 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
-