Scripts and simulation packaging update

This commit is contained in:
2026-01-01 00:50:28 +00:00
parent b740994185
commit 7a1c4ba227
10 changed files with 750 additions and 570 deletions

View File

@@ -4,17 +4,28 @@ A GPS-denied drone landing simulation using relative sensors (IMU, altimeter, ca
## Quick Start
```bash
# Install (Ubuntu)
./setup/install_ubuntu.sh
source activate.sh
### Windows (Standalone - No ROS 2 Required)
# 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
```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
```
@@ -22,22 +33,17 @@ python controllers.py --pattern circular --speed 0.3
```
┌─────────────────────────────────────────────────────────────────────────┐
┌──────────────────┐ ┌──────────────────────────┐
│ simulation_host │◄── UDP:5555 ──────►│ ros_bridge.py │
(PyBullet) │ └────────────┬─────────────┘
──────────────────
OR │
┌──────────────────┐ ─────────────────────────
│ Gazebo │◄── ROS Topics ────►│ gazebo_bridge.py │
└──────────────────┘ └─────────────────────────┘
┌────────────▼─────────────┐
controllers.py │
│ │ ┌─────────────────────┐ │ │
│ │ │ DroneController │ │ │
│ │ │ RoverController │ │ │
│ │ └─────────────────────┘ │ │
│ └──────────────────────────┘ │
STANDALONE MODE (Windows) FULL MODE (Linux + ROS 2)
───────────────────────── ──────────────────────────
┌────────────────────── ┌───────────────┐ ┌───────────────┐
│standalone_simulation │ │simulation_host│◄──►│ ros_bridge │
│ (All-in-one) └───────────────┘ └──────────────
└──────────────────────┘ │
──────────────────
controllers.py │
│ (Drone + Rover)
└───────────────────┘
└─────────────────────────────────────────────────────────────────────────┘
```
@@ -45,20 +51,25 @@ python controllers.py --pattern circular --speed 0.3
| 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 together** |
| `controllers.py` | Runs drone + rover controllers |
| `drone_controller.py` | Drone landing logic (edit this) |
| `rover_controller.py` | Moving landing pad |
## Controller Options
```bash
python controllers.py --help
# 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, random, square
--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)
```
@@ -72,8 +83,8 @@ The drone has no GPS. Available sensors:
| **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) |
| **Camera** | 320x240 downward-facing image |
| **Landing Pad** | Relative position when visible |
## Documentation
@@ -85,12 +96,19 @@ The drone has no GPS. Available sensors:
| [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 |
| [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. 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`
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