Class ChassisRequest.SwerveDriveBrake

java.lang.Object
com.marswars.swerve_lib.ChassisRequest.SwerveDriveBrake
All Implemented Interfaces:
ChassisRequest
Enclosing interface:
ChassisRequest

public static class ChassisRequest.SwerveDriveBrake extends Object implements 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.
  • Field Details

    • DriveRequestType

      public Module.DriveControlMode DriveRequestType
      The type of control request to use for the drive motor.
    • SteerRequestType

      public Module.SteerControlMode SteerRequestType
      The type of control request to use for the steer motor.
  • Constructor Details

    • SwerveDriveBrake

      public SwerveDriveBrake()
  • Method Details

    • apply

      public void apply(ChassisRequest.ChassisRequestParameters parameters, Module... modulesToApply)
      Applies this swerve request to the given modules. This is typically called by the SwerveDrivetrain.
      Specified by:
      apply in interface ChassisRequest
      Parameters:
      parameters - Parameters the control request needs to calculate the module state
      modulesToApply - 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