Ardupilot Update
This commit is contained in:
@@ -7,6 +7,7 @@ Setup instructions for all supported platforms.
|
||||
| Platform | Command |
|
||||
|----------|---------|
|
||||
| Ubuntu/Debian | `./setup/install_ubuntu.sh` |
|
||||
| Ubuntu + ArduPilot | `./setup/install_ubuntu.sh --with-ardupilot` |
|
||||
| Arch Linux | `./setup/install_arch.sh` |
|
||||
| macOS | `./setup/install_macos.sh` |
|
||||
| Windows | `.\setup\install_windows.ps1` |
|
||||
@@ -28,6 +29,7 @@ python standalone_simulation.py
|
||||
| **Standalone Simulation** | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||
| **ROS 2** | ✅ | ⚠️ AUR | ❌ | ❌ | ✅ |
|
||||
| **Gazebo** | ✅ | ⚠️ AUR | ❌ | ❌ | ✅ |
|
||||
| **ArduPilot SITL** | ✅ | ⚠️ Manual | ❌ | ❌ | ✅ |
|
||||
| **Full Mode** | ✅ | ⚠️ | ❌ | ❌ | ✅ |
|
||||
| **GUI Support** | ✅ | ✅ | ✅ | ✅ | ✅ WSLg |
|
||||
|
||||
@@ -58,7 +60,18 @@ python standalone_simulation.py
|
||||
**Installs:**
|
||||
- ROS 2 (Humble or Jazzy based on Ubuntu version)
|
||||
- Gazebo (ros-gz)
|
||||
- Python packages: pybullet, numpy, pillow, pyinstaller
|
||||
- Python packages: pybullet, numpy, pillow, pyinstaller, pymavlink
|
||||
|
||||
**With ArduPilot SITL (full flight controller):**
|
||||
```bash
|
||||
# Run installer with ArduPilot
|
||||
./setup/install_ubuntu.sh --with-ardupilot
|
||||
|
||||
# This will also install:
|
||||
# - ArduPilot SITL (~15-20 min build)
|
||||
# - ArduPilot Gazebo plugin
|
||||
# - MAVProxy
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -407,6 +420,84 @@ After installation, verify packages:
|
||||
python -c "import pybullet; print('PyBullet OK')"
|
||||
python -c "import numpy; print('NumPy OK')"
|
||||
python -c "from PIL import Image; print('Pillow OK')"
|
||||
python -c "from pymavlink import mavutil; print('pymavlink OK')"
|
||||
```
|
||||
|
||||
All should print "OK".
|
||||
|
||||
---
|
||||
|
||||
## ArduPilot SITL Manual Setup
|
||||
|
||||
If you want to install ArduPilot SITL manually (without the install script):
|
||||
|
||||
### 1. Install ArduPilot
|
||||
|
||||
```bash
|
||||
# Clone ArduPilot
|
||||
git clone --recurse-submodules https://github.com/ArduPilot/ardupilot.git ~/ardupilot
|
||||
cd ~/ardupilot
|
||||
|
||||
# Install prerequisites (Ubuntu)
|
||||
Tools/environment_install/install-prereqs-ubuntu.sh -y
|
||||
|
||||
# Reload profile
|
||||
. ~/.profile
|
||||
|
||||
# Build ArduCopter SITL
|
||||
./waf configure --board sitl
|
||||
./waf copter
|
||||
```
|
||||
|
||||
### 2. Install ArduPilot Gazebo Plugin
|
||||
|
||||
```bash
|
||||
# Clone plugin
|
||||
git clone https://github.com/ArduPilot/ardupilot_gazebo.git ~/ardupilot_gazebo
|
||||
cd ~/ardupilot_gazebo
|
||||
|
||||
# Build
|
||||
mkdir build && cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
make -j$(nproc)
|
||||
```
|
||||
|
||||
### 3. Set Environment Variables
|
||||
|
||||
Add to `~/.bashrc`:
|
||||
|
||||
```bash
|
||||
# ArduPilot
|
||||
export ARDUPILOT_HOME=$HOME/ardupilot
|
||||
export PATH=$PATH:$ARDUPILOT_HOME/Tools/autotest
|
||||
|
||||
# ArduPilot Gazebo Plugin
|
||||
export GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH
|
||||
export GZ_SIM_RESOURCE_PATH=$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH
|
||||
```
|
||||
|
||||
### 4. Test SITL
|
||||
|
||||
```bash
|
||||
# Test ArduCopter SITL
|
||||
cd ~/ardupilot
|
||||
sim_vehicle.py -v ArduCopter --console --map
|
||||
```
|
||||
|
||||
### 5. Run with Gazebo
|
||||
|
||||
```bash
|
||||
# Terminal 1: Launch Gazebo
|
||||
ros2 launch gazebo/launch/ardupilot_drone.launch.py
|
||||
|
||||
# Terminal 2: Start SITL
|
||||
cd ~/ardupilot
|
||||
sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console
|
||||
|
||||
# Terminal 3: Run controllers
|
||||
cd ~/simulation
|
||||
source activate.sh
|
||||
python run_ardupilot.py --no-sitl --pattern circular
|
||||
```
|
||||
|
||||
For more details, see [ArduPilot Guide](ardupilot.md).
|
||||
|
||||
Reference in New Issue
Block a user