> 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/reference/raid-tools.md).

# RAIDSystems and RAIDLogs rules

Two RAID apps read this project, and a few lines of code are shaped the way they are so those apps can understand them. If you change these lines, keep the shape.

## RAIDSystems

RAIDSystems draws the robot's electrical and programming schematic. Its **Sync code** button reads the code itself:

| It reads                            | From                                                       | Keep it like this                                                                                                               |
| ----------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Devices                             | Every `new TalonFX(ID, BUS)` (and CANcoder, CANrange, ...) | One plain line per device, with ID and bus taken from `Constants`                                                               |
| Which mechanism a device belongs to | The class the device is created in                         | Create each device in the mechanism class that owns it                                                                          |
| IDs                                 | `Constants.java`                                           | `public static final int NAME = number;` with no math or lookups                                                                |
| Buses                               | `Constants.java`                                           | `public static final CANBus NAME = new CANBus("name");`. `new CANBus()` is the controller's bus, which RAIDSystems calls "rio". |
| Controllers                         | `Robot.java`                                               | `new CommandXboxController(port)`                                                                                               |
| Button descriptions                 | The comment right above each binding in `DriveTeleop.java` | One binding per line; a plain-words comment above it, written for a driver                                                      |

To preview what RAIDSystems will find without pushing, run this in the RAIDSystems project:

```bash
bun scripts/parse-local.ts <path to this project>
```

## RAIDLogs

RAIDLogs reads match logs to find problems. It finds entries by how their names **end**, so keep these exactly as written:

| Entry                                                         | Logged in                     | Used for                                           |
| ------------------------------------------------------------- | ----------------------------- | -------------------------------------------------- |
| `DS:enabled`, `DS:autonomous`                                 | `RobotLog.java`               | Timing everything from enable                      |
| `SystemStats/BatteryVoltage`, `SystemStats/BrownedOut`        | `RobotLog.java`               | Battery and brownout checks                        |
| `SystemStats/CANBus/...`                                      | `RobotLog.java`               | CAN checks                                         |
| `Robot/LoopTimeMs`                                            | `RobotLog.java`               | Loop overrun check                                 |
| `Superstructure/State`                                        | `Superstructure.java`         | What the robot was doing when something went wrong |
| `Drive/Pose`, `Drive/MeasuredSpeeds`, `Drive/CommandedSpeeds` | `SwerveTelemetry.java`        | Pose, and drivetrain not doing what it's told      |
| `/limelight.../...`                                           | Each Limelight, automatically | Vision checks                                      |

Limelight names must start with `limelight` for RAIDLogs to find them.

If a name must change, a programmer can map it by hand in **RAIDLogs › Event setup › Signals**.

## Names that match across tools

Name each mechanism's logging table after its class (`RobotLog.table("Arm")` in `Arm.java`). RAIDSystems names mechanisms by class too, so the log, the schematic and the code all use one name.


---

# 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/reference/raid-tools.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.
