0
0
Drone Programmingprogramming~30 mins

ArduPilot SITL setup in Drone Programming - Mini Project: Build & Apply

Choose your learning style9 modes available
ArduPilot SITL Setup
📖 Scenario: You want to test your drone flight code safely on your computer before flying a real drone. ArduPilot SITL (Software In The Loop) lets you run a virtual drone simulator that behaves like a real drone.This project will guide you step-by-step to set up ArduPilot SITL on your computer and run a simple simulation.
🎯 Goal: Set up ArduPilot SITL environment, configure a basic drone model, start the SITL simulation, and see the drone's status output.
📋 What You'll Learn
Install Python 3.12+
Install necessary SITL dependencies
Download ArduPilot source code
Run SITL simulation and view output
💡 Why This Matters
🌍 Real World
Testing drone flight code safely on your computer before flying a real drone helps avoid crashes and saves time.
💼 Career
Drone developers and researchers use SITL to develop and test drone software efficiently without risking hardware.
Progress0 / 4 steps
1
Download ArduPilot source code
Use the command git clone https://github.com/ArduPilot/ardupilot.git to download the ArduPilot source code folder named ardupilot to your computer.
Drone Programming
Need a hint?

Open your terminal or command prompt and type the exact git clone command to download the code.

2
Install SITL dependencies
Inside the ardupilot folder, run the command Tools/environment_install/install-prereqs-ubuntu.sh -y to install all required dependencies for SITL on Ubuntu Linux.
Drone Programming
Need a hint?

Make sure you change directory into ardupilot before running the install script.

3
Build and start SITL simulation
Run the commands cd ardupilot/ArduCopter and then ../waf configure --board sitl followed by ../waf copter to build the SITL simulator. Then start SITL with ../waf --target bin/arducopter.
Drone Programming
Need a hint?

Follow the exact commands to build and run the SITL simulator for the copter model.

4
View SITL simulation output
Run ../Tools/autotest/sim_vehicle.py -v ArduCopter -f quad --console --map inside the ardupilot folder to start the SITL simulation with a console and map window. Then observe the output showing the drone's status.
Drone Programming
Need a hint?

This command launches the SITL simulation with a console and map to see the drone's status live.