Set Up PX4 Firmware for Hardware-in-the-loop (HITL) Simulation
The UAV Toolbox Support Package for PX4® Autopilots provides the option to deploy the controller on the PX4 Autopilot and verify the algorithm by running Hardware-in-the-Loop (HITL) simulation. The workflow is based on Hardware in the Loop Simulation (HITL).
The UAV Toolbox Support Package for PX4 Autopilots supports enabling Hardware-in-the-loop (HITL) simulation mode in which the Simulink® generated code integrated with PX4 firmware is run on real flight controller hardware. This feature helps you in testing most of the actual flight code on the real hardware.
Setting up PX4 Firmware
Perform these steps, which are a part of the Hardware Setup process in the UAV Toolbox Support Package for PX4 Autopilots, to enable the PX4 Autopilot for HITL simulation.
In the Select a PX4 Autopilot and Build Target Hardware Setup screen, select any Pixhawk® Series board as the Hardware board. For example, PX4 Pixhawk 4. Click Next.
This feature supports only Pixhawk Series board and does not support PX4 Host Target.
In the Select System Startup Script in PX4 Hardware Setup screen, select Use default startup script(rcS) and click Next.
In the Download QGroundControl Hardware Setup screen, download and install QGC. After installation, click Verify Installation and then click Next
Proceed with the subsequent steps in the Hardware Setup process to build the firmware and verify that the build is successful.