Package com.marswars.swerve_lib
Class ChassisRequest.PointWheelsAt
java.lang.Object
com.marswars.swerve_lib.ChassisRequest.PointWheelsAt
- All Implemented Interfaces:
ChassisRequest
- Enclosing interface:
- ChassisRequest
Sets the swerve drive modules to point to a specified direction.
-
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 direction to point the modules toward.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.withModuleDirection(Rotation2d moduleDirection) Sets the direction to point the modules toward.withSteerRequestType(Module.SteerControlMode steerRequestType) Sets the type of control request to use for the steer motor.
-
Field Details
-
ModuleDirection
The direction to point the modules toward. This direction is still optimized to what the module was previously at. -
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
-
PointWheelsAt
public PointWheelsAt()
-
-
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
-
withModuleDirection
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
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
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
-