0
0
Pcb-designHow-ToBeginner · 4 min read

How to Install ArduPilot SITL Simulator Quickly

To install the ArduPilot SITL simulator, first clone the ArduPilot repository from GitHub, then install required dependencies, and finally build SITL using make commands. This setup allows you to run drone simulations on your computer without hardware.
📐

Syntax

Here is the basic command pattern to install and run ArduPilot SITL:

  • git clone https://github.com/ArduPilot/ardupilot.git - downloads the ArduPilot source code.
  • cd ardupilot - moves into the project folder.
  • ./waf configure --board sitl - prepares the build system for SITL.
  • ./waf build - compiles the SITL simulator.
  • sim_vehicle.py -v ArduCopter -f quad --console --map - runs the SITL simulation with a quadcopter model.
bash
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
pip3 install --user -r requirements.txt
./waf configure --board sitl
./waf build
sim_vehicle.py -v ArduCopter -f quad --console --map
💻

Example

This example shows how to install and run the ArduPilot SITL simulator for a quadcopter on a Linux or macOS system.

bash
# Clone the ArduPilot repository
$ git clone https://github.com/ArduPilot/ardupilot.git

# Change directory to ardupilot
$ cd ardupilot

# Install Python dependencies
$ pip3 install --user -r requirements.txt

# Configure for SITL build
$ ./waf configure --board sitl

# Build SITL
$ ./waf build

# Run the SITL simulator with quadcopter model
$ sim_vehicle.py -v ArduCopter -f quad --console --map
Output
INFO: Running ArduCopter SITL Connecting to MAVLink on udp:127.0.0.1:14550 Waiting for heartbeat from vehicle... Heartbeat from system (1) received Type 'help' for a list of commands.
⚠️

Common Pitfalls

Some common mistakes when installing ArduPilot SITL include:

  • Not installing Python dependencies before running sim_vehicle.py.
  • Running commands without proper permissions or missing ./waf executable permissions.
  • Using outdated versions of Git or Python that cause build failures.
  • Not setting up environment variables or paths correctly, leading to command not found errors.

Always check your system meets the requirements and follow the official ArduPilot documentation for your OS.

bash
## Wrong: Running sim_vehicle.py without dependencies
$ sim_vehicle.py -v ArduCopter
# Error: ModuleNotFoundError: No module named 'future'

## Right: Install dependencies first
$ pip3 install --user -r requirements.txt
$ sim_vehicle.py -v ArduCopter
📊

Quick Reference

Summary tips for installing ArduPilot SITL:

  • Use Python 3 and pip3 for dependencies.
  • Clone the latest ArduPilot repo from GitHub.
  • Run ./waf configure --board sitl before building.
  • Use sim_vehicle.py to start simulations.
  • Check official docs for OS-specific setup.

Key Takeaways

Clone the ArduPilot GitHub repo to get the latest SITL source code.
Install Python dependencies before running the SITL simulator.
Use ./waf commands to configure and build SITL properly.
Run sim_vehicle.py with the desired vehicle type to start simulation.
Check for common errors like missing dependencies or permissions.