> For the complete documentation index, see [llms.txt](https://docs.raidrobotics.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.raidrobotics.org/commands-v3-state-machine/readme.md).

# Robot Template (Commands v3)

The starting point for a season's robot code: CTRE swerve, a mechanism state machine, Limelights, logging and a simulator, built on WPILib 2027 and Commands v3.

The Robot Template is where each season's robot code starts. It is a complete, working robot program that is small on purpose: one swerve drive, two placeholder mechanisms run by a state machine, the Limelights, logging that RAIDLogs and RAIDSystems can read, a simulator, and one example auto. Each part shows the pattern to copy when the real robot needs more.

The source lives in [Team4469/Robot\_FSM\_Template-Commandv3](https://github.com/Team4469/Robot_FSM_Template-Commandv3).

It is built for:

* **WPILib 2027** (alpha 8) with **Commands v3** and opmodes
* **Phoenix 6** (CTRE), with Pro features on
* **LimelightLib 2**
* **Java 25**, the JDK that comes with the WPILib 2027 installer

## The one rule

Everything in this project follows one rule about who may talk to whom:

```mermaid
flowchart LR
    O[Opmodes<br/>teleop buttons, auto steps] -- ask --> S[Superstructure<br/>requests + state machine]
    S -- commands --> M[Mechanisms]
    M --> Motors
    O -- commands --> D[Drivetrain]
```

Opmodes never touch a motor, and mechanisms never look at a controller. Teleop buttons and auto steps make the same requests, so the two can't behave differently. [How the robot code fits together](https://docs.raidrobotics.org/commands-v3-state-machine/concepts/concepts.md) explains why.

## Where to start

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>New to the project</strong></td><td>Install the tools, build the code and drive the robot in the simulator.</td><td><a href="https://docs.raidrobotics.org/commands-v3-state-machine/getting-started/getting-started.md">Getting started</a></td></tr><tr><td><strong>Learn how it works</strong></td><td>The architecture, Commands v3, opmodes and the request pattern.</td><td><a href="https://docs.raidrobotics.org/commands-v3-state-machine/concepts/concepts.md">How the robot code fits together</a></td></tr><tr><td><strong>The state machine</strong></td><td>How the superstructure decides what every mechanism does.</td><td><a href="https://docs.raidrobotics.org/commands-v3-state-machine/guide/superstructure.md">The superstructure state machine</a></td></tr><tr><td><strong>Starting a season</strong></td><td>Turn the template into this year's robot, step by step.</td><td><a href="https://docs.raidrobotics.org/commands-v3-state-machine/how-to/start-a-season.md">Start a season from the template</a></td></tr></tbody></table>

## How these docs are organized

| Section                                                                                                       | What's in it                                      | Read it when                                             |
| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- | -------------------------------------------------------- |
| [Getting started](https://docs.raidrobotics.org/commands-v3-state-machine/getting-started/getting-started.md) | Install, build, run the simulator, tour the files | You're new, or setting up a new laptop                   |
| [Concepts](https://docs.raidrobotics.org/commands-v3-state-machine/concepts/concepts.md)                      | The ideas the code is built on                    | You want to understand *why* the code is shaped this way |
| [Guide](https://docs.raidrobotics.org/commands-v3-state-machine/guide/robot-and-constants.md)                 | One page per part of the robot code, in depth     | You're working on that part                              |
| [How-to](https://docs.raidrobotics.org/commands-v3-state-machine/how-to/start-a-season.md)                    | Step-by-step recipes for common changes           | You have a specific job to do                            |
| [Reference](https://docs.raidrobotics.org/commands-v3-state-machine/reference/file-map.md)                    | Tables to look things up in                       | You need a name, a button or a log entry                 |

{% hint style="info" %}
The code is the final word. Every class has a header comment that explains it, and these docs follow those comments closely. If the two ever disagree, trust the code and fix the docs (see [Maintaining these docs](https://docs.raidrobotics.org/commands-v3-state-machine/reference/maintaining-these-docs.md)).
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.raidrobotics.org/commands-v3-state-machine/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
