An open-source Software in the Loop simulator connecting PX4 or Ardupilot flight controllers to a Simulink physics plant, sensor, and environmental model.
This software simulates an aircraft using the PX4 or Ardupilot flight code, a Simulink-based physics plant, sensor, and environmental model. The primary goal is to provide a clear example of how to connect PX4 or Ardupilot to a Simulink plant model.
The flight controller used is a modified PX4 autopilot (V1.14.0). The latest Ardupilot may also be used. The SIL model VehicleSilSimulation.slx and plant model VehiclePlant.slx are both in the root directory. The default plant model is based on an F-16 aircraft derived from Aircraft Control and Simulation (Stevens, Lewis, Johnson, 3rd Ed.). A 300 lb hexarotor model is also included. Users can add custom plants by following the Adding Custom Vehicle Configuration section of the repository. All models were created using MATLAB 2024a Update 6.
Source code and documentation are available on GitHub: github.com/optimAero/optimAeroPX4SIL