Using Embedded Coder® Support Package for PX4® Autopilots, you can generate ANSI/ISO C code from Simulink® models for Pixhawk® autopilots. The support package uses the PX4 toolchain to compile and deploy algorithms tailored specifically for the Pixhawk flight management unit and lets you customize algorithms to incorporate onboard sensor data and other PX4-specific services.
Install hardware support and configure hardware connection
Prepare model for hardware connection, add blocks to support PX4 Autopilots
Run model on target hardware