Autonomous UAV control: from RRT* to minimum snap
Abstract
3D simulation of a quadrotor with a complete autonomous control stack: RRT* path planning around obstacles, minimum snap trajectory generation, and a cascaded controller for tracking. Everything is written in Python and tested, with the mathematical derivation documented in the repository.
01The problem
Making a quadrotor follow a trajectory is not just about finding a path to the goal. The path must be feasible for the drone's dynamics, collision-free, and smooth enough: the quadrotor is modeled here as a 4th-order system, so the trajectory must be differentiable at least four times (velocity, acceleration, jerk, snap).
02Planning: RRT*
Waypoints are generated by RRT*, which explores free space around obstacles and progressively refines the path towards the optimum, where vanilla RRT stops at the first path found. [3]
03Trajectory: minimum snap
Between waypoints, the optimal trajectory is the one that minimizes snap (the fourth derivative of position). It takes the form of a 7th-order polynomial whose 8 coefficients are set by 8 boundary conditions: position, velocity, acceleration and jerk imposed at start and end.
Each condition yields one linear equation: the problem is solved by assembling an 8x8 constraint matrix and computing c = A⁻¹ b. Pure linear algebra, documented equation by equation in the repository. [2]
04Control
Tracking is handled by a cascaded controller inspired by the Flying Machine Arena work (ETH Zurich): an outer position loop commanding a faster inner attitude loop. [1]
05Results
The simulation opens on a flight dashboard: on the left, a 3D animation of the drone with the executed trajectory against the minimum snap reference, the RRT path and the obstacles; on the right, four time series synchronized by a time cursor: position, attitude, propeller speeds and tracking error.
Two simulation demos, straight from the repository.
06The stack
| Layer | Choice |
|---|---|
| Planning | RRT* with obstacle avoidance |
| Trajectory | minimum snap, 7th-order polynomials |
| Control | cascaded position / attitude |
| Language | Python, NumPy |
| Quality | pytest, measured coverage |
@software{uav_autonomous_control,
author = {Vinceslas, Medhy},
title = {3D UAV simulation and autonomous control for path tracking},
url = {https://github.com/Mdhvince/UAV-Autonomous-control},
note = {Open source}
}
07References
- Lupashin, S., Hehn, M., Mueller, M. W., Schoellig, A. P., Sherback, M., D'Andrea, R. A platform for aerial robotics research and demonstration: The Flying Machine Arena. Mechatronics, 2014.
- Mellinger, D., Kumar, V. Minimum snap trajectory generation and control for quadrotors. ICRA, 2011.
- Karaman, S., Frazzoli, E. Sampling-based algorithms for optimal motion planning. IJRR, 2011.