> 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/how-to-guides/set-up-advantagescope.md).

# Set up AdvantageScope

AdvantageScope is a data visualization tool, courtesy of team 6328 Mechanical Advantage, which can visualize the swerve drive to give you feedback for debugging.

## Opening

Since the 2024 season, [AdvantageScope](https://github.com/Mechanical-Advantage/AdvantageScope) has been included with the WPILib installation. There is no external download required, but with every WPILib update you should re-download the [WPILib installer](https://docs.wpilib.org/en/stable/docs/zero-to-robot/step-2/wpilib-setup.html) to get the latest version of WPILib tools.

## Configuring AdvantageScope

1. Connect your laptop to the robot.
2. Open `AdvantageScope (WPILib)`, or in VS Code open the command palette and type `WPILib: Start Tool`, then click `AdvantageScope`.
3. Click `Help`, then `Show Preferences`.

<figure><img src="https://567506766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F754c0Fpq8fBi6k4ByS1k%2Fuploads%2Fgit-blob-c437a229fbe97723d36fc243a7ac92e39097adfd%2FAdvantageScope-Preferences.png?alt=media" alt="AdvantageScope Help menu."><figcaption><p>AdvantageScope's help menu</p></figcaption></figure>

4. In the **Robot Address** field, enter the SystemCore's IP address based on your team number: `10.TE.AM.2`.

<figure><img src="https://567506766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F754c0Fpq8fBi6k4ByS1k%2Fuploads%2Fgit-blob-2a95113b334a8b52ca1e72dacb582cbb1d212d61%2FAdvantageScope-Preferences-IP.png?alt=media" alt="Robot Address field in AdvantageScope preferences."><figcaption><p>Robot Address field highlighted</p></figcaption></figure>

5. Connect to the robot (or the simulator).

<figure><img src="https://567506766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F754c0Fpq8fBi6k4ByS1k%2Fuploads%2Fgit-blob-5fe8086da257c0f2ccd6dd9135f8d9dd4e7f1ed5%2FAdvantageScope-Connect.png?alt=media" alt="Connect to Robot menu in AdvantageScope."><figcaption><p>Connect to Robot menu</p></figcaption></figure>

6. On the right side of the window, click `+` to add a new tab.

<figure><img src="https://567506766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F754c0Fpq8fBi6k4ByS1k%2Fuploads%2Fgit-blob-ae2d4ad70a14822b5aa01710ed1e6591f83d48b1%2FAdvantageScope-Add.png?alt=media" alt="Add new tab button in AdvantageScope."><figcaption><p>Add new tab</p></figcaption></figure>

7. Add a new 🦀 Swerve tab.

<figure><img src="https://567506766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F754c0Fpq8fBi6k4ByS1k%2Fuploads%2Fgit-blob-06a3d874f2a4a67f6407a17001d8b9ec789a376f%2FAdvantageScope-Swerve.png?alt=media" alt="Swerve tab in AdvantageScope."><figcaption><p>Swerve tab</p></figcaption></figure>

8. In the Sources field, drag in each `Mechanisms/swerve` field:
   * `Mechanisms/swerve/states/current`
   * `Mechanisms/swerve/states/desired`
   * `Mechanisms/swerve/chassis/current`
   * `Mechanisms/swerve/chassis/desired`

<figure><img src="https://567506766-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F754c0Fpq8fBi6k4ByS1k%2Fuploads%2Fgit-blob-344d8db2750649e6828192b8781fb9c62c735622%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You may need to enable your robot before AdvantageScope shows values for these fields.
{% endhint %}

{% hint style="info" %}
`swerve` is the telemetry name you gave the drive with `SwerveDriveConfig.withTelemetry("swerve", ...)`; if you named it something else, look under `Mechanisms/<that name>`. The `current` fields need `TelemetryVerbosity.MID` or higher and the `desired` fields need `TelemetryVerbosity.HIGH`.
{% endhint %}

To see the robot's pose on a 2D/3D field, add a **2D Field** or **3D Field** tab instead and drag in `Mechanisms/swerve/pose`.

## Reading the display

{% hint style="info" %}
The **RED** lines are the measured velocity and position of each swerve module.

The **BLUE** lines are the velocity and position each module was commanded to.
{% endhint %}

Large, persistent gaps between the red and blue lines usually point to a tuning issue. See [how to tune PIDF gains](/how-to-guides/tune-pidf-gains.md) and [swerve drive drift causes](/reference/swerve-drift-causes.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 by asking a question.

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

```
GET https://yagsl.yassrobotics.com/how-to-guides/set-up-advantagescope.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.
