JSON Configuration Schema
YAGSL builds a YAMS SwerveDrive from a directory of JSON files. swervelib.parser.SwerveParser reads this directory and constructs the equivalent YAMS SwerveDriveConfig / SwerveModuleConfig / SmartMotorControllerConfig objects for you — you rarely need to hand-edit these files, since config.yagsl.com generates them for you, but knowing the schema is useful for debugging, scripting, or hand-tweaking a single value.
Directory layout
src/main/deploy
└── swerve
└── base <- name is arbitrary, passed to `new SwerveParser(...)`
├── swervedrive.json
└── modules
├── frontleft.json
├── frontright.json
├── backleft.json
├── backright.json <- module filenames are arbitrary, referenced by swervedrive.json
├── physicalproperties.json
├── pidfproperties.json
└── pidfproperties_sim.json (optional)SwerveParser reads, in order:
swervedrive.json— top-level drive config: gyro + list of module files.modules/physicalproperties.json— default gearing and current limits shared by every module.modules/pidfproperties.json— default PID + feedforward gains shared by every module. Ifmodules/pidfproperties_sim.jsonalso exists, it's used instead wheneverRobotBase.isSimulation()istrue, so you can tune sim and real gains independently.Each file listed in
swervedrive.json'smodulesarray — one per swerve module, describing that module's hardware, wiring, and location. A module file may override the gearing fromphysicalproperties.jsonwith its owngearingobject.
All JSON is parsed with Jackson in lenient mode (FAIL_ON_UNKNOWN_PROPERTIES = false), so unknown fields are ignored rather than rejected — useful if you're migrating a file field-by-field.
Pages in this section
Device type strings — every valid
typevalue for gyros, motor controllers, and absolute encoders.
Coming from a pre-2026.8.05 swerve/ directory (imu, encoder, conversionFactors, controllerproperties.json, PIDF f/iz)? See Schema Changes for a full migration guide.
Control system and CAN buses
Every device's canbus field is just a bus name — "" selects your control system's default CAN bus, and any other string must match a bus your control system actually exposes to WPILib.
Last updated
Was this helpful?