> For the complete documentation index, see [llms.txt](https://docs.auterion.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.auterion.com/app-development/auterion-sdk/flight-mode-api/multicopter-modes/dynamics-in-body-frame.md).

# Dynamics in Body Frame

{% hint style="info" %}
Related C++ Header in the Auterion SDK:`<auterion_sdk/control/control.hpp>`
{% endhint %}

Body Frame Dynamics Mode allows you to control a Multicopter by supplying acceleration and velocity setpoints to the controller in the vehicle's body frame.

## Set up mode

In order to prepare your flight mode to accept `BodyFrameDynamicsSetpoint`, you need to supply the `auterion::multicopter::BodyFrameDynamicsSetpoint::Config` object to your mode constructor like so:

```cpp
auterion::Mode my_mode(sdk, "My Mode", {
    auterion::multicopter::BodyFrameDynamicsSetpoint::Config{}
});
```

## Create setpoints

`BodyFrameDynamicsSetpoint` setpoints take velocity, acceleration, heading and heading rate as arguments. The acceleration and velocity values, if specified together, should be kinematically consistent.

To create a setpoint, you can use the builder pattern like so:

```cpp
auto setpoint = auterion::multicopter::BodyFrameDynamicsSetpoint{}
    .withHorizontalAcceleration({a_x, a_y})
    .withVerticalAcceleration(a_z)
    .withHorizontalVelocity({v_x, v_y})
    .withVerticalVelocity(v_z)
    .withHeading(h)
    .withHeadingRate(h_r);
```

Also any subset of these values is permitted. In order to make the drone follow your setpoints, return these setpoints in the `onUpdateSetpoint` callback method of your mode.


---

# 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 dynamically by asking a question.

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

```
GET https://docs.auterion.com/app-development/auterion-sdk/flight-mode-api/multicopter-modes/dynamics-in-body-frame.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.
