udaan.utils.trajectory.flip module¶
Aggressive trajectories for quadrotor — flip and spiral maneuvers.
FlipTrajectory: vertical loop (360° pitch rotation) via circular acceleration in the xz-plane. Requires differential flatness feedforward.
SpiralTrajectory: helical path with circular motion in yz-plane and linear advance along x.
All derivatives up to snap (4th order) are analytic.
- class udaan.utils.trajectory.flip.FlipTrajectory[source]¶
Bases:
TrajectoryVertical loop trajectory: hold -> climb -> 360° pitch flip -> recover -> hold.
- The flip phase uses a constant-thrust circular acceleration profile:
a_x(t’) = T * sin(w * t’) a_z(t’) = T * cos(w * t’) - g
The thrust vector rotates 360° in the xz-plane. During the inverted phase (90°-270°), thrust projection is negative — the quadrotor is in free-fall. This is physically correct; the attitude controller maintains rotation via torque feedforward from flat2state.
- Parameters:
start – starting hover position [x, y, z].
flip_duration – time for the 360° rotation (seconds).
thrust_ratio – thrust / (m*g) during the flip.
climb_time – duration of the climb phase.
recover_time – duration of the recovery phase.
hold_time – hover duration before and after the maneuver.
- __init__(start=array([0., 0., 2.]), flip_duration=0.5, n_loops=3, thrust_ratio=1.5, climb_time=2.0, recover_time=2.0, hold_time=1.0)[source]¶
- property duration¶
- property end_position¶
- class udaan.utils.trajectory.flip.SpiralTrajectory[source]¶
Bases:
TrajectoryHelical spiral: circle in yz-plane while advancing along x.
The trajectory smoothly accelerates from hover, executes N loops of a helix, then smoothly decelerates back to hover.
- Parameters:
start – starting hover position [x, y, z].
radius – radius of the circular motion in yz-plane (meters).
speed – tangential speed of the circular motion (m/s).
n_loops – number of full loops.
advance – total x-distance traveled over all loops (meters).
hold_time – hover duration before and after the maneuver.
- __init__(start=array([0., 0., 2.]), radius=0.8, speed=2.0, n_loops=2, advance=3.0, hold_time=1.0)[source]¶
- property duration¶
- property end_position¶