Introduction
PX4 is a professional open-source autopilot for drones, VTOL aircraft, rovers, and boats. As part of the Dronecode ecosystem, it runs on dedicated flight controller hardware (Pixhawk) and provides autonomous flight capabilities including waypoint missions, obstacle avoidance, and computer vision-guided navigation.
What PX4 Does
- Controls multirotor, fixed-wing, VTOL, helicopter, and ground vehicle platforms
- Executes autonomous missions with waypoints, loiter, return-to-launch, and landing
- Integrates with companion computers for vision-based navigation and obstacle avoidance
- Communicates via MAVLink protocol with ground control stations and companion apps
- Supports multiple simulation backends (Gazebo, jMAVSim, AirSim) for safe development
Architecture Overview
PX4 uses a publish-subscribe middleware (uORB) for inter-module communication on the flight controller. The flight stack comprises estimators (EKF2 for state estimation), controllers (position, attitude, rate), and a navigator for mission execution. Drivers abstract sensor hardware (IMU, barometer, magnetometer, GPS). The system runs on NuttX RTOS on Pixhawk hardware or as a POSIX process for simulation. Communication with ground stations and companion computers uses MAVLink over serial, UDP, or TCP.
Self-Hosting & Configuration
- Flash firmware to Pixhawk hardware via QGroundControl or command line
- Configure airframe, sensors, and tuning parameters through QGroundControl GUI
- Use parameter files for reproducible configuration across vehicle fleets
- Set up companion computer link via MAVROS (ROS) or MAVSDK (Python/C++)
- Simulation requires no hardware: runs entirely on a development machine
Key Features
- Certified for commercial drone operations in multiple countries
- EKF2 sensor fusion handles GPS, optical flow, vision, and multiple IMUs
- Fail-safe system with configurable actions for GPS loss, low battery, and communication failure
- Geofence and flight termination systems for safety-critical operations
- Log analysis tools (Flight Review) for post-flight diagnostics
Comparison with Similar Tools
- ArduPilot — more vehicle types and hobbyist-friendly; PX4 has cleaner architecture and better commercial adoption
- Betaflight — optimized for FPV racing; PX4 targets autonomous operations and commercial drones
- DJI SDK — proprietary, locked to DJI hardware; PX4 is hardware-agnostic and fully open
- ROS 2 Navigation — higher-level planning; PX4 handles the low-level flight control layer
FAQ
Q: What hardware does PX4 run on? A: Primarily Pixhawk-series flight controllers (FMUv5/v6), plus several third-party boards.
Q: Can PX4 fly without GPS? A: Yes, using optical flow, visual-inertial odometry, or motion capture for indoor flight.
Q: Is PX4 suitable for commercial drone products? A: Yes, it is used in commercial products by companies worldwide with appropriate certification.
Q: How do I add custom flight modes? A: Implement a FlightTask module in C++ following the documented architecture patterns.