udaan.flatness.quadrotor module

Differential flatness for the single rigid-body quadrotor.

Flat output:

y = (x_Q, ψ)

where x_Q ∈ R^3 is the centre-of-mass position and ψ ∈ R is the yaw angle.

Derivative orders required:

x_Q through snap (x, ẋ, ẍ, x⁽³⁾, x⁽⁴⁾)
ψ   through ψ̈

The map recovers the full state (x_Q, v_Q, R, Ω) plus the feedforward thrust and moment (f, M).

Flat outputs are carried as Jet bundles — x is a dim-3 jet of order ≥ 4 (through snap); psi is a scalar jet of order ≥ 2.

Reference:

D. Mellinger and V. Kumar, “Minimum Snap Trajectory Generation and Control for Quadrotors”, ICRA 2011.

class udaan.flatness.quadrotor.Quadrotor[source]

Bases: Flat2State

Differential-flatness recovery for the single rigid-body quadrotor.

Flats

alias of QuadrotorFlats

Inputs

alias of QuadrotorInputs

RefState

alias of QuadrotorRefState

__init__(mass, inertia)[source]
classmethod from_model(model)[source]

Build from a udaan.models.quadrotor.QuadrotorBase-like model.

Return type:

Quadrotor

recover(flats)[source]

Map flat-output derivatives to (reference state, feedforward inputs).

Subclasses must override.

Return type:

tuple[QuadrotorRefState, QuadrotorInputs]

class udaan.flatness.quadrotor.QuadrotorFlats[source]

Bases: object

Flat output of a rigid-body quadrotor: position jet (order ≥ 4) and yaw-angle jet (order ≥ 2).

x

dim-3 Jet of the centre-of-mass position, with derivatives through snap (order ≥ 4).

psi

scalar Jet of the yaw angle, with derivatives through yaw acceleration (order ≥ 2).

__init__(x, psi)
psi: Jet
x: Jet
class udaan.flatness.quadrotor.QuadrotorInputs[source]

Bases: object

Feedforward inputs recovered from the flat output.

__init__(thrust=0.0, moment=<factory>)
moment: NDArray[floating]
thrust: float = 0.0
class udaan.flatness.quadrotor.QuadrotorRefState[source]

Bases: object

Recovered kinematic reference state for a quadrotor.

The first four fields mirror udaan.models.quadrotor.base.QuadrotorState; acceleration and angular_acceleration are extras that the flatness map also makes available.

__init__(position=<factory>, velocity=<factory>, acceleration=<factory>, orientation=<factory>, angular_velocity=<factory>, angular_acceleration=<factory>)
acceleration: NDArray[floating]
angular_acceleration: NDArray[floating]
angular_velocity: TSO3
as_state()[source]

Project onto the model’s QuadrotorState shape (drops acceleration + angular_acceleration).

orientation: SO3
position: NDArray[floating]
velocity: NDArray[floating]