Complete isolated simulation environment for AirSim with ArduPilot SITL and QGroundControl using pixi for dependency management.
This repository provides a fully isolated simulation environment for AirSim with ArduPilot SITL without polluting your system with manual apt installs. All dependencies are managed through pixi (conda-based), ensuring reproducibility and clean builds.
- AirSim - Unreal Engine-based simulator (AirSimNH environment)
- ArduPilot SITL - Software-in-the-loop flight controller (ArduCopter)
- QGroundControl - Ground control station for mission planning
All components downloaded and configured in .airsim_ardupilot/ directory.
- Ubuntu 22.04 (tested)
- pixi installed (Installation Guide)
- Git
Initialize the Pixi environment with all required build tools and Python packages:
pixi installThis will create an isolated simulation environment with:
- Build toolchain (gcc, g++, make, pkg-config, ccache)
- Development tools (git, wget, unzip, zip, rsync)
- Python packages (empy, pexpect, dronecan, pymavlink, MAVProxy, etc.)
Enter the pixi environment:
pixi shellAll subsequent commands should be run within this shell.
pixi run download-airsimThis will:
- Download AirSimNH environment (v1.8.1) from Microsoft AirSim releases
- Extract to
.airsim_ardupilot/airsim/AirSimNH/ - Copy configuration from
config/airsim/settings.json - Create symlink at
~/Documents/AirSim/settings.json
pixi run download-qgroundThis will:
- Download latest QGroundControl AppImage
- Save to
.airsim_ardupilot/qgroundcontrol/ - Make executable automatically
Compile ArduCopter for SITL:
pixi run build-ardupilotThis will:
- Clone ArduPilot repository (if not present)
- Update all submodules
- Configure and build ArduCopter binary for SITL
- Output binary at
.airsim_ardupilot/ardupilot/build/sitl/bin/arducopter
Build options:
--clean- Remove previous build artifacts--force-clone- Delete and re-clone ArduPilot repository
Check that all components are ready:
pixi run checkThis validates:
- β AirSim environment and launcher
- β QGroundControl AppImage
- β ArduPilot SITL binary
- β Pixi environment status
Configuration file: config/airsim/settings.json
Key settings:
- Vehicle Type: ArduCopter
- Origin: Lat -7.2823507, Lon 112.7923504, Alt 20m
- Ports: UDP 9003, Control 9002
- Camera: 1280x720, 90Β° FOV, pitch -90Β°
- Sensors: Barometer, IMU, GPS, Magnetometer enabled
- ViewMode: FlyWithMe (default)
Configuration file: config/ardupilot/airsim.parm
Optimized parameters for AirSim SITL:
SCHED_LOOP_RATE=180- Reduced scheduler rate for stabilityWPNAV_SPEED=140- Limited waypoint speed (5 km/h)ANGLE_MAX=1500- Restricted attitude authorityWPNAV_ACCEL=50- Smooth waypoint accelerationSIM_SPEEDUP=20- Simulation speedup factor- GPS and failsafe thresholds relaxed for testing
Start all components together:
pixi run simulationOptions:
--no-display- Run AirSim in headless mode (NoDisplay)--help- Show usage information
This will:
- Update ViewMode in settings.json based on display flag
- Start QGroundControl (background)
- Start AirSim environment (background)
- Start ArduPilot SITL with parameter file (foreground)
Press Ctrl+C to stop all components gracefully.
If you prefer to start components individually:
# Terminal 1: QGroundControl
.airsim_ardupilot/qgroundcontrol/QGroundControl-x86_64.AppImage
# Terminal 2: AirSim
.airsim_ardupilot/airsim/AirSimNH/LinuxNoEditor/AirSimNH.sh
# Terminal 3: ArduPilot SITL (in pixi shell)
cd .airsim_ardupilot/ardupilot
python3 Tools/autotest/sim_vehicle.py -v ArduCopter --model airsim-copter \
--console --map --out=127.0.0.1:14550 --out=127.0.0.1:14551 \
--add-param-file=../../config/ardupilot/airsim.parmAIRSIM_HOME- Base directory for all components (default:./.airsim_ardupilot)AIRSIM_ENV_RELEASE- AirSim release tag (default:v1.8.1)ARDUPILOT_REPO_URL- ArduPilot repository URLQGC_URL- QGroundControl download URL
airsim-qgroundcontrol-ardupilot-sitl-pixi/
βββ pixi.toml # Pixi environment configuration
βββ pixi.lock # Locked dependencies
βββ README.md # This file
βββ config/ # Configuration files
β βββ airsim/
β β βββ settings.json # AirSim settings template
β βββ ardupilot/
β βββ airsim.parm # ArduPilot parameters
βββ scripts/ # Build and utility scripts
β βββ download-airsim.sh # Download AirSim environment
β βββ download-qground.sh # Download QGroundControl
β βββ build-ardupilot-sitl.sh # Build ArduPilot SITL
β βββ check-simulation.sh # Verify installation
β βββ run-simulation.sh # Run all components
βββ .airsim_ardupilot/ # Workspace (created by scripts)
βββ airsim/
β βββ AirSimNH/ # Unreal Engine environment
β βββ settings.json # Active AirSim configuration
βββ qgroundcontrol/
β βββ QGroundControl-x86_64.AppImage
βββ ardupilot/
βββ build/sitl/bin/arducopter
βββ Tools/autotest/sim_vehicle.py
The simulation environment defined in pixi.toml provides:
- Python 3.11-3.12
- Build toolchain (gcc, g++, make, pkg-config, ccache)
- Development tools (git, wget, unzip, zip, rsync)
- empy 3.3.4 (template engine for ArduPilot waf)
- pexpect (process automation)
- dronecan (DroneCAN/UAVCAN support)
- future (Python 2/3 compatibility)
- pymavlink (MAVLink protocol library)
- MAVProxy (MAVLink proxy and command shell)
- pyserial (serial communication)
- packaging, monotonic (utility libraries)
If ArduPilot build fails:
pixi run build-ardupilot --cleanEnsure you're in the Pixi environment:
pixi shellRe-run the download script to reset settings:
rm -rf .airsim_ardupilot/airsim/settings.json
pixi run download-airsim- Isolation: All components installed in
.airsim_ardupilot/directory - No System Pollution: No manual
apt installrequired - Reproducible: pixi.lock ensures identical dependency versions
- Auto Configuration: ArduPilot parameters automatically loaded on startup
- MAVLink: QGroundControl connects on port 14550, telemetry on 14551
Follow respective licenses of:
- ArduPilot: GPLv3
- AirSim: MIT License
- QGroundControl: Apache 2.0 / GPLv3
- This build system: Use freely
Built with β€οΈ using Pixi for clean, reproducible simulation environments
