Class ChassisRequest.PointWheelsAt

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

public static class ChassisRequest.PointWheelsAt extends Object implements ChassisRequest
Sets the swerve drive modules to point to a specified direction.
  • Field Details

    • ModuleDirection

      public Rotation2d ModuleDirection
      The direction to point the modules toward. This direction is still optimized to what the module was previously at.
    • 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

    • PointWheelsAt

      public PointWheelsAt()
  • 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
    • withModuleDirection

      public ChassisRequest.PointWheelsAt withModuleDirection(Rotation2d moduleDirection)
      Sets the direction to point the modules toward. This direction is still optimized to what the module was previously at.
      Parameters:
      moduleDirection - Direction to point the modules toward
      Returns:
      this request
    • withDriveRequestType

      public ChassisRequest.PointWheelsAt 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.PointWheelsAt 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