> For the complete documentation index, see [llms.txt](https://yagsl.yassrobotics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yagsl.yassrobotics.com/reference/api-reference.md).

# API Reference

YAGSL's own Java surface is intentionally small: `swervelib.parser.SwerveParser` reads your [JSON config](/reference/json-schema.md) and hands you back a fully-built **YAMS** `SwerveDrive`. From that point on, you're driving and configuring a YAMS object, not a YAGSL-specific one — so the authoritative API reference lives in the YAMS docs, not here.

| Class you get back from `SwerveParser`                 | YAMS API reference                                                                                           |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `yams.mechanisms.swerve.SwerveDrive`                   | [SwerveDrive](https://yagsl.gitbook.io/yams/api-reference/java-reference/swerve/swerve-drive)                |
| `yams.mechanisms.config.SwerveDriveConfig`             | [SwerveDriveConfig](https://yagsl.gitbook.io/yams/api-reference/java-reference/swerve/swerve-drive-config)   |
| `yams.mechanisms.swerve.SwerveModule` (per-module)     | [SwerveModule](https://yagsl.gitbook.io/yams/api-reference/java-reference/swerve/swerve-module)              |
| Module config (built internally from your module JSON) | [SwerveModuleConfig](https://yagsl.gitbook.io/yams/api-reference/java-reference/swerve/swerve-module-config) |
| `yams.mechanisms.swerve.utility.SwerveInputStream`     | [SwerveInputStream](https://yagsl.gitbook.io/yams/api-reference/java-reference/swerve/swerve-input-stream)   |

The full YAMS API reference (all mechanisms, motor controllers, units, and math helpers — not just swerve) is at [yagsl.gitbook.io/yams](https://yagsl.gitbook.io/yams/api-reference/java-reference).

{% hint style="info" %}
Only `SwerveParser` and the JSON-file classes under `swervelib.parser.json` are YAGSL-specific. If you find yourself calling a method on `SwerveDrive`, `SwerveModule`, `SwerveDriveConfig`, `SwerveModuleConfig`, or `SwerveInputStream`, you're looking at YAMS API — go to the links above, not this repo's source, for the authoritative docs and Javadoc.
{% endhint %}

## Where to look for what

* **"What JSON fields exist?"** → [JSON Schema Reference](/reference/json-schema.md) (this repo).
* **"What does `SwerveDrive.drive(...)` do, what are all its methods?"** → [YAMS SwerveDrive reference](https://yagsl.gitbook.io/yams/api-reference/java-reference/swerve/swerve-drive).
* **"How do I build a `SwerveDriveConfig` by hand instead of from JSON?"** → [YAMS SwerveDriveConfig reference](https://yagsl.gitbook.io/yams/api-reference/java-reference/swerve/swerve-drive-config).
* **"How do I wire joystick input into field/robot-relative chassis speeds?"** → [YAMS SwerveInputStream reference](https://yagsl.gitbook.io/yams/api-reference/java-reference/swerve/swerve-input-stream).
* **"What changed in the JSON schema recently?"** → [Schema Changes](/reference/schema-changes.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://yagsl.yassrobotics.com/reference/api-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
