Class SetpointDriverProfile
java.lang.Object
frc.robot.services.control.GenericControlProfile
frc.robot.services.control.driver.profiles.SetpointDriverProfile
- All Implemented Interfaces:
ControlProfile,DriverProfile
A driver profile that generates smooth, kinematically limited setpoints. Limits translational
acceleration as a 2D vector to prevent swerve module skewing, and limits rotational acceleration
to prevent wheel slip. This is inspired by 254's approach.
-
Field Summary
Fields inherited from class frc.robot.services.control.GenericControlProfile
controller -
Constructor Summary
ConstructorsConstructorDescriptionSetpointDriverProfile(XboxController controller, LinearVelocity maxLinearVelocity, LinearAcceleration maxLinearAcceleration, AngularVelocity maxAngularVelocity, AngularAcceleration maxAngularAcceleration, Supplier<ChassisSpeeds> currentSpeedsSupplier, BooleanSupplier isRobotReadyToFire) Constructs a SetpointDriverProfile. -
Method Summary
Modifier and TypeMethodDescriptionReturns the desired chassis speeds based on joystick input.doubleReturns the left rumble value for the controller.doubleReturns the right rumble value for the controller.booleanwantsAim()Returns whether the driver wants to aim.booleanReturns whether the driver wants to reset the robot pose.booleanReturns whether the driver wants to shoot.Methods inherited from class frc.robot.services.control.GenericControlProfile
getHID, isConnectedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface frc.robot.services.control.ControlProfile
getHID, isConnected
-
Constructor Details
-
SetpointDriverProfile
public SetpointDriverProfile(XboxController controller, LinearVelocity maxLinearVelocity, LinearAcceleration maxLinearAcceleration, AngularVelocity maxAngularVelocity, AngularAcceleration maxAngularAcceleration, Supplier<ChassisSpeeds> currentSpeedsSupplier, BooleanSupplier isRobotReadyToFire) Constructs a SetpointDriverProfile.- Parameters:
controller- The Xbox controller used for input.maxLinearVelocity- The maximum linear velocity allowed.maxLinearAcceleration- The maximum linear acceleration allowed.maxAngularVelocity- The maximum angular velocity allowed.maxAngularAcceleration- The maximum angular acceleration allowed.currentSpeedsSupplier- Supplier for the robot's actual measured speeds.isRobotReadyToFire- BooleanSupplier indicating if the robot is ready to fire.
-
-
Method Details
-
getLeftRumble
public double getLeftRumble()Description copied from interface:ControlProfileReturns the left rumble value for the controller.- Specified by:
getLeftRumblein interfaceControlProfile- Overrides:
getLeftRumblein classGenericControlProfile- Returns:
- The left rumble intensity (0.0-1.0).
-
getRightRumble
public double getRightRumble()Description copied from interface:ControlProfileReturns the right rumble value for the controller.- Specified by:
getRightRumblein interfaceControlProfile- Overrides:
getRightRumblein classGenericControlProfile- Returns:
- The right rumble intensity (0.0-1.0).
-
getDesiredSpeeds
Description copied from interface:DriverProfileReturns the desired chassis speeds based on joystick input.- Specified by:
getDesiredSpeedsin interfaceDriverProfile- Returns:
- The desired
ChassisSpeeds.
-
wantsAim
public boolean wantsAim()Description copied from interface:DriverProfileReturns whether the driver wants to aim.- Specified by:
wantsAimin interfaceDriverProfile- Returns:
- True if aiming is requested.
-
wantsShoot
public boolean wantsShoot()Description copied from interface:DriverProfileReturns whether the driver wants to shoot.- Specified by:
wantsShootin interfaceDriverProfile- Returns:
- True if shooting is requested.
-
wantsReset
public boolean wantsReset()Description copied from interface:DriverProfileReturns whether the driver wants to reset the robot pose.- Specified by:
wantsResetin interfaceDriverProfile- Returns:
- True if reset is requested.
-