Code Setup

Import YAGSL

Online

Use WPILib vendor deps to install it.

Offline

Copy the swervelib directory from YAGSL-Example into src/main/java into your project.

Be sure to install all dependencies too!

How to create a swerve drive?

YAGSL is unique in the fact that you can create a swerve drive based entirely off of JSON configuration files. The JSON configuration files should be located in the deploy directory. You can also create the Configuration objects manually and instantiate your Swerve Drive that way.

How to create a SwerveDrive using JSON.

This example program creates the SwerveDrive in the SwerveSubsystem, as you should only interact with it in the SwerveSubsystem if you are using command based programming.

This way is fast and easy, no more large unmaintainable and daunting constants file to worry about! To create a JSON directory look at the configuration documentation.

Telemetry

Telemetry can be great when you want it and YAGSL has no shortage of useful telemetry, such as the Module[...] fields you will see in a driver dashboard. However Telemetry causes delays and slowdowns to the program so sometimes it is best to the them off. To do this change

Follow along the example here!

Sometimes we like to include really advanced features in the example (like last year we had a drive to point command) so be sure to check back and see what we have done!

Drive Code

Inside the SwerveSubsystem you can make your own drive code as easy as a few lines.

Last updated

Was this helpful?