> For the complete documentation index, see [llms.txt](https://yams.yassrobotics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yams.yassrobotics.com/api-reference/java-reference/config/flywheel-config.md). Agents can also search and read this documentation through its [MCP server](https://yams.yassrobotics.com/~gitbook/mcp).

# FlyWheelConfig

**Package:** `yams.core.mechanisms.config`\
**Javadoc:** [`FlyWheelConfig`](https://javadocs.yassrobotics.com/yams/yams/core/mechanisms/config/FlyWheelConfig.html)

`FlyWheelConfig` configures a velocity-controlled spinning mechanism: shooters, and also intakes, rollers, feeders and indexers (even when driven open loop).

All builder methods return the `FlyWheelConfig` instance for chaining.

See also: [FlyWheel](https://yams.yassrobotics.com/api-reference/java-reference/mechanisms/flywheel.md)

{% hint style="info" %}
**Simulation Note:** Moment of inertia is not configured on `FlyWheelConfig`. Set it via `SmartMotorControllerConfig.withMomentOfInertia(Distance length, Mass mass)`.
{% endhint %}

***

## Constructor

```java
FlyWheelConfig()
FlyWheelConfig clone()  // Deep copy
```

***

## Builder methods

| Method                                                        | Parameters                                             | Description                                                                                                                                                                                                                 |
| ------------------------------------------------------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `withDiameter(Distance diameter)`                             | `diameter`: wheel/roller outer diameter                | Wheel size used for angular-to-linear velocity conversion (`getLinearVelocity`, `getAngularVelocity`) and the visualization.                                                                                                |
| `withSpeedometerSimulation(AngularVelocity maxVelocity)`      | `maxVelocity`: maximum simulated velocity              | Enables a simulated speedometer gauge capped at `maxVelocity`.                                                                                                                                                              |
| `withSpeedometerSimulation()`                                 | *(none)*                                               | Enables the speedometer with the previously configured max velocity. Throws a `FlyWheelConfigurationException` if max velocity was not set first.                                                                           |
| `disableSpeedometerSimulation()`                              | *(none)*                                               | Disables the speedometer simulation.                                                                                                                                                                                        |
| `withSimColor(Color8Bit color)`                               | `color`: RGB color                                     | Sets the Mechanism2d visualization color. Optional; defaults to orange.                                                                                                                                                     |
| `withMechanismPositionConfig(MechanismPositionConfig config)` | `config`: position config                              | Where the mechanism is on the robot, for `getPose3d()`, and the plane it moves in. See [MechanismPositionConfig](https://yams.yassrobotics.com/api-reference/java-reference/config/mechanism-position-config.md). Optional. |
| `withTelemetry(String name, TelemetryVerbosity verbosity)`    | `name`: NT key prefix, `verbosity`: `LOW`/`MID`/`HIGH` | Enables NetworkTables telemetry for this mechanism. Optional.                                                                                                                                                               |

***

## Getters

| Method                                        | Returns                        | Description                                                                  |
| --------------------------------------------- | ------------------------------ | ---------------------------------------------------------------------------- |
| `getTelemetryName()`                          | `Optional<String>`             | The configured NT prefix, or empty if telemetry is not set.                  |
| `getTelemetryVerbosity()`                     | `Optional<TelemetryVerbosity>` | The configured verbosity, or empty.                                          |
| `getDiameter()`                               | `Optional<Distance>`           | The wheel diameter, or empty if not configured.                              |
| `getCircumference()`                          | `Distance`                     | The wheel circumference. Requires `withDiameter`.                            |
| `getLinearVelocity(AngularVelocity velocity)` | `LinearVelocity`               | Converts a wheel angular velocity to surface speed. Requires `withDiameter`. |
| `getAngularVelocity(LinearVelocity velocity)` | `AngularVelocity`              | Converts a surface speed to wheel angular velocity. Requires `withDiameter`. |
| `isUsingSpeedometerSimulation()`              | `boolean`                      | Whether the speedometer simulation is enabled.                               |
| `getSpeedometerMaxVelocity()`                 | `Optional<AngularVelocity>`    | The speedometer maximum velocity, or empty.                                  |
| `getSimColor()`                               | `Color8Bit`                    | The visualization color. Defaults to orange.                                 |
| `getMechanismPositionConfig()`                | `MechanismPositionConfig`      | The position/plane configuration.                                            |

***

## Example

```java
FlyWheelConfig config = new FlyWheelConfig()
    .withDiameter(Inches.of(4))
    .withSpeedometerSimulation(RPM.of(6000))
    .withTelemetry("Shooter", TelemetryVerbosity.HIGH);
```

{% @github-files/github-code-block url="<https://github.com/Yet-Another-Software-Suite/YAMS/blob/master/examples/commands2/simple_robot-2027/src/main/java/first/robot/subsystems/ShooterSubsystem.java#L49-L53>" %}


---

# 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://yams.yassrobotics.com/api-reference/java-reference/config/flywheel-config.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.
