docs: Improve quick start, ArduPilot setup, and troubleshooting, and add GPS mode option.
This commit is contained in:
@@ -2,19 +2,23 @@
|
||||
|
||||
## System Requirements
|
||||
|
||||
- **OS**: Ubuntu 22.04 or 24.04 (Windows users: use WSL2)
|
||||
- **RAM**: 8GB minimum, 16GB recommended
|
||||
- **Disk**: 10GB free space
|
||||
- **GPU**: Any GPU with OpenGL 3.3+ support
|
||||
| Requirement | Minimum | Recommended |
|
||||
|-------------|---------|-------------|
|
||||
| **OS** | Ubuntu 22.04 | Ubuntu 24.04 |
|
||||
| **RAM** | 8 GB | 16 GB |
|
||||
| **Disk** | 10 GB | 20 GB |
|
||||
| **GPU** | OpenGL 3.3 | NVIDIA/AMD dedicated |
|
||||
|
||||
## Quick Install (Ubuntu)
|
||||
> **Windows users**: Use WSL2 with Ubuntu (see below)
|
||||
|
||||
## Quick Install (Ubuntu/WSL2)
|
||||
|
||||
```bash
|
||||
# Clone repository
|
||||
git clone <repo-url> RDC_Simulation
|
||||
cd RDC_Simulation
|
||||
git clone <repo-url> ~/RDC_Simulation
|
||||
cd ~/RDC_Simulation
|
||||
|
||||
# Run installer (includes ArduPilot)
|
||||
# Run full installer (includes ArduPilot)
|
||||
./setup/install_ubuntu.sh --with-ardupilot
|
||||
|
||||
# Reload shell
|
||||
@@ -22,11 +26,11 @@ source ~/.bashrc
|
||||
```
|
||||
|
||||
This installs:
|
||||
- Python 3 + virtual environment
|
||||
- Gazebo Harmonic
|
||||
- ArduPilot SITL
|
||||
- ArduPilot Gazebo plugin
|
||||
- MAVProxy
|
||||
- ✅ Python 3 + virtual environment
|
||||
- ✅ Gazebo Harmonic
|
||||
- ✅ ArduPilot SITL
|
||||
- ✅ ArduPilot Gazebo plugin
|
||||
- ✅ MAVProxy
|
||||
|
||||
## Windows (WSL2)
|
||||
|
||||
@@ -36,7 +40,8 @@ Open PowerShell as Administrator:
|
||||
```powershell
|
||||
wsl --install -d Ubuntu-24.04
|
||||
```
|
||||
Restart computer, then open Ubuntu from Start menu.
|
||||
|
||||
Restart your computer, then open "Ubuntu" from the Start menu.
|
||||
|
||||
### Step 2: Install in WSL
|
||||
|
||||
@@ -49,32 +54,20 @@ git clone <repo-url> ~/RDC_Simulation
|
||||
cd ~/RDC_Simulation
|
||||
./setup/install_ubuntu.sh --with-ardupilot
|
||||
|
||||
# Reload
|
||||
# Reload shell
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
### WSL2 Tips
|
||||
|
||||
- **GUI Apps**: Windows 11 has WSLg built-in. Gazebo should work automatically.
|
||||
- **GPU**: Install NVIDIA WSL driver from [nvidia.com/wsl](https://developer.nvidia.com/cuda/wsl)
|
||||
- **Access Windows files**: `/mnt/c/Users/YourName/`
|
||||
- **Performance**: Clone repo to Linux filesystem (not `/mnt/c/`)
|
||||
|
||||
## macOS
|
||||
|
||||
macOS doesn't support Gazebo Harmonic natively. Options:
|
||||
|
||||
1. **Docker** (recommended): Use Linux container
|
||||
2. **VM**: Use UTM or Parallels with Ubuntu
|
||||
3. **Standalone**: Run PyBullet-only simulation
|
||||
|
||||
```bash
|
||||
# Install basic dependencies
|
||||
./setup/install_macos.sh
|
||||
|
||||
# Use standalone simulation
|
||||
python standalone_simulation.py
|
||||
```
|
||||
- **GUI**: Windows 11 has WSLg built-in. Gazebo should work automatically.
|
||||
- **GPU**: Install [NVIDIA WSL driver](https://developer.nvidia.com/cuda/wsl) for GPU acceleration
|
||||
- **Performance**: Keep files in Linux filesystem (`~/`), not Windows (`/mnt/c/`)
|
||||
- **Memory**: WSL may need more RAM. Create `~/.wslconfig` in Windows:
|
||||
```ini
|
||||
[wsl2]
|
||||
memory=8GB
|
||||
```
|
||||
|
||||
## Arch Linux
|
||||
|
||||
@@ -83,46 +76,51 @@ python standalone_simulation.py
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
## macOS
|
||||
|
||||
macOS doesn't support Gazebo Harmonic. Options:
|
||||
|
||||
1. **Docker**: Run Linux in container
|
||||
2. **VM**: Use UTM/Parallels with Ubuntu
|
||||
3. **Basic**: PyBullet-only simulation
|
||||
|
||||
```bash
|
||||
./setup/install_macos.sh
|
||||
```
|
||||
|
||||
## Verify Installation
|
||||
|
||||
```bash
|
||||
# Check ArduPilot
|
||||
# Check ArduPilot virtual environment
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
python -c "import em; print('empy OK')"
|
||||
sim_vehicle.py --help
|
||||
python -c "import em; print('empy: OK')"
|
||||
which sim_vehicle.py
|
||||
|
||||
# Check Gazebo
|
||||
gz sim --version
|
||||
|
||||
# Check ArduPilot plugin
|
||||
ls ~/ardupilot_gazebo/build/libArduPilotPlugin.so
|
||||
```
|
||||
|
||||
## Post-Installation
|
||||
|
||||
### Environment Setup
|
||||
|
||||
The installer creates `activate.sh` in the project root:
|
||||
## First Run
|
||||
|
||||
### Terminal 1 - Gazebo
|
||||
```bash
|
||||
cd ~/RDC_Simulation
|
||||
source activate.sh
|
||||
```
|
||||
|
||||
This sources:
|
||||
- ROS 2 (if installed)
|
||||
- ArduPilot virtual environment
|
||||
- Gazebo paths
|
||||
|
||||
### First Run
|
||||
|
||||
```bash
|
||||
# Terminal 1: Start Gazebo
|
||||
./scripts/run_ardupilot_sim.sh runway
|
||||
```
|
||||
Wait for the drone to appear!
|
||||
|
||||
# Terminal 2: Start SITL (after Gazebo loads)
|
||||
### Terminal 2 - SITL
|
||||
```bash
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console
|
||||
```
|
||||
Wait for "JSON received:" messages.
|
||||
|
||||
# Terminal 3: Run controller
|
||||
### Terminal 3 - Controller
|
||||
```bash
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
cd ~/RDC_Simulation
|
||||
python scripts/run_ardupilot.py --pattern square
|
||||
@@ -137,30 +135,29 @@ source ~/venv-ardupilot/bin/activate
|
||||
pip install empy==3.3.4
|
||||
```
|
||||
|
||||
### "No JSON sensor message"
|
||||
|
||||
SITL isn't receiving data from Gazebo.
|
||||
- Start Gazebo FIRST
|
||||
- Wait for it to fully load
|
||||
- Then start SITL
|
||||
|
||||
### "sim_vehicle.py not found"
|
||||
|
||||
```bash
|
||||
source ~/.ardupilot_env
|
||||
# OR
|
||||
# Or add to PATH manually:
|
||||
export PATH=$PATH:~/ardupilot/Tools/autotest
|
||||
```
|
||||
|
||||
### Gazebo crashes / slow
|
||||
### "No JSON sensor message"
|
||||
|
||||
SITL isn't receiving data from Gazebo.
|
||||
- Start Gazebo FIRST
|
||||
- Wait for world to fully load
|
||||
- Then start SITL
|
||||
|
||||
### Gazebo crashes or slow
|
||||
|
||||
```bash
|
||||
# Check GPU
|
||||
glxinfo | grep "OpenGL renderer"
|
||||
|
||||
# Try software rendering (slow but works)
|
||||
# Force software rendering (slow but works)
|
||||
export LIBGL_ALWAYS_SOFTWARE=1
|
||||
gz sim -v4 -r ~/ardupilot_gazebo/worlds/iris_runway.sdf
|
||||
```
|
||||
|
||||
### WSL: Display not working
|
||||
@@ -169,6 +166,14 @@ gz sim -v4 -r ~/ardupilot_gazebo/worlds/iris_runway.sdf
|
||||
# Check WSLg
|
||||
ls /mnt/wslg
|
||||
|
||||
# If missing, update WSL
|
||||
# Update WSL if missing
|
||||
wsl --update
|
||||
```
|
||||
|
||||
### ArduPlane instead of ArduCopter
|
||||
|
||||
If mode list shows FBWA, FBWB (plane modes):
|
||||
```bash
|
||||
pkill -9 -f sim_vehicle
|
||||
sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console --wipe-eeprom
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user