Skip to main content
Use airgen.MultirotorClient when flying drones or VTOL platforms. Commands default to the world NED frame, with body-frame overloads for heading-relative motion.

moveToPositionAsync

Fly to a world-space position at a specified speed. AirGen interpolates a smooth velocity profile while respecting drivetrain constraints.
import airgen
from airgen.types import Vector3r

client = airgen.MultirotorClient()
client.enableApiControl(True)
client.armDisarm(True)

target = Vector3r(10.0, 0.0, -5.0)  # 10 m north, hover 5 m above takeoff altitude

future = client.moveToPositionAsync(
    x=target.x_val,
    y=target.y_val,
    z=target.z_val,
    speed=4.0,
    timeout_sec=30.0,
)
future.join()

moveByVelocityAsync

Command a constant velocity in world axes for a fixed duration. Useful for strafing, orbiting, or gently nudging the vehicle.
client.moveByVelocityAsync(
    vx=2.0,   # forward (North) m/s
    vy=1.0,   # right (East) m/s
    vz=0.0,   # maintain altitude
    duration=3.0,
    yaw_rate=30.0,
).join()

moveByVelocityBodyFrameAsync

Command velocities in the drone’s body frame, where +X points forward, +Y points right, and +Z points down relative to the vehicle. This is handy for heading-relative strafes, orbits, and smooth camera moves without manually rotating vectors into world coordinates.
client.moveByVelocityBodyFrameAsync(
    vx=3.0,   # surge forward in the body frame
    vy=0.5,   # slide right relative to current heading
    vz=0.0,
    duration=2.0,
    yaw_rate=0.0,
).join()
When you already have a Vector3r velocity, use moveByVelocityBodyFrameAsyncV().
from airgen.types import Vector3r

body_velocity = Vector3r(2.0, -0.5, 0.0)
client.moveByVelocityBodyFrameAsyncV(
    velocity=body_velocity,
    duration=1.5,
    yaw_rate=90.0,
).join()

moveOnPathAsync

Trace a set of world-space waypoints. Supply a list of Vector3r points and optional yaw rates to choreograph complex maneuvers.
from airgen.types import Vector3r

path = [
    Vector3r(0.0, 0.0, -5.0),
    Vector3r(10.0, 0.0, -5.0),
    Vector3r(10.0, 5.0, -8.0),
]

client.moveOnPathAsync(
    path=path,
    speed=5.0,
    yaw_rate=45.0,
    tolerance=0.5,
).join()