# 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 ```bash # Install (Ubuntu) ./setup/install_ubuntu.sh source activate.sh # Run PyBullet simulation python simulation_host.py # Terminal 1: Simulator python ros_bridge.py # Terminal 2: ROS bridge python controllers.py # Terminal 3: Drone + Rover controllers # With moving rover python controllers.py --pattern circular --speed 0.3 ``` ## Architecture ``` ┌─────────────────────────────────────────────────────────────────────────┐ │ ┌──────────────────┐ ┌──────────────────────────┐ │ │ │ simulation_host │◄── UDP:5555 ──────►│ ros_bridge.py │ │ │ │ (PyBullet) │ └────────────┬─────────────┘ │ │ └──────────────────┘ │ │ │ OR │ │ │ ┌──────────────────┐ ┌────────────┴─────────────┐ │ │ │ Gazebo │◄── ROS Topics ────►│ gazebo_bridge.py │ │ │ └──────────────────┘ └────────────┬─────────────┘ │ │ │ │ │ ┌────────────▼─────────────┐ │ │ │ controllers.py │ │ │ │ ┌─────────────────────┐ │ │ │ │ │ DroneController │ │ │ │ │ │ RoverController │ │ │ │ │ └─────────────────────┘ │ │ │ └──────────────────────────┘ │ └─────────────────────────────────────────────────────────────────────────┘ ``` ## Files | File | Description | |------|-------------| | `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 together** | | `drone_controller.py` | Drone landing logic (edit this) | | `rover_controller.py` | Moving landing pad | ## Controller Options ```bash python controllers.py --help Options: --pattern, -p Rover pattern: stationary, linear, circular, random, 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 (base64 JPEG) | | **Landing Pad** | Relative position when visible (may be null) | ## 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 | ## Getting Started 1. Read [docs/drone_guide.md](docs/drone_guide.md) 2. Edit `drone_controller.py` 3. Implement `calculate_landing_maneuver()` 4. Run: `python controllers.py --pattern stationary` 5. Increase difficulty: `python controllers.py --pattern circular`