MATLAB Simulation and PX4 implimentation

Hello there!

I am working on a project where I want to simulate my drone using MATLAB. I’ve noticed that I can use some PX4 blocks inside MATLAB. I have a couple of questions that I seem to not fully understand, and I am hoping that someone can help me answer them. In advance, thank you!

  1. What is the difference between a PX4 Host Target and something like PixHawk 6x when simulating?

  2. In MATLAB / Simulink, I can chose some blocks like PX4 Actuator Write where it seems like I can write to some motors. Is the idea that I can build a model of my drone in Simulink, then use these PX4 blocks to write to something like a PixHawk 6x, or are the blocks for simulation purposes?

  3. As far as I understand, PX4 is ment as an autopilot flight controller, so how would I use this in MATLAB / Simulink, to control my drone simulation?

I am a novice when it comes to stuff like this, I am really interested in learning this stuff, so any help on understanding how all of this is connected, is much appreciated!

This NASA tech memo has been really helpful for us: Design, Simulation, and Flight Testing of a Multi-Purpose VTOL Flight Control System - NASA Technical Reports Server (NTRS)

It also cites some earlier work that explains more about how to get through the PX4 Autopilot Toolbox.