117 lines
3.0 KiB
Markdown
117 lines
3.0 KiB
Markdown
# Drone Landing Simulation (GPS-Denied)
|
|
|
|
A GPS-denied drone landing simulation using relative sensors (IMU, altimeter, camera, landing pad detection) with **PyBullet** and **Gazebo** simulators.
|
|
|
|
## Quick Start
|
|
|
|
### Standalone Mode (Any Platform)
|
|
|
|
```bash
|
|
source activate.sh # Linux/macOS
|
|
. .\activate.ps1 # Windows
|
|
|
|
python standalone_simulation.py --pattern circular --speed 0.3
|
|
```
|
|
|
|
### Two-Terminal Mode - PyBullet (with ROS 2)
|
|
|
|
**Terminal 1 - Simulator:**
|
|
```bash
|
|
python simulation_host.py
|
|
```
|
|
|
|
**Terminal 2 - Bridge + Controllers:**
|
|
```bash
|
|
python run_bridge.py --pattern circular --speed 0.3
|
|
```
|
|
|
|
### Two-Terminal Mode - Gazebo (Linux only)
|
|
|
|
**Terminal 1 - Gazebo:**
|
|
```bash
|
|
gz sim gazebo/worlds/drone_landing.sdf
|
|
```
|
|
|
|
**Terminal 2 - Bridge + Controllers:**
|
|
```bash
|
|
python run_gazebo.py --pattern circular --speed 0.3
|
|
```
|
|
|
|
That's it! Only 2 terminals needed.
|
|
|
|
## Installation
|
|
|
|
| Platform | Command |
|
|
|----------|---------|
|
|
| Ubuntu/Debian | `./setup/install_ubuntu.sh` |
|
|
| Arch Linux | `./setup/install_arch.sh` |
|
|
| macOS | `./setup/install_macos.sh` |
|
|
| Windows | `.\setup\install_windows.ps1` |
|
|
|
|
## Platform Compatibility
|
|
|
|
| Feature | Ubuntu | Arch | macOS | Windows | WSL2 |
|
|
|---------|--------|------|-------|---------|------|
|
|
| Standalone | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
| ROS 2 Mode | ✅ | ⚠️ | ❌ | ❌ | ✅ |
|
|
| Gazebo | ✅ | ⚠️ | ❌ | ❌ | ✅ |
|
|
|
|
## Files
|
|
|
|
| File | Description |
|
|
|------|-------------|
|
|
| `standalone_simulation.py` | All-in-one (no ROS 2 required) |
|
|
| `simulation_host.py` | PyBullet simulator server |
|
|
| `run_bridge.py` | **PyBullet bridge + Controllers** |
|
|
| `run_gazebo.py` | **Gazebo bridge + Controllers** |
|
|
| `drone_controller.py` | Drone landing logic (edit this) |
|
|
| `rover_controller.py` | Moving landing pad |
|
|
|
|
## Options
|
|
|
|
```bash
|
|
# Standalone
|
|
python standalone_simulation.py --pattern circular --speed 0.3
|
|
|
|
# ROS 2 mode
|
|
python run_bridge.py --pattern circular --speed 0.3 --host <SIMULATOR_IP>
|
|
|
|
Options:
|
|
--pattern, -p stationary, linear, circular, square, random
|
|
--speed, -s Speed in m/s (default: 0.5)
|
|
--amplitude, -a Amplitude in meters (default: 2.0)
|
|
--host, -H Simulator IP (default: 0.0.0.0)
|
|
```
|
|
|
|
## GPS-Denied Sensors
|
|
|
|
| Sensor | Data |
|
|
|--------|------|
|
|
| **IMU** | Orientation, angular velocity |
|
|
| **Altimeter** | Altitude, vertical velocity |
|
|
| **Velocity** | Estimated horizontal velocity |
|
|
| **Camera** | 320x240 downward-facing image |
|
|
| **Landing Pad** | Relative position when visible |
|
|
|
|
## Documentation
|
|
|
|
| Document | Description |
|
|
|----------|-------------|
|
|
| [Installation](docs/installation.md) | Platform setup guides + WSL2 |
|
|
| [Architecture](docs/architecture.md) | System components |
|
|
| [Protocol](docs/protocol.md) | Sensor data formats |
|
|
| [Drone Guide](docs/drone_guide.md) | Landing algorithm guide |
|
|
|
|
## Network Setup (Remote Simulator)
|
|
|
|
Run simulator on one machine, controllers on another:
|
|
|
|
**Machine 1 (with display):**
|
|
```bash
|
|
python simulation_host.py # Listens on 0.0.0.0:5555
|
|
```
|
|
|
|
**Machine 2 (headless):**
|
|
```bash
|
|
python run_bridge.py --host 192.168.1.100 # Connect to Machine 1
|
|
``` |