enhance installation guides, add environment setup, and expand troubleshooting for all platforms.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Installation
|
||||
|
||||
## Quick Install
|
||||
## Quick Install (Ubuntu/WSL)
|
||||
|
||||
```bash
|
||||
./setup/install_ubuntu.sh
|
||||
@@ -13,11 +13,101 @@ source ~/.bashrc
|
||||
| Component | Location |
|
||||
|-----------|----------|
|
||||
| ArduPilot SITL | `~/ardupilot` |
|
||||
| ArduPilot venv | `~/venv-ardupilot` |
|
||||
| ardupilot_gazebo | `~/ardupilot_gazebo` |
|
||||
| Gazebo Harmonic | System |
|
||||
| ROS 2 | System |
|
||||
| MAVProxy | `~/.local/bin` |
|
||||
|
||||
## Platform-Specific Installation
|
||||
|
||||
### Ubuntu (Native)
|
||||
|
||||
```bash
|
||||
./setup/install_ubuntu.sh --with-ardupilot
|
||||
```
|
||||
|
||||
### Windows (via WSL2)
|
||||
|
||||
WSL2 (Windows Subsystem for Linux) is the recommended way to run this simulation on Windows.
|
||||
|
||||
#### Step 1: Install WSL2
|
||||
|
||||
Open PowerShell as Administrator:
|
||||
```powershell
|
||||
wsl --install -d Ubuntu-24.04
|
||||
```
|
||||
|
||||
Restart your computer when prompted.
|
||||
|
||||
#### Step 2: Configure WSL2 for GUI Apps
|
||||
|
||||
WSL2 on Windows 11 has built-in GUI support (WSLg). For Windows 10, you may need an X server:
|
||||
|
||||
```powershell
|
||||
# Windows 11 - WSLg is automatic, no extra setup needed
|
||||
|
||||
# Windows 10 - Install VcXsrv or X410 from Microsoft Store
|
||||
```
|
||||
|
||||
#### Step 3: Install in WSL
|
||||
|
||||
Open Ubuntu from Start menu:
|
||||
```bash
|
||||
# Clone the project (or copy from Windows)
|
||||
git clone https://github.com/your-repo/RDC_Simulation.git
|
||||
cd RDC_Simulation
|
||||
|
||||
# Run installation
|
||||
./setup/install_ubuntu.sh
|
||||
./setup/install_ardupilot.sh
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
#### Step 4: GPU Acceleration in WSL
|
||||
|
||||
For best performance with Gazebo:
|
||||
|
||||
```bash
|
||||
# Check GPU availability
|
||||
glxinfo | grep "OpenGL renderer"
|
||||
|
||||
# Should show your GPU, not "llvmpipe"
|
||||
# If using NVIDIA, install NVIDIA GPU driver for WSL:
|
||||
# https://developer.nvidia.com/cuda/wsl
|
||||
```
|
||||
|
||||
#### WSL Tips
|
||||
|
||||
- **Access Windows files:** `/mnt/c/Users/YourName/`
|
||||
- **Open file explorer:** `explorer.exe .`
|
||||
- **Copy to clipboard:** `cat file | clip.exe`
|
||||
- **Memory limit:** Create `%UserProfile%\.wslconfig`:
|
||||
```ini
|
||||
[wsl2]
|
||||
memory=8GB
|
||||
processors=4
|
||||
```
|
||||
|
||||
### macOS
|
||||
|
||||
Gazebo is not officially supported on macOS. Use standalone mode:
|
||||
|
||||
```bash
|
||||
./setup/install_macos.sh
|
||||
python standalone_simulation.py
|
||||
```
|
||||
|
||||
For full simulation, use a Linux VM (UTM for Apple Silicon) or Docker.
|
||||
|
||||
### Arch Linux
|
||||
|
||||
```bash
|
||||
./setup/install_arch.sh
|
||||
```
|
||||
|
||||
ROS 2 and Gazebo are available via AUR - see script output for details.
|
||||
|
||||
## Dependencies
|
||||
|
||||
```bash
|
||||
@@ -34,29 +124,107 @@ pip install -r requirements.txt
|
||||
## Verify Installation
|
||||
|
||||
```bash
|
||||
# Source the environment
|
||||
source activate.sh
|
||||
|
||||
# Check ArduPilot tools
|
||||
sim_vehicle.py --help
|
||||
which mavproxy.py
|
||||
|
||||
# Check Gazebo
|
||||
gz sim --help
|
||||
```
|
||||
|
||||
## Environment Setup
|
||||
|
||||
After installation, always source the environment before running:
|
||||
|
||||
```bash
|
||||
source activate.sh
|
||||
# or
|
||||
source ~/.bashrc # if ArduPilot was installed
|
||||
```
|
||||
|
||||
The activation script sets up:
|
||||
- ROS 2 environment
|
||||
- ArduPilot Python venv (with empy, pymavlink, etc.)
|
||||
- Gazebo resource paths
|
||||
- ArduPilot tools path
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### sim_vehicle.py not found
|
||||
### "empy not found" or waf configure fails
|
||||
|
||||
The ArduPilot venv isn't activated. Run:
|
||||
```bash
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
pip install empy==3.3.4
|
||||
```
|
||||
|
||||
### sim_vehicle.py not found
|
||||
|
||||
```bash
|
||||
source ~/.ardupilot_env
|
||||
# or
|
||||
export PATH=$PATH:~/ardupilot/Tools/autotest
|
||||
```
|
||||
|
||||
### mavproxy.py not found
|
||||
|
||||
```bash
|
||||
export PATH=$PATH:~/.local/bin
|
||||
```
|
||||
|
||||
### pexpect error
|
||||
|
||||
```bash
|
||||
pip install pexpect
|
||||
```
|
||||
|
||||
### Gazebo slow
|
||||
### Gazebo slow / Software rendering
|
||||
|
||||
```bash
|
||||
glxinfo | grep "OpenGL renderer"
|
||||
```
|
||||
Should show GPU, not "llvmpipe".
|
||||
|
||||
Should show your GPU, not "llvmpipe". Install proper GPU drivers:
|
||||
|
||||
- **NVIDIA:** `sudo apt install nvidia-driver-XXX`
|
||||
- **AMD:** `sudo apt install mesa-vulkan-drivers`
|
||||
- **Intel:** Usually works out of box
|
||||
- **WSL:** Install NVIDIA WSL driver from nvidia.com
|
||||
|
||||
### Wrong Python environment
|
||||
|
||||
If you see errors about missing packages that should be installed:
|
||||
|
||||
```bash
|
||||
# Check which Python is being used
|
||||
which python3
|
||||
|
||||
# Should be: ~/venv-ardupilot/bin/python3
|
||||
# If not, activate the correct venv:
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
```
|
||||
|
||||
### WSL: Display not working
|
||||
|
||||
```bash
|
||||
# Check DISPLAY variable
|
||||
echo $DISPLAY
|
||||
|
||||
# For WSLg (Windows 11), should be auto-set
|
||||
# For Windows 10 with X server:
|
||||
export DISPLAY=:0
|
||||
```
|
||||
|
||||
### WSL: Out of memory
|
||||
|
||||
Create `%UserProfile%\.wslconfig`:
|
||||
```ini
|
||||
[wsl2]
|
||||
memory=8GB
|
||||
swap=4GB
|
||||
```
|
||||
|
||||
Then restart WSL: `wsl --shutdown`
|
||||
|
||||
Reference in New Issue
Block a user