ArduPilot SITL for Debian ========================== The ardupilot-sitl package runs the autopilot on the computer using simulated sensors and vehicle dynamics. It includes Copter, Helicopter, Plane, Rover, Sub, Blimp, AntennaTracker and Replay. No flight controller is needed. Starting a session =------------------ Install ardupilot-sitl with its recommended packages for the graphical map, console and joystick support. Create a writable directory for each vehicle and frame; the simulator stores parameters, logs and terrain data there: mkdir -p ~/ardupilot-sitl/copter cd ~/ardupilot-sitl/copter ardupilot-sitl --console --map The launcher uses the installed executables and defaults to Copter. It never rebuilds the autopilot. Quit MAVProxy with Ctrl-D, or stop the launcher with Ctrl-C. Files in the session directory are retained for the next run. MAVProxy is recommended rather than required. To use another ground station: ardupilot-sitl --no-mavproxy Connect that ground station using MAVLink over TCP to 127.0.0.1, port 5760. No MAVProxy process is needed for this connection. If mavproxy.py is absent, the Debian launcher selects --no-mavproxy automatically. The --console, --map and --mavproxy-args options require MAVProxy. Stop the launcher with Ctrl-C when finished. For a second independent session, run from a separate writable directory: ardupilot-sitl --no-mavproxy -I 1 Connect its ground station to TCP port 5770. Each instance adds ten times its instance number to the base port. USB controller support in this setup depends on the chosen ground station. Other examples (use a separate session directory for each): ardupilot-sitl -v ArduCopter -f heli --console --map ardupilot-sitl -v ArduPlane --console --map ardupilot-sitl -v Rover --console --map ardupilot-sitl -v ArduSub --console --map ardupilot-sitl -v Blimp --console --map ardupilot-sitl -v AntennaTracker --console --map Use --help for upstream launch options. List vehicles with --list-vehicle and frames with --list-frame ArduCopter. These listing commands return exit status 1 even when they successfully print the list. Known locations are in /usr/share/ardupilot/Tools/autotest/locations.txt; select one with --location NAME. For a first flight in the default Copter simulation, wait for initialization and the pre-arm checks to pass, then enter these MAVProxy commands: mode guided arm throttle takeoff 5 The simulated Copter climbs to five metres. To finish the exercise, enter 'mode land'. With a calibrated controller, 'mode loiter' provides a useful starting point for manual practice; center the throttle for altitude hold. Use these commands in the local SITL session started above. USB controllers and radio transmitters --------------------------------------- Connect the controller in USB joystick mode, or use a compatible trainer-port USB adapter. Confirm that Linux detects it, then enter these MAVProxy commands: module load joystick joystick status watch RC_CHANNELS Move one control at a time and check the reported roll, pitch, throttle and yaw channels before arming the simulation. Controller axis order, direction and throttle centering differ. Calibration and mapping must match the controller. Do not disable arming checks to work around an incorrect controller mapping. MAVProxy ships controller definitions under /usr/lib/python3/dist-packages/MAVProxy/modules/mavproxy_joystick/joysticks/. Copy a suitable definition into ~/.mavproxy/joysticks/ and adapt it for a new controller, then run 'joystick probe'. MAVPROXY_JOYSTICK_DIR can select another directory of definitions. The joystick module requires python3-pygame and python3-yaml; both are recommended by this package. To load a configured controller automatically: ardupilot-sitl --console --map --mavproxy-args='--load-module=joystick' The package uses MAVProxy joystick support. Native SFML displays and joystick input are not compiled in: this upstream checkout uses SFML 2, whereas current Debian unstable provides SFML 3. The MAVProxy map and console provide a visual ground-station view; they are not a three-dimensional flight scene. Models, weather and external simulators ---------------------------------------- The launcher supplies the shipped vehicle and frame parameter presets. The executables embed model definitions and locations. To start a binary without the launcher, pass its parameter preset explicitly, for example: arducopter --model + --home SITL \ --defaults /usr/share/ardupilot/Tools/autotest/default_params/copter.parm mavproxy.py --master=tcp:127.0.0.1:5760 --sitl=127.0.0.1:5501 Run these commands in two terminals in the same writable session directory. Raw executable options are available with --help. The launcher lists frames with --list-frame ArduCopter. The blimp executable is named ardupilot-blimp in PATH, and Replay is named ardupilot-replay. Parameters such as SIM_WIND_SPD, SIM_WIND_DIR and SIM_WIND_TURB configure the simulation environment. Use --add-param-file or --param NAME=VALUE to layer settings over the launcher's vehicle and frame presets. Use -w or --wipe-eeprom to reset stored parameters; logs remain in the session directory. The upstream launch options include independent instances with -I, multiple vehicles with --count, and FlightGear view output with --enable-fgview. With MAVProxy running, --out forwards telemetry, normally to UDP port 14550. Without MAVProxy, connect directly to the simulator's TCP port 5760. Additional instances offset their ports by 10 times the instance number. SITL network ports are intended for a trusted simulation environment. Three-dimensional scenes require a separately installed simulator, such as Gazebo or FlightGear. Gazebo also requires the ArduPilot Gazebo plugin. These programs and plugins are not bundled or installed automatically. Integration examples, JSON/Webots/MATLAB resources and aircraft models are installed under /usr/share/ardupilot/libraries/SITL/examples/ and /usr/share/ardupilot/Tools/autotest/aircraft/. External simulators and optional peripheral firmware may require their own setup or a custom ArduPilot build. The bundled Webots Python BlueBoat and Iris scene examples are omitted from Debian's sources and installed resources; see README.source for the licensing details. The Webots controller and the other example worlds remain available. Scripting examples, drivers and applets are under /usr/share/ardupilot/libraries/AP_Scripting/. Copy scripts you want to try into the session's scripts/ directory and follow the upstream scripting setup. Replay processes suitable ArduPilot logs; use ardupilot-replay --help. Verification and contribution ------------------------------ Build-time checks run the Vector2 and Vector3 unit suites and start each vehicle in a fresh session directory. The installed-package autopkgtest checks MAVLink heartbeats for every vehicle and exercises Copter's MAVLink RC input while disarmed. Controller calibration and physical USB-device behavior still require testing with the intended controller. External 3D simulators require separate testing. Packaging changes and verification are AI-assisted and require human review. Upstream source changes are recorded in debian/patches using quilt. Documentation: https://ardupilot.org/dev/docs/using-sitl-for-ardupilot-testing.html https://ardupilot.org/mavproxy/docs/modules/joystick.html https://ardupilot.org/dev/docs/sitl-with-gazebo.html