SwerveAuto

class SwerveAuto(xPID: ProfiledPIDController, yPID: ProfiledPIDController, twistPID: PIDController, twistTrapConstraints: TrapezoidProfile.Constraints, angleDeadzone: Double, positionDeadzone: Double, val swo: SwerveOdometry, val swerveSystem: SwerveDriveTrain, val gyro: GenericGyro, debugLogging: Boolean = false, field2d: Optional<Field2d> = Optional.empty())

A class that handles autonomous driving for swerve drive robots. This includes motion profiling and active PID correction.

Parameters

xPID

The PID controller for the x axis

yPID

The PID controller for the y axis

twistPID

The PID controller for the twist axis

twistTrapConstraints

The constraints for the twist PID controller

angleDeadzone

The deadzone for the twist PID controller

positionDeadzone

The deadzone for the x and y PID controllers

swo

The swerve odometry object

swerveSystem

The swerve drive train object

gyro

The gyro object

debugLogging

Whether or not to log debug information to the console

field2d

The field2d object to update

Constructors

Link copied to clipboard
constructor(xPID: ProfiledPIDController, yPID: ProfiledPIDController, twistPID: PIDController, twistTrapConstraints: TrapezoidProfile.Constraints, angleDeadzone: Double, positionDeadzone: Double, swo: SwerveOdometry, swerveSystem: SwerveDriveTrain, gyro: GenericGyro, debugLogging: Boolean = false, field2d: Optional<Field2d> = Optional.empty())

Functions

Link copied to clipboard
Link copied to clipboard
fun kill()
Link copied to clipboard
fun move()
Link copied to clipboard
fun setDesiredAngleRelative(desiredAngle: Double)
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard