Swerve Subsystem
The subsystem that controls the swerve drive.
Author
Falon Clark
Since
1/15/2024
Properties
Whether the robot should drive field oriented or robot oriented.
PID Controller for the heading of the robot. Currently not used, as feedforward is a much better solution to fix drift.
The maximum speed of the swerve drive
SwerveModuleStates publisher for swerve display
Functions
Add a vision measurement to the swerve drive's pose estimator.
Calculate the heading PID for the robot.
Configures PathPlanner's AutoBuilder.
Simple drive method that uses ChassisSpeeds to control the robot.
Simple drive method that translates and rotates the robot.
Advanced drive method that translates and rotates the robot, with a custom center of rotation.
Gets a command that follows a path created in PathPlanner.
Generate a full command to SysID the drive motors
Get a SysIdRoutine for the drive motors.
Method to get the current field oriented velocity of the robot.
Method to get the current heading of the robot.
Method to get the Kinematics object of the swerve drive.
Method to get the current robot oriented velocity of the robot.
Method to get the SwerveController object of the swerve drive.
Method to get the SwerveDriveConfiguration object of the swerve drive.
Method to generate a ChassisSpeeds object from a desired X, Y, and Rotational velocity.
Method to generate a ChassisSpeeds object from a desired X, Y, and angle X and Y components.
Method to display a desired trajectory to a field2d object.
Method to reset the odometry of the robot to a desired pose.
Method to set the desired speeds of the swerve drive.
Method to toggle the motor's brakes.
Directly send voltage to the drive motors.
Set the standard deviations of the vision measurements.
Return SysID command for angle motors from YAGSL
Return SysID command for drive motors from YAGSL
function to toggle field oriented drive