Prepare your Ubuntu system for drone development:
- Update system to latest packages
- Install essential development tools
- Create organized workspace structure
- Verify everything is ready for ArduPilot SITL
Time: 15-20 minutes
Before starting, you must have completed:
- ✅ 1.1 Prerequisites and Setup
- ✅ Ubuntu 22.04 LTS installed and booted
- ✅ Internet connection working
- ✅ System meets minimum requirements
Before installing anything, ensure your system has:
- Latest security patches
- Updated package repositories
- Bug fixes and improvements
This prevents compatibility issues later.
Open terminal (Ctrl+Alt+T) and run:
sudo apt updateWhat this does: Updates the list of available packages and versions.
Expected output:
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
...
Reading package lists... Done
✅ Success: No errors, shows "Reading package lists... Done"
Now upgrade installed packages:
sudo apt upgrade -yWhat this does: Downloads and installs updates.
This takes: 5-15 minutes depending on pending updates.
Expected output:
Reading package lists... Done
Building dependency tree... Done
...
The following packages will be upgraded:
[list of packages]
...
Setting up [package names]...
✅ Success: Completes without errors
Remove unnecessary packages:
sudo apt autoremove -y
sudo apt autocleanWhat this does: Frees disk space by removing unused packages.
sudo rebootWhy reboot? Kernel updates require restart to take effect.
After reboot: Open terminal again and continue.
ArduPilot and ROS2 need these tools:
sudo apt install -y \
build-essential \
git \
python3 \
python3-pip \
python3-dev \
curl \
wget \
nano \
net-tools \
treeWhat these are:
build-essential— C/C++ compiler (for building ArduPilot)git— Version control (to clone ArduPilot)python3— Python runtime (ArduPilot SITL uses Python)python3-pip— Python package installerpython3-dev— Python development headerscurl,wget— Download files from internetnano— Simple text editornet-tools— Network diagnosticstree— Directory structure visualization
This takes: 2-5 minutes
Expected output:
Reading package lists... Done
Building dependency tree... Done
...
Setting up build-essential...
Setting up git...
...
✅ Success: All packages installed without errors
gcc --version
git --version
python3 --version
pip3 --version
tree --versionExpected output:
gcc (Ubuntu 11.x.x) ...
git version 2.34.x
Python 3.10.x
pip 22.x.x from ...
tree v1.8.x
✅ Success: All tools show version numbers
Having a clear structure prevents:
- Files scattered everywhere
- Forgetting where you saved things
- Conflicts between different projects
All SimToFly work will be in one place: ~/simtofly_ws/
mkdir -p ~/simtofly_ws
cd ~/simtofly_wsWhat this creates: Main folder for all SimToFly work.
mkdir -p logs missions scripts ros2_wsWhat each folder is for:
logs/— Flight logs and telemetry datamissions/— Mission files and waypointsscripts/— Helper scripts and toolsros2_ws/— ROS2 workspace (Phase 2)
Note: We'll create the ardupilot/ folder in Section 1.3 when we clone ArduPilot repository.
tree -L 1 ~/simtofly_wsExpected output:
/home/your-username/simtofly_ws
├── logs
├── missions
├── ros2_ws
└── scripts
4 directories, 0 files
✅ Success: Four directories created
Make it easy to access workspace from anywhere:
echo 'export SIMTOFLY_WS=~/simtofly_ws' >> ~/.bashrc
source ~/.bashrcWhat this does: Creates a shortcut variable to your workspace.
echo $SIMTOFLY_WS
cd $SIMTOFLY_WS
pwdExpected output:
/home/your-username/simtofly_ws
✅ Success: Can access workspace via $SIMTOFLY_WS
Let's create a script to check everything is ready:
nano ~/simtofly_ws/scripts/check_environment.shPaste this script:
#!/bin/bash
echo "=========================================="
echo "SimToFly Environment Check"
echo "=========================================="
echo ""
# Check Ubuntu version
echo "Checking Ubuntu version..."
if lsb_release -d | grep -q "22.04"; then
echo "✅ Ubuntu 22.04 detected"
else
echo "❌ Wrong Ubuntu version. Need 22.04"
lsb_release -d
fi
echo ""
# Check disk space
echo "Checking disk space..."
AVAILABLE=$(df -BG / | tail -1 | awk '{print $4}' | sed 's/G//')
if [ "$AVAILABLE" -gt 30 ]; then
echo "✅ Sufficient disk space: ${AVAILABLE}GB available"
else
echo "⚠️ Low disk space: ${AVAILABLE}GB available (need 30GB+)"
fi
echo ""
# Check RAM
echo "Checking RAM..."
TOTAL_RAM=$(free -g | awk '/^Mem:/{print $2}')
if [ "$TOTAL_RAM" -ge 7 ]; then
echo "✅ Sufficient RAM: ${TOTAL_RAM}GB"
else
echo "⚠️ Low RAM: ${TOTAL_RAM}GB (recommended 8GB+)"
fi
echo ""
# Check essential tools
echo "Checking essential tools..."
TOOLS=("gcc" "g++" "make" "git" "python3" "pip3" "tree")
for tool in "${TOOLS[@]}"; do
if command -v $tool &> /dev/null; then
echo "✅ $tool installed"
else
echo "❌ $tool NOT installed"
fi
done
echo ""
# Check workspace structure
echo "Checking workspace structure..."
DIRS=("logs" "missions" "scripts" "ros2_ws")
for dir in "${DIRS[@]}"; do
if [ -d "$HOME/simtofly_ws/$dir" ]; then
echo "✅ $dir directory exists"
else
echo "❌ $dir directory missing"
fi
done
echo ""
# Check internet
echo "Checking internet connection..."
if ping -c 1 google.com &> /dev/null; then
echo "✅ Internet connection working"
else
echo "❌ No internet connection"
fi
echo ""
echo "=========================================="
echo "Environment check complete!"
echo "=========================================="Save and exit: Ctrl+X, then Y, then Enter
chmod +x ~/simtofly_ws/scripts/check_environment.sh~/simtofly_ws/scripts/check_environment.shExpected output:
==========================================
SimToFly Environment Check
==========================================
Checking Ubuntu version...
✅ Ubuntu 22.04 detected
Checking disk space...
✅ Sufficient disk space: 45GB available
Checking RAM...
✅ Sufficient RAM: 8GB
Checking essential tools...
✅ gcc installed
✅ g++ installed
✅ make installed
✅ git installed
✅ python3 installed
✅ pip3 installed
✅ tree installed
Checking workspace structure...
✅ logs directory exists
✅ missions directory exists
✅ scripts directory exists
✅ ros2_ws directory exists
Checking internet connection...
✅ Internet connection working
==========================================
Environment check complete!
==========================================
✅ All checks pass: Your environment is ready!
Before moving to next section, verify:
- System fully updated (
apt update && upgrade) - Rebooted after updates
- Essential tools installed (gcc, git, python3, tree)
- Workspace structure created (
~/simtofly_ws/) - Verification script runs successfully
- All checks in verification script pass
All checked? You're ready for ArduPilot SITL!
- ✅ Updated Ubuntu to latest packages
- ✅ Installed development tools (gcc, git, python3)
- ✅ Created organized workspace structure
- ✅ Set up workspace environment variable
- ✅ Created verification script for future checks
- ✅ Verified environment is ready
Your system is now ready for ArduPilot SITL installation!
Continue to 1.3 ArduPilot SITL Installation where we'll:
- Clone ArduPilot source code
- Install ArduPilot dependencies
- Build SITL simulator
- Launch your first virtual drone
- Test basic commands
A: No, just once now to confirm setup. Run it again only if something breaks later.
A: Yes, but stick with ~/simtofly_ws/ for consistency with this tutorial. If you change it, you'll need to adapt all commands.
A: Yes, first update after fresh Ubuntu install can take 15-30 minutes depending on internet speed and pending updates.
A: Read the error message carefully. Common fixes:
- Run
sudo apt --fix-broken install - Try
sudo dpkg --configure -a - Reboot and try again
- Search the specific error online
A: We'll clone ArduPilot directly in Section 1.3, which automatically creates the ardupilot/ directory. Creating it now would cause confusion with nested paths.
Cause: Package repositories not updated
Solution:
sudo apt update
sudo apt install -y [package-name]Cause: Trying to create in protected location
Solution: Make sure you're creating in your home directory (~/), not system directories like /opt/ or /usr/.
Cause: Script doesn't have execute permission
Solution:
chmod +x ~/simtofly_ws/scripts/check_environment.shCause: Didn't reload bashrc
Solution:
source ~/.bashrcOr close and reopen terminal.
Cause: Broken dependencies or repository issues
Solution:
sudo apt --fix-broken install
sudo apt update
sudo apt install -y [package-names]


