Software-In-The-Loop (SITL) simulation compiles the full ArduPilot flight stack and runs it as a native process on your development machine. The simulated vehicle receives realistic sensor data from a physics model and responds exactly as it would on real hardware — making it the primary environment for developing and validating code changes before any physical flight.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Ardupilot/ardupilot/llms.txt
Use this file to discover all available pages before exploring further.
How SITL works
SITL uses theAP_HAL_SITL hardware abstraction layer, which replaces drivers for IMU, GPS, barometer, and other sensors with software models. A separate physics backend (the default is ArduPilot’s built-in model, with optional external simulators) generates the sensor data and receives actuator outputs in a closed loop. The sim_vehicle.py script in Tools/autotest/ handles building the binary, launching the physics model, and starting MAVProxy for ground control.
Supported vehicle types
Vehicle flag (-v) | Description |
|---|---|
ArduCopter | Multirotor vehicles (quad, hexa, octa, y6, heli, …) |
ArduPlane | Fixed-wing and VTOL aircraft |
Rover | Ground rovers and boats |
ArduSub | Underwater ROVs |
AntennaTracker | Antenna tracker |
Blimp | Blimp vehicle |
Running SITL
The fastest way to start is withsim_vehicle.py, which configures, builds, and launches the simulation in one command.
Install prerequisites
Follow the ArduPilot environment setup guide for your OS, then clone the repository with all submodules:
Launch a copter simulation
Run MAVProxy starts in the same terminal. You should see the copter armed and ready on the MAVProxy console.
sim_vehicle.py with the -v flag to select a vehicle. The script builds the binary automatically on first run:Open the map and console
Add
--map and --console to get a moving-map display and a parameter/flight-mode console:Frame types
The--frame option selects the motor layout for the vehicle. The most common copter frames are:
| Frame | Description |
|---|---|
quad (default) | 4-motor quadrotor in + configuration |
X | 4-motor quadrotor in X configuration |
hexa | 6-motor hexarotor |
octa | 8-motor octorotor |
octa-quad | 8-motor octa-quad |
y6 | Y6 coaxial tricopter |
tri | Tricopter |
heli | Traditional helicopter |
heli-dual | Dual-rotor helicopter |
plane, quadplane, plane-elevon, and plane-vtail. For external simulators, frames like gazebo-iris and airsim-copter are available.
Common sim_vehicle.py options
--speedup
--speedup
Runs the simulation faster than real time. Useful for long missions or autotest runs.
--speedup 1 is real time (default); higher values trade timing accuracy for speed.--wipe
--wipe
Deletes the simulated EEPROM file so the vehicle starts with factory defaults. Use this when switching frame types or after parameter corruption.
-L LOCATION
-L LOCATION
Sets the takeoff location. Named locations (e.g.,
KSFO, CMAC) are defined in Tools/autotest/locations.txt. You can also pass a raw lat,lon,alt,heading string.--out
--out
Forwards MAVLink traffic to an additional endpoint. Example:
--out 127.0.0.1:14550 to connect a second ground station.External simulators
SITL can delegate physics to an external simulator for higher-fidelity models or sensor simulation:Gazebo
ROS-friendly robot simulator with plugin-based sensor models. Use the
gazebo-iris frame and the ArduPilot Gazebo plugin.JSBSim
High-fidelity fixed-wing aerodynamics. Integrated directly; select with
-f jsbsim.FlightGear
Open-source flight simulator used for visual rendering. Connect via the
flightgear model.X-Plane
Commercial flight simulator. Connect using the
xplane model flag with SITL acting as the autopilot.MAVProxy integration
sim_vehicle.py starts MAVProxy automatically and connects it to the SITL process. Useful MAVProxy commands during a session:
Autotest framework
Tools/autotest/autotest.py is the integration test runner used by CI. It builds a vehicle binary and executes scripted test scenarios against SITL, checking that the vehicle behaves correctly.
Tools/autotest/arducopter.py, arduplane.py, rover.py, and ardusub.py. Each test method arms the vehicle, executes a manoeuvre, and asserts expected behaviour.