SITL simulation with PX4
Start PteroSim, spawn the aircraft (e.g. F450) while the simulation is stopped, then press Start on the simulation panel. You may start PX4 SITL before or after starting the simulation; lockstep engages once PX4 connects.
In the control source panel choose PX4:
Run PX4 SITL in WSL2 with lockstep. Set
PX4_SIM_HOSTNAMEto the Windows host IP as seen from WSL (PX4 connects from WSL to PteroSim on Windows; this is the default gateway, often172.20.0.1):export PX4_SIM_HOSTNAME=$(ip route | awk '/default/ {print $3; exit}') PX4_LOCKSTEP=1 PX4_SIM_SPEED_FACTOR=1 make px4_sitl none_iris
Launch QGroundControl and open Application Settings:
Add or edit a Comm Link to your PX4 instance (UDP to the WSL IP where SITL runs —
hostname -Iin Ubuntu — typically port 14550):
Manually connect using the configured link:
Head to Plan Flight:
Create flight plan using options on the pannel on the left of the screen and press Upload button to upload the plan.
Exit planning mode and use the takeoff slider.