Modeling and PX4 as controller in Simulation

Hello there!
I am trying to model a quadcopter and its dynamics, and I want to use a PixHawk as a flight controller, which is using PX4. I've designed and model of my quadcopter (so the dynamics are down), but now I want to test PX4 with my model, before I build it in real life. This is where my questions comes in.
  1. How do I use PX4 as a controller in software only, no PixHawk needed? I want to see how PX4 as a controller handles my model in simulation, is there a way to do this?
  2. When I've varified my model in simulation, I want to also do (as I understand it) software in the loop simulation, where I use a PixHawk controller and give it simulated data and see how it would correct my model, of course if it is possible I would like to aslo see how my drone model responds, how would I do this?
It is not clear to me from the given Matlab examples how to do this, so any help on this would be much appreciated.
Thank you in advance for taking your time, it is much appreciated!

Risposte (1)

  1. Monitor and Tune PX4 Host Target Flight Controller with Simulink-Based Plant Model. This example shows how to validate a position controller design on a quadrotor plant using a single Simulink model, and then take the same controller and plant model and simulate it with the PX4 Software In The Loop (SITL) simulation.
  2. PX4 Autopilot in Hardware-in-the-Loop (HITL) Simulation with UAV Dynamics in Simulink. This exampel shows how to validate the designed controller in Hardware-in-the-loop Simulation using any Pixhawk/ PX4 Autopilot hardware. You can re-use the Simulink UAV Dynamics you designed for SITL here to simulate sensor values and use the same to communicate with Autopilot in HITL mode.

Richiesto:

il 4 Mar 2026 alle 20:17

Risposto:

circa 21 ore fa

Community Treasure Hunt

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

Start Hunting!

Translated by