> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rua.hud.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Drone

> A Crazyflie flown by velocity, in the heading frame.

> [!NOTE]
>
> **Class** `drone` · **Part** `base` · **Env** `drone` (Bitcraze Crazyflie 2, fly through a gate and land on a pad)

One part, `base`, in `base_vel`. A controller in the sim turns velocity keyframes into rotor thrust.

## What `move` takes

| Part | Space | Dimensions and range |
| - | - | - |
| `base` | `base_vel` | `vx`, `vy` ±2 m/s, `vz` ±1 m/s, `wz` ±90 deg/s, in the heading frame |

## Example spec

```python Spec theme={"dark"}
import math

from rua.direct import Dim, Part, RobotSpec

LINEAR_ACCEL = 4.0

SPEC = RobotSpec(
    "drone",
    "base_vel",
    (
        Part(
            "base",
            "base_vel",
            (
                Dim("vx", "m/s", -2.0, 2.0, max_accel=LINEAR_ACCEL),
                Dim("vy", "m/s", -2.0, 2.0, max_accel=LINEAR_ACCEL),
                Dim("vz", "m/s", -1.0, 1.0, max_accel=LINEAR_ACCEL),
                Dim("wz", "rad/s", -math.radians(90), math.radians(90), max_accel=math.radians(2800)),
            ),
        ),
    ),
)
```

## Example calls

Climb, then fly forward while turning:

```json move theme={"dark"}
{
  "keyframes": [
    {"t": 1.0, "base": {"vz": 0.5}},
    {"t": 2.0, "base": {"vz": 0.0}},
    {"t": 5.0, "base": {"vx": 1.0, "wz": 30}},
    {"t": 6.0, "base": {"vx": 0.0, "wz": 0}}
  ],
  "note": "Climb, then fly forward while turning left."
}
```

```json done theme={"dark"}
{"reason": "The drone is on the landing pad."}
```

## What comes back

The measured velocity, the pose in the odom frame (height included), and the first-person and chase cameras.

## Limits

* Vetoes acceleration: 4 m/s² on `vx`, `vy` and `vz` together, which share one limit on their combined size.
* No collision check. A tilt past 80 degrees, leaving the arena, or touching the gate is decided by the sim and can end the episode.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.