Hello World!
YAGSL is a Generic Swerve Library (AN ACTUAL LIBRARY!) that aims to simplify the process of creating a comprehensive and complete SwerveDrive’s with best practices from MANY SwerveDrive examples.
The documentation wiki is here.
An example project is here.
Library is here.
Javadoc are here.
Features:
- Second Order Kinematics with limited state-space estimation.
- Uses closed-loop PID exclusively.
- Dashboard for each swerve module.
- Support for both Falcon’s and Neo’s without changing any of the code base.
- An actual library as opposed to template code.
- Documentation, yes even javadocs.
- Varying Encoder support.
- Does not require a CommandBased project and could be implemented in a TimedRobot.
- Implements WPILib’s classes
RobotDriveBase
andMotorSafety
. - If a module is inaccessible/broken the Swerve Drive will still work.
- Advanced tuning for motor controller output limits and supply amps.
- Simulation support.
- Low CPU utilization.
The easiest way to create a SwerveDrive is through a JSON configuration tree/directory which allows for a single small line to create the entire SwerveDrive.
SwerveDrive drive = SwerveParser.fromJSONDirectory(new File(Filesystem.getDeployDirectory(), "swerve"));
There are other ways to create the SwerveDrive but that is the easiest.
The library uses WPILib classess to ensure MotorSafety and compliance with the same parent class used for DifferentialDrive
’s.
The library creates it’s own dashboard (which can be optionnaly updated in a periodic function with varying degrees of verbosity) that helps with tuning and debugging.
There is support for both Falcon’s and Neo’s WITH THE SAME CODE BASE alongside support for multiple different encoders both integrated, on the CAN bus with or without a CANivore, or directly from the roboRIO.
This implementation utilizes SecondOrderKinematics in an attempt to provide a better control system for the Swerve Drive. In addition to some state-space modeling for position estimation.
There is complete support for simulation with NEO’s however falcons require more testing/development. The configuration should be very easy for any team to use and robust enough to be applicable to most Swerve Drive’s.
I am looking for teams willing to test out YAGSL and give me feedback on what needs to be improved or configurable.
This thread will serve as another way to report issue’s if you do not submit one via github.
I hope everyone enjoys this!
Thank you!