Class SwerveRequest.PointWheelsAt

java.lang.Object
com.ctre.phoenix6.swerve.SwerveRequest.PointWheelsAt
All Implemented Interfaces:
SwerveRequest, SwerveRequest.NativeSwerveRequest
Enclosing interface:
SwerveRequest

public static class SwerveRequest.PointWheelsAt extends Object implements SwerveRequest.NativeSwerveRequest
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 SwerveModule.DriveRequestType DriveRequestType
      The type of control request to use for the drive motor.
    • SteerRequestType

      public SwerveModule.SteerRequestType SteerRequestType
      The type of control request to use for the drive motor.
  • Constructor Details

    • PointWheelsAt

      public PointWheelsAt()
  • Method Details

    • withModuleDirection

      public final SwerveRequest.PointWheelsAt withModuleDirection(Rotation2d newModuleDirection)
      Modifies the ModuleDirection parameter and returns itself.

      The direction to point the modules toward. This direction is still optimized to what the module was previously at.

      Parameters:
      newModuleDirection - Parameter to modify
      Returns:
      this object
    • withDriveRequestType

      public final SwerveRequest.PointWheelsAt withDriveRequestType(SwerveModule.DriveRequestType newDriveRequestType)
      Modifies the DriveRequestType parameter and returns itself.

      The type of control request to use for the drive motor.

      Parameters:
      newDriveRequestType - Parameter to modify
      Returns:
      this object
    • withSteerRequestType

      public final SwerveRequest.PointWheelsAt withSteerRequestType(SwerveModule.SteerRequestType newSteerRequestType)
      Modifies the SteerRequestType parameter and returns itself.

      The type of control request to use for the drive motor.

      Parameters:
      newSteerRequestType - Parameter to modify
      Returns:
      this object
    • apply

      public StatusCode apply(SwerveDrivetrain.SwerveControlParameters parameters, SwerveModule<?,?,?>... modulesToApply)
      Description copied from interface: SwerveRequest
      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 apply to compose the two together.

      Specified by:
      apply in interface SwerveRequest
      Parameters:
      parameters - Parameters the control request needs to calculate the module state
      modulesToApply - Modules to which the control request is applied
      Returns:
      Status code of sending the request
    • applyNative

      public void applyNative(int id)
      Description copied from interface: SwerveRequest.NativeSwerveRequest
      Applies a native swerve request to the native drivetrain with the provided ID.

      When this is implemented, the regular SwerveRequest.apply(SwerveDrivetrain.SwerveControlParameters, SwerveModule...) function should do nothing (return OK). Additionally, this cannot be called from another swerve request's apply method, as this overrides the native swerve request of the drivetrain.

      Unlike SwerveRequest.apply(SwerveDrivetrain.SwerveControlParameters, SwerveModule...), this function is called every time SwerveDrivetrain.setControl(SwerveRequest) is run, not every loop of the odometry thread. Instead, the underlying native request is run at the full update frequency of the odometry thread.

      Specified by:
      applyNative in interface SwerveRequest.NativeSwerveRequest
      Parameters:
      id - ID of the native swerve drivetrain