Swerve drive implementation that can be used as a starting point for programming a swerve drive robot.
- Document all the key elements of configuring the swerve drive.
- Document all the key elements of troubleshooting the swerve drive.
- Update the code to have all the key elements output to the Smart Dashboard in a usable fashion.
- https://software-metadata.revrobotics.com/REVLib-2024.json
- https://maven.ctr-electronics.com/release/com/ctre/phoenix6/latest/Phoenix6-frc2024-latest.json
- https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json
- CANSparkMax for drivetrain
- CTRE Pigeon 2.0 gyro
- CANcoder
- Double Neo
- SDS Mk4i L2 Swerve Module
- 26x26 base - 20.75 inches for both track width and wheel base
- 4 in diameter wheels
- SwerveKinematics order:
- leftFront
- rightFront
- leftBack
- rightBack
- Download Phoenix Tuner X
- Plug into RoboRio with USB A to B
- Click on each CANcoder
- Turn all the wheel to the forward position
- Hit refresh, and record the absolute positions as Constants
- Name each swerve offset in the format of
LEFT_FRONT_OFFSET
- Make sure the wheels are oriented in the correct direction
- Turn 180 degrees if not (turn on its side to test); you'll know if it's in the correct direction by driving
- Make sure each encoder and motor are inverted if needed
- Each swerve module orientation is forward positive and counter-clockwise positive
- Slew rate limiter — softens the behavior of control inputs by capping the maximum rate of change
- Kp Tuning constant — the most important part of the PID loop/controller