> 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/c++-reference/config/pivot-config.md). Agents can also search and read this documentation through its [MCP server](https://yams.yassrobotics.com/~gitbook/mcp).

# PivotConfig

**Namespace:** `yams::mechanisms::config`\
**Header:** `<yams/mechanisms/config/PivotConfig.hpp>`\
**Java equivalent:** [Java PivotConfig](https://yams.yassrobotics.com/api-reference/java-reference/config/pivot-config.md)\
**Doxygen:** [`PivotConfig`](https://doxygen.yassrobotics.com/yams/classyams_1_1mechanisms_1_1config_1_1PivotConfig.html)

`PivotConfig` holds physical and simulation parameters for a `Pivot` mechanism. A pivot is a single-jointed rotational mechanism without a load-bearing length (use `ArmConfig` if arm length affects simulation accuracy).

***

## Constructor

```cpp
PivotConfig() = default;
```

***

## Builder methods

All methods return `PivotConfig&` for chaining.

> **Required for simulation:** `WithMinAngle()` and `WithMaxAngle()` must be set, or the `Pivot` constructor throws a `PivotConfigurationException` in simulation. A pivot does not use arm length in its physics model. The `SmartMotorControllerConfig` must also set a starting position (`WithStartingPosition`) and an MOI (`WithMOI`); in 2027 both live on `SmartMotorControllerConfig`.

| Method                                                               | Required                    | Description                                                                                                                                                                                                                    |
| -------------------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `WithTelemetryName(const std::string& name)`                         | Optional                    | Name used for SmartDashboard and log entries                                                                                                                                                                                   |
| `WithMinAngle(wpi::units::degree_t angle)`                           | **Required for simulation** | Minimum allowable mechanism angle; also applied as the motor controller lower limit                                                                                                                                            |
| `WithMaxAngle(wpi::units::degree_t angle)`                           | **Required for simulation** | Maximum allowable mechanism angle; also applied as the motor controller upper limit                                                                                                                                            |
| `WithSimColor(const wpi::util::Color8Bit& color)`                    | Optional                    | Color of the simulated pivot ligament. Defaults to green if not set.                                                                                                                                                           |
| `WithMechanismPositionConfig(const MechanismPositionConfig& config)` | Optional                    | Where the mechanism is on the robot, for `GetPose3d()`, and the plane it moves in, XY unless set. See [MechanismPositionConfig](https://yams.yassrobotics.com/api-reference/c++-reference/config/mechanism-position-config.md) |

***

## Getters

```cpp
std::string GetTelemetryName() const;
std::optional<wpi::units::degree_t> GetMinAngle() const;
std::optional<wpi::units::degree_t> GetMaxAngle() const;
wpi::util::Color8Bit GetSimColor() const;
const MechanismPositionConfig& GetMechanismPositionConfig() const;
```

Getters for optional fields return `std::nullopt` if the corresponding setter was not called. `GetSimColor()` always returns a value (defaults to green).

***

## Exceptions

| Exception                                 | Thrown When                                                                                                               |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `exceptions::PivotConfigurationException` | Required fields (on `PivotConfig` or the motor controller config) are missing when a `Pivot` is constructed in simulation |

***

## Example

```cpp
config::PivotConfig pivotConfig;
pivotConfig.WithMinAngle(0_deg)
           .WithMaxAngle(180_deg)
           .WithTelemetryName("Wrist");
```


---

# 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/c++-reference/config/pivot-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.
