Scripts and simulation packaging update
This commit is contained in:
@@ -1,8 +1,32 @@
|
||||
# Architecture Overview
|
||||
|
||||
GPS-denied drone landing simulation with camera vision.
|
||||
GPS-denied drone landing simulation with multiple operation modes.
|
||||
|
||||
## System Diagram
|
||||
## Operation Modes
|
||||
|
||||
### Standalone Mode (Windows/Simple)
|
||||
|
||||
All-in-one simulation - no ROS 2 or external dependencies:
|
||||
|
||||
```
|
||||
┌────────────────────────────────────────┐
|
||||
│ standalone_simulation.py │
|
||||
│ ┌──────────────────────────────────┐ │
|
||||
│ │ PyBullet Physics Engine │ │
|
||||
│ │ ┌────────┐ ┌────────────────┐ │ │
|
||||
│ │ │ Drone │ │ Landing Pad │ │ │
|
||||
│ │ └────────┘ └────────────────┘ │ │
|
||||
│ ├──────────────────────────────────┤ │
|
||||
│ │ Built-in Controller │ │
|
||||
│ │ • Landing algorithm │ │
|
||||
│ │ • Rover movement patterns │ │
|
||||
│ └──────────────────────────────────┘ │
|
||||
└────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### Full Mode (Linux + ROS 2)
|
||||
|
||||
Modular architecture for development and testing:
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────────────────┐
|
||||
@@ -16,7 +40,7 @@ GPS-denied drone landing simulation with camera vision.
|
||||
│ OR │ │
|
||||
│ ┌──────────────────┐ ┌────────────┴─────────────┐ │
|
||||
│ │ Gazebo │◄── ROS Topics ────►│ gazebo_bridge.py │ │
|
||||
│ │ (Ignition) │ │ (Gazebo ↔ ROS Bridge) │ │
|
||||
│ │ (Linux only) │ │ (Gazebo ↔ ROS Bridge) │ │
|
||||
│ └──────────────────┘ └────────────┬─────────────┘ │
|
||||
│ │ │
|
||||
│ ┌────────────▼─────────────┐ │
|
||||
@@ -31,37 +55,31 @@ GPS-denied drone landing simulation with camera vision.
|
||||
|
||||
## Components
|
||||
|
||||
### Simulators
|
||||
### Standalone
|
||||
|
||||
| Component | Description |
|
||||
|-----------|-------------|
|
||||
| **PyBullet** (`simulation_host.py`) | Standalone physics, UDP networking, camera rendering |
|
||||
| **Gazebo** | Full robotics simulator, native ROS 2 integration, camera sensor |
|
||||
| **standalone_simulation.py** | Complete simulation with built-in controller |
|
||||
|
||||
### Bridges
|
||||
### Full Mode
|
||||
|
||||
| Component | Description |
|
||||
|-----------|-------------|
|
||||
| **PyBullet** (`simulation_host.py`) | Physics engine, UDP networking, camera |
|
||||
| **Gazebo** | Full robotics simulator (Linux only) |
|
||||
| **ros_bridge.py** | Connects PyBullet ↔ ROS 2 via UDP |
|
||||
| **gazebo_bridge.py** | Connects Gazebo ↔ ROS 2, provides same interface |
|
||||
|
||||
### Controllers
|
||||
|
||||
| Component | Description |
|
||||
|-----------|-------------|
|
||||
| **controllers.py** | Runs drone + rover controllers together |
|
||||
| **gazebo_bridge.py** | Connects Gazebo ↔ ROS 2 |
|
||||
| **controllers.py** | Runs drone + rover controllers |
|
||||
| **drone_controller.py** | GPS-denied landing logic |
|
||||
| **rover_controller.py** | Moving landing pad patterns |
|
||||
|
||||
## ROS Topics
|
||||
## ROS Topics (Full Mode)
|
||||
|
||||
| Topic | Type | Publisher | Subscriber |
|
||||
|-------|------|-----------|------------|
|
||||
| `/cmd_vel` | `Twist` | DroneController | Bridge |
|
||||
| `/drone/telemetry` | `String` | Bridge | DroneController |
|
||||
| `/rover/telemetry` | `String` | RoverController | DroneController |
|
||||
| `/rover/cmd_vel` | `Twist` | RoverController | (internal) |
|
||||
| `/rover/position` | `Point` | RoverController | (debug) |
|
||||
|
||||
## GPS-Denied Sensor Flow
|
||||
|
||||
@@ -71,49 +89,28 @@ Simulator Bridge DroneController
|
||||
│ Render Camera │ │
|
||||
│ Compute Physics │ │
|
||||
│──────────────────────►│ │
|
||||
│ │ │
|
||||
│ │ GPS-Denied Sensors: │
|
||||
│ │ - IMU │
|
||||
│ │ - Altimeter │
|
||||
│ │ - Velocity │
|
||||
│ │ - Camera Image (JPEG) │
|
||||
│ │ - Camera Image │
|
||||
│ │ - Landing Pad Detection │
|
||||
│ │─────────────────────────►│
|
||||
│ │ │
|
||||
│ │ /cmd_vel │
|
||||
│◄──────────────────────│◄─────────────────────────│
|
||||
```
|
||||
|
||||
## Camera System
|
||||
## Platform Support
|
||||
|
||||
Both simulators provide a downward-facing camera:
|
||||
| Mode | Windows | Linux | macOS |
|
||||
|------|---------|-------|-------|
|
||||
| Standalone | ✅ | ✅ | ✅ |
|
||||
| Full (ROS 2) | ⚠️ | ✅ | ⚠️ |
|
||||
| Gazebo | ❌ | ✅ | ❌ |
|
||||
|
||||
| Property | Value |
|
||||
|----------|-------|
|
||||
| Resolution | 320 x 240 |
|
||||
| FOV | 60 degrees |
|
||||
| Format | Base64 JPEG |
|
||||
| Update Rate | ~5 Hz |
|
||||
| Direction | Downward |
|
||||
|
||||
## Data Flow
|
||||
|
||||
### PyBullet Mode
|
||||
```
|
||||
DroneController → /cmd_vel → ros_bridge → UDP:5555 → simulation_host
|
||||
simulation_host → UDP:5556 → ros_bridge → /drone/telemetry → DroneController
|
||||
```
|
||||
|
||||
### Gazebo Mode
|
||||
```
|
||||
DroneController → /cmd_vel → gazebo_bridge → /drone/cmd_vel → Gazebo
|
||||
Gazebo → /model/drone/odometry → gazebo_bridge → /drone/telemetry → DroneController
|
||||
Gazebo → /drone/camera → gazebo_bridge → (encoded in telemetry)
|
||||
```
|
||||
|
||||
## UDP Protocol
|
||||
## UDP Protocol (Full Mode)
|
||||
|
||||
| Port | Direction | Content |
|
||||
|------|-----------|---------|
|
||||
| 5555 | Bridge → Simulator | Command JSON |
|
||||
| 5556 | Simulator → Bridge | Telemetry JSON (includes camera image) |
|
||||
| 5556 | Simulator → Bridge | Telemetry JSON |
|
||||
|
||||
Reference in New Issue
Block a user