UAV Toolbox Support Package for PX4 Autopilots

Access PX4 autopilot peripherals with UAV Toolbox and automatically build and deploy flight control algorithms with Embedded Coder
6.9K Downloads
Updated 13 Dec 2023
Using the UAV Toolbox Support Package for PX4® Autopilots, you can access autopilot peripherals from MATLAB® and Simulink®. With Embedded Coder®, you can also automatically generate C++ code and use the PX4 toolchain to build and deploy algorithms tailored specifically for Pixhawk® and Pixracer flight management units (FMU), all while incorporating onboard sensor data and other PX4-specific services. PX4 is a trademark of Lorenz Meier.
Features
  • Out of the box support for Cube Orange, Pixhawk 6x, Pixhawk 1, Pixhawk 2.1 (Cube), Pixracer and Pixhawk 4. Other FMU based boards are also supported.
  • Automated C++ Code - generation, Integration of code generated from Simulink with the general PX4 architecture Deployment, and Execution on the Pixhawk boards.
  • Hardware-in-the-Loop (HITL) Simulation support with the PX4 Autopilot.
  • Example in Simulink that shows the UAV Dynamics including the sensor simulation communicated to PX4 Autopilot in Hardware-in-the-Loop (HITL) Simulation.
  • Deployment support for PX4 on host computer as PX4 Host Target which the PX4 community refers to as PX4 Software-In-The-Loop (PX4 SITL).
  • Support for Code verification and validation using the Processor-In-Loop simulation.
  • Simulink library to access the Pixhawk peripherals such as ADC, PWM, Serial and I2C.
  • Simulink library for the uORB middleware.
  • Simulink library to get data from the PX4 sensor and estimator module such as Accelerometer, Gyroscope, Magnetometer, Battery, Vehicle Attitude and GPS.
  • Data logging support from Simulink on the SD card while flying.
  • Communicate with the Pixhawk hardware and PX4 Host Target using Connected I/O mode.
  • Real-Time parameter tuning and signal acquisition using Monitor & Tune.
  • Examples showing Position and Attitude Control for X-Configuration Quadcopter.
  • Example with Simulink based plant model which communicates flight controller in PX4 Host Target.
Supported PX4 Autopilots
The following Autopilots are supported out-of-the box in the support package
  • Cube Orange
  • mRo Pixhawk 1
  • ProfiCNC Pixhawk 2.1 (Cube)
  • mRo Pixracer
  • Holybro Pixhawk 4
Apart from the above boards, other FMU based boards can be used with the support package by selecting the Hardware board as PX4 Pixhawk Series. More details on this can be found here.
Documentation
Getting Started
Hardware-in-the-loop (HITL) with PX4 Autopilot Examples
Host Target Simulation with PX4 Examples
Support
If you have any support package download or installation problems, obtain the installation file log by following the instructions mentioned here and contact - Technical Support with the installation log.
MATLAB Release Compatibility
Created with R2018b
Compatible with R2018b to R2024a
Platform Compatibility
Windows macOS (Apple silicon) macOS (Intel) Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!