Package swervelib.parser
Class SwerveControllerConfiguration
java.lang.Object
swervelib.parser.SwerveControllerConfiguration
Swerve Controller configuration class which is used to configure
SwerveController
.-
Field Summary
Modifier and TypeFieldDescriptionfinal double
hypotenuse deadband for the robot angle control joystick.final PIDFConfig
PIDF for the heading of the robot.double
Maximum angular velocity in rad/s -
Constructor Summary
ConstructorDescriptionSwerveControllerConfiguration
(SwerveDriveConfiguration driveCfg, PIDFConfig headingPIDF, double maxSpeedMPS) Construct the swerve controller configuration.SwerveControllerConfiguration
(SwerveDriveConfiguration driveCfg, PIDFConfig headingPIDF, double angleJoyStickRadiusDeadband, double maxSpeedMPS) Construct the swerve controller configuration. -
Method Summary
-
Field Details
-
headingPIDF
PIDF for the heading of the robot. -
angleJoyStickRadiusDeadband
public final double angleJoyStickRadiusDeadbandhypotenuse deadband for the robot angle control joystick. -
maxAngularVelocity
public double maxAngularVelocityMaximum angular velocity in rad/s
-
-
Constructor Details
-
SwerveControllerConfiguration
public SwerveControllerConfiguration(SwerveDriveConfiguration driveCfg, PIDFConfig headingPIDF, double angleJoyStickRadiusDeadband, double maxSpeedMPS) Construct the swerve controller configuration. Assumes robot is square to fetch maximum angular velocity.- Parameters:
driveCfg
-SwerveDriveConfiguration
to fetch the first module X and Y used to calculate the maximum angular velocity.headingPIDF
- Heading PIDF configuration.angleJoyStickRadiusDeadband
- Deadband on radius of angle joystick.maxSpeedMPS
- Maximum speed in meters per second for angular velocity, remember if you have feet per second useUnits.feetToMeters(double)
.
-
SwerveControllerConfiguration
public SwerveControllerConfiguration(SwerveDriveConfiguration driveCfg, PIDFConfig headingPIDF, double maxSpeedMPS) Construct the swerve controller configuration. Assumes hypotenuse deadband of 0.5 (minimum radius for angle to be set on angle joystick is .5 of the controller).- Parameters:
driveCfg
- Drive configuration.headingPIDF
- Heading PIDF configuration.maxSpeedMPS
- Maximum speed in meters per second for angular velocity, remember if you have feet per second useUnits.feetToMeters(double)
.
-