Getting Started: PX4 QAV250 Indoor Flight with Simulink
R2026bOverview
This workflow shows how to assemble, configure, validate, and fly a PX4®-based QAV250 multicopter using Simulink®. The workflow uses a Pixhawk 6C flight controller and a Raspberry Pi Zero 2W companion computer with a Pi Camera Module for indoor perception-guided flight in GPS-denied environments.
By completing this workflow, you learn how to:
Assemble a QAV250 multicopter with indoor flight sensors.
Configure PX4 firmware and QGroundControl for GPS-denied indoor flight.
Deploy a Simulink flight control model (
flightControlSystem.slx) to the Pixhawk 6C.Deploy a Simulink perception model (
PerceptionAndGuidance.slx) to the Raspberry Pi Zero 2W.Perform an indoor hover flight with position hold.
Run a perception-guided flight workflow.
System Architecture
The system consists of four main components:
Host computer — Runs MATLAB® and Simulink to build and deploy firmware and executables.
Pixhawk 6C flight controller — Performs sensor fusion, state estimation, and motor control.
Raspberry Pi Zero 2W companion computer — Executes perception and guidance algorithms.
QAV250 multicopter platform — Includes motors, ESCs, optical flow sensor, time-of-flight sensor, RC receiver, and telemetry components.
During flight, the Raspberry Pi processes camera images and sends guidance commands to the Pixhawk. The Pixhawk combines these commands with sensor data to control the vehicle.
Hardware Requirements
Required Hardware
| Category | Component | Quantity |
|---|---|---|
| Frame | QAV250 carbon fiber frame kit | 1 |
| Flight Controller | Pixhawk 6C (Holybro) | 1 |
| Companion Computer | Raspberry Pi Zero 2W | 1 |
| Camera | Pi Camera Module 2 or Module 3 (CSI) | 1 |
| Motors | 2204 or 2205 brushless motors (2300 KV) | 4 |
| ESCs | 20A–30A ESCs (BLHeli or similar) | 4 |
| Indoor Sensors | PMW3901 Optical Flow Sensor | 1 |
| Indoor Sensors | ST VL53L1X Time-of-Flight Sensor | 1 |
| RC System | RC transmitter and receiver | 1 |
| Battery | 3S or 4S LiPo battery (1300–1500 mAh) | 1 or more |
Software Requirements
MATLAB R2026b or later
Simulink
UAV Toolbox Support Package for PX4 Autopilots
Simulink Support Package for Raspberry Pi Hardware
Embedded Coder®
Simulink Coder™
QGroundControl (latest stable release)
Indoor Flight Workflow
Complete the workflow steps in sequence and verify the exit criteria before proceeding to the next step.
Assemble and Configure a QAV250 Multicopter
If you are starting with an unassembled QAV250 multicopter or a vehicle that has not yet been configured, begin with Step 1: Hardware Setup for QAV250 Multicopter and complete all subsequent steps.
Use a Ready-to-Fly QAV250 Multicopter
If you already have a fully assembled and configured QAV250 multicopter with PX4 installed and stable indoor hover verified, proceed directly to Step 5: Fly Multicopter and Perform Perception-Guided Indoor Flight.
Workflow Summary
| Step | Description | Exit Criteria |
|---|---|---|
| 1 | Hardware Setup for QAV250 Multicopter | Hardware assembly completed. QGroundControl detects the Pixhawk 6C. Raspberry Pi communication, camera, and sensor connections verified. |
| 2 | Install Support Packages and Verify Simulink Models | Required products and support packages installed, project opens successfully, and flight control and perception model simulations run without errors. |
| 3 | Configure PX4 Firmware and QGroundControl | Vehicle achieves Ready status in QGroundControl and all pre-arm checks pass. |
| 4 | Validate System for Indoor Flight | Vehicle arms successfully, all motors respond correctly, and stable indoor hover in Position mode is achieved. |
| 5 | Fly Multicopter and Perform Perception-Guided Indoor Flight | Object detection and perception-guided flight operation verified. |
Caution
This example is intended for indoor flight in a controlled environment and is provided for educational purposes only.
Usage restrictions:
Use this example only for educational and evaluation purposes.
Operate the multicopter in a safe, controlled indoor environment.
Do not use this workflow for outdoor, BVLOS (Beyond Visual Line of Sight), or autonomous surveillance operations.
Comply with all applicable aviation, export control, and local regulatory requirements.
Do not provide this example to restricted parties or use it in restricted regions where prohibited by applicable regulations.
Familiarity with PX4 autopilot systems and multicopter operation is recommended before attempting this workflow.
The user is responsible for operating the system, complying with applicable regulations, and assessing operational risks.
Next Step
To begin the workflow, see Step 1: Hardware Setup for QAV250 Multicopter, which describes how to assemble the vehicle, install the onboard sensors, connect the Raspberry Pi companion computer, and verify basic hardware operation. If a fully assembled and configured QAV250 multicopter is already available, see Step 5: Fly Multicopter and Perform Perception-Guided Indoor Flight.