114 lines
4.5 KiB
Markdown
114 lines
4.5 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
|
|
|
|
### Windows (Standalone - No ROS 2 Required)
|
|
|
|
```powershell
|
|
. .\activate.ps1
|
|
python standalone_simulation.py
|
|
|
|
# With moving rover
|
|
python standalone_simulation.py --pattern circular --speed 0.3
|
|
```
|
|
|
|
### Linux (Full ROS 2 Setup)
|
|
|
|
```bash
|
|
source activate.sh
|
|
|
|
# Terminal 1: Simulator
|
|
python simulation_host.py
|
|
|
|
# Terminal 2: ROS bridge
|
|
python ros_bridge.py
|
|
|
|
# Terminal 3: Controllers
|
|
python controllers.py --pattern circular --speed 0.3
|
|
```
|
|
|
|
## Architecture
|
|
|
|
```
|
|
┌─────────────────────────────────────────────────────────────────────────┐
|
|
│ STANDALONE MODE (Windows) FULL MODE (Linux + ROS 2) │
|
|
│ ───────────────────────── ────────────────────────── │
|
|
│ │
|
|
│ ┌──────────────────────┐ ┌───────────────┐ ┌───────────────┐ │
|
|
│ │standalone_simulation │ │simulation_host│◄──►│ ros_bridge │ │
|
|
│ │ (All-in-one) │ └───────────────┘ └───────┬───────┘ │
|
|
│ └──────────────────────┘ │ │
|
|
│ ┌─────────▼─────────┐ │
|
|
│ │ controllers.py │ │
|
|
│ │ (Drone + Rover) │ │
|
|
│ └───────────────────┘ │
|
|
└─────────────────────────────────────────────────────────────────────────┘
|
|
```
|
|
|
|
## Files
|
|
|
|
| File | Description |
|
|
|------|-------------|
|
|
| `standalone_simulation.py` | **Windows: All-in-one simulation (no ROS 2)** |
|
|
| `simulation_host.py` | PyBullet physics simulator |
|
|
| `ros_bridge.py` | UDP ↔ ROS 2 bridge |
|
|
| `gazebo_bridge.py` | Gazebo ↔ ROS 2 bridge |
|
|
| `controllers.py` | Runs drone + rover controllers |
|
|
| `drone_controller.py` | Drone landing logic (edit this) |
|
|
| `rover_controller.py` | Moving landing pad |
|
|
|
|
## Controller Options
|
|
|
|
```bash
|
|
# Standalone (Windows)
|
|
python standalone_simulation.py --pattern circular --speed 0.3
|
|
|
|
# Full mode (Linux)
|
|
python controllers.py --pattern circular --speed 0.3
|
|
|
|
Options:
|
|
--pattern, -p Rover pattern: stationary, linear, circular, square
|
|
--speed, -s Rover speed in m/s (default: 0.5)
|
|
--amplitude, -a Rover amplitude in meters (default: 2.0)
|
|
```
|
|
|
|
## GPS-Denied Sensors
|
|
|
|
The drone has no GPS. Available 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) | Setup for Ubuntu, macOS, Windows |
|
|
| [Architecture](docs/architecture.md) | System components and data flow |
|
|
| [Protocol](docs/protocol.md) | Sensor data formats |
|
|
| [Drone Guide](docs/drone_guide.md) | How to implement landing logic |
|
|
| [Rover Controller](docs/rover_controller.md) | Movement patterns |
|
|
| [PyBullet](docs/pybullet.md) | PyBullet-specific setup |
|
|
| [Gazebo](docs/gazebo.md) | Gazebo-specific setup (Linux only) |
|
|
|
|
## Platform Support
|
|
|
|
| Platform | Standalone | Full (ROS 2) | Gazebo |
|
|
|----------|------------|--------------|--------|
|
|
| Windows | ✅ | ⚠️ Complex | ❌ |
|
|
| Linux | ✅ | ✅ | ✅ |
|
|
| macOS | ✅ | ⚠️ Limited | ❌ |
|
|
|
|
## Getting Started
|
|
|
|
1. **Windows**: Run `python standalone_simulation.py`
|
|
2. **Linux**: Read [docs/drone_guide.md](docs/drone_guide.md)
|
|
3. Edit `drone_controller.py` to implement your algorithm
|
|
4. Test with different rover patterns |