# Offset Offloading

## What is Offset Offloading?

Offset Offloading is where the absolute encoder offset is stored on the absolute encoder (or Motor Controller if the absolute encoder is attached to the motor controller) instead of the roboRIO. This normally results in a faster loop cycle on the roboRIO however it can add some instability to the Swerve Drive if anything breaks during a match, like a CAN bus or a low brown-out.

## How do I enable Offset Offloading?

{% hint style="warning" %}
[`SwerveDrive.pushOffsetsToEncoders`](https://yet-another-software-suite.github.io/YAGSL/javadocs/swervelib/SwerveDrive.html#pushOffsetsToEncoders\(\)) and [`SwerveDrive.restoreInternalOffset`](https://yet-another-software-suite.github.io/YAGSL/javadocs/swervelib/SwerveDrive.html#restoreInternalOffset\(\)) are now deprecated as of YAGSL 2026.
{% endhint %}

Offset offloading is enabled by [`SwerveDrive.pushOffsetsToEncoders`](https://yet-another-software-suite.github.io/YAGSL/javadocs/swervelib/SwerveDrive.html#pushOffsetsToEncoders\(\)) and disabled by using [`SwerveDrive.restoreInternalOffset`](https://yet-another-software-suite.github.io/YAGSL/javadocs/swervelib/SwerveDrive.html#restoreInternalOffset\(\)) both of these call a function of the same name in `SwerveModule` for every instiantiated module.

<pre class="language-java"><code class="lang-java">  /**
   * Initialize {@link SwerveDrive} with the directory provided.
   *
   * @param directory Directory of swerve drive config files.
   */
  public SwerveSubsystem(File directory)
  {
    // Configure the Telemetry before creating the SwerveDrive to avoid unnecessary objects being created.
    SwerveDriveTelemetry.verbosity = TelemetryVerbosity.HIGH;
    swerveDrive = new SwerveParser(directory).createSwerveDrive(Constants.MAX_SPEED);
<strong>    swerveDrive.pushOffsetsToEncoders();
</strong>  }
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yagsl.com/overview/our-features/offset-offloading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
