# Swerve Drive

## Swerve Drive (`swervedrive.json`)

The Swerve Drive JSON configuration file configures everything related to the overall Swerve Drive. It maps 1:1 to [`SwerveDriveJson.java`](https://github.com/BroncBotz3481/YAGSL-Example/tree/main/src/main/java/swervelib/parser/json/SwerveDriveJson.java) which creates a [`SwerveDriveConfiguration`](https://github.com/BroncBotz3481/YAGSL-Example/tree/main/src/main/java/swervelib/parser/SwerveDriveConfiguration.java) that is used to create the [`SwerveDrive`](https://github.com/BroncBotz3481/YAGSL-Example/tree/main/src/main/java/swervelib/SwerveDrive.java) object.

## JSON Fields

| Name          | Units                                                              | Required | Description                                                     |
| ------------- | ------------------------------------------------------------------ | -------- | --------------------------------------------------------------- |
| `imu`         | [Device](/configuring-yagsl/configuration/device-configuration.md) | Y        | Robot IMU used to determine heading of the robot.               |
| `invertedIMU` | Boolean                                                            | Y        | Inversion state of the IMU.                                     |
| `modules`     | String array                                                       | Y        | Module JSONs in order clockwise order starting from front left. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yagsl.com/legacy-documentation/documentation/swerve-drive.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
