Skip to content

Hardware Simulation

PX4 can run simulation directly on a real flight controller, replacing real sensors with simulated data, while otherwise executing the full flight stack on actual autopilot hardware.

INFO

Simulating PX4 on flight controller hardware exercises more flight stack code than SITL, and tests more of your hardware integration. It can surface issues with running PX4 that might hidden when running on a desktop OS and hardware, or even a different flight controller board.

Two simulation approaches are available, controlled by the SYS_HITL parameter:

  • HITL Simulation (SYS_HITL=1): An external simulator (Gazebo Classic or jMAVSim) runs physics on a companion computer and sends sensor data to the flight controller via MAVLink HIL messages. Requires a USB/UART connection and simulator setup.
  • SIH on Hardware (SYS_HITL=2): A C++ physics model runs directly on the flight controller itself. No external simulator, no companion computer, no MAVLink sensor data. Just set the parameter and reboot.

HITL vs SIH

HITL (SYS_HITL=1)SIH (SYS_HITL=2)
Physics modelExternal simulator (Gazebo Classic, jMAVSim)Internal C++ module
CommunicationMAVLink HIL messagesuORB (internal)
External processRequiredNot required
Setup complexityHigherLower
Sensor simulationCamera, lidar, etc. (via simulator)IMU, GPS, baro, mag, airspeed only
Vehicle typesQuadcopter, Standard VTOLQuad, Hex, FW, VTOL Tailsitter, Standard VTOL, Rover

When to Use Which

  • Use SIH if you want the simplest possible setup. No external dependencies.
  • Use HITL if you need an external physics engine, 3D visualization from Gazebo Classic, or camera/lidar sensor simulation that SIH does not provide.