Contenido principal

Getting Started: PX4 QAV250 Indoor Flight with Simulink

R2026b

Overview

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

CategoryComponentQuantity
FrameQAV250 carbon fiber frame kit1
Flight ControllerPixhawk 6C (Holybro)1
Companion ComputerRaspberry Pi Zero 2W1
CameraPi Camera Module 2 or Module 3 (CSI)1
Motors2204 or 2205 brushless motors (2300 KV)4
ESCs20A–30A ESCs (BLHeli or similar)4
Indoor SensorsPMW3901 Optical Flow Sensor1
Indoor SensorsST VL53L1X Time-of-Flight Sensor1
RC SystemRC transmitter and receiver1
Battery3S 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.

Workflow Summary

StepDescriptionExit Criteria
1Hardware Setup for QAV250 MulticopterHardware assembly completed. QGroundControl detects the Pixhawk 6C. Raspberry Pi communication, camera, and sensor connections verified.
2Install Support Packages and Verify Simulink ModelsRequired products and support packages installed, project opens successfully, and flight control and perception model simulations run without errors.
3Configure PX4 Firmware and QGroundControlVehicle achieves Ready status in QGroundControl and all pre-arm checks pass.
4Validate System for Indoor FlightVehicle arms successfully, all motors respond correctly, and stable indoor hover in Position mode is achieved.
5Fly Multicopter and Perform Perception-Guided Indoor FlightObject 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.