Commit ยท
34f24e3
1
Parent(s): 5cdcee5
Added the project Workflow SVG
Browse files- README.md +50 -0
- data/memory.json +66 -0
- server/app.py +14 -0
- server/static/index.html +3 -1
- src/img/icon.png +0 -0
- src/svg/project_workflow.svg +73 -0
README.md
CHANGED
|
@@ -53,6 +53,7 @@ short_description: Autonomous drone delivery RL environment.
|
|
| 53 |
- [Hugging Face Submission](#hugging-face-submission)
|
| 54 |
- [Reward Engineering](#reward-engineering)
|
| 55 |
- [Grading & Evaluation](#grading--evaluation)
|
|
|
|
| 56 |
- [Project Structure](#project-structure)
|
| 57 |
- [Configuration Reference](#configuration-reference)
|
| 58 |
|
|
@@ -661,6 +662,55 @@ $$\text{score} = 0.8 \times \underbrace{\frac{\text{deliveries done}}{\text{deli
|
|
| 661 |
|
| 662 |
---
|
| 663 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 664 |
## Project Structure
|
| 665 |
|
| 666 |
```
|
|
|
|
| 53 |
- [Hugging Face Submission](#hugging-face-submission)
|
| 54 |
- [Reward Engineering](#reward-engineering)
|
| 55 |
- [Grading & Evaluation](#grading--evaluation)
|
| 56 |
+
- [Project Architecture](#project-architecture)
|
| 57 |
- [Project Structure](#project-structure)
|
| 58 |
- [Configuration Reference](#configuration-reference)
|
| 59 |
|
|
|
|
| 662 |
|
| 663 |
---
|
| 664 |
|
| 665 |
+
## ๐ The Life of a Parcel (End-to-End Flow)
|
| 666 |
+
|
| 667 |
+
If you want to understand how **SkyRelic** works "at a glance," follow the journey of a single delivery:
|
| 668 |
+
|
| 669 |
+
```mermaid
|
| 670 |
+
graph LR
|
| 671 |
+
subgraph "1. Initialization"
|
| 672 |
+
A[User] -- "Clicks Reset" --> B(FastAPI)
|
| 673 |
+
B -- "CityGen" --> C[New Map Generated]
|
| 674 |
+
end
|
| 675 |
+
|
| 676 |
+
subgraph "2. Decision Loop"
|
| 677 |
+
C -- "Telemetry" --> D{Dashboard UI}
|
| 678 |
+
D -- "State Info" --> E[Neural Brain]
|
| 679 |
+
E -- "Action (UP/DOWN/etc)" --> B
|
| 680 |
+
end
|
| 681 |
+
|
| 682 |
+
subgraph "3. Physics & Scoring"
|
| 683 |
+
B -- "Calculate" --> F{World Engine}
|
| 684 |
+
F -- "Collision/Battery" --> G[Updated State]
|
| 685 |
+
G -- "Success?" --> H((๐ Score))
|
| 686 |
+
end
|
| 687 |
+
|
| 688 |
+
G -.-> D
|
| 689 |
+
```
|
| 690 |
+
|
| 691 |
+
### ๐ฆ The Mission Journey:
|
| 692 |
+
1. **THE SPARK** โก: You click **Reset** in your browser. The Dashboard sends a request to the **FastAPI Server**.
|
| 693 |
+
2. **THE CREATION** ๐๏ธ: The **Core Logic** generates a random 10x10 city with roads ๐ฃ๏ธ, buildings ๐ข, and trees ๐ณ. It places a **Parcel** ๐ฆ at a random location.
|
| 694 |
+
3. **THE SIGHT** ๐๏ธ: The server sends the "State" (JSON) back to the **UI Dashboard**. You see the drone appear in the grid.
|
| 695 |
+
4. **THE BRAIN** ๐ง : When you click **Start**, the **Neural Engine** (RL) looks at the map, calculates the distance, and picks the best direction.
|
| 696 |
+
5. **THE FLIGHT** ๐ธ: The drone moves! The **Physics Engine** drains its battery and checks for crashes against buildings.
|
| 697 |
+
6. **THE VICTORY** ๐: Once the drone reaches the ๐ฆ, the **Grader** calculates your efficiency and updates your score!
|
| 698 |
+
|
| 699 |
+
---
|
| 700 |
+
|
| 701 |
+
## Project Architecture
|
| 702 |
+
|
| 703 |
+

|
| 704 |
+
|
| 705 |
+
The **SkyRelic** ecosystem is divided into four primary layers, interconnected via JSON telemetry and Python API endpoints:
|
| 706 |
+
|
| 707 |
+
1. **Frontend Dashboard**: A high-speed, browser-based UI that polls telemetry from the FastAPI backend and renders a real-time 2D grid of the drone's mission.
|
| 708 |
+
2. **FastAPI Server**: The communication hub that bridges the browser UI with the Python environment, managing routes for `/step`, `/reset`, and `/predict`.
|
| 709 |
+
3. **Neural RL Engine**: A PyTorch-powered Deep Q-Network (DQN) that processes urban grid data to select optimal flight paths.
|
| 710 |
+
4. **Core Logistics Env**: The "World Engine" which simulates urban terrain, battery physics, and parcel delivery missions.
|
| 711 |
+
|
| 712 |
+
---
|
| 713 |
+
|
| 714 |
## Project Structure
|
| 715 |
|
| 716 |
```
|
data/memory.json
CHANGED
|
@@ -19684,5 +19684,71 @@
|
|
| 19684 |
"deliveries_done": 1,
|
| 19685 |
"total_reward": 0.75,
|
| 19686 |
"total_steps": 4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19687 |
}
|
| 19688 |
]
|
|
|
|
| 19684 |
"deliveries_done": 1,
|
| 19685 |
"total_reward": 0.75,
|
| 19686 |
"total_steps": 4
|
| 19687 |
+
},
|
| 19688 |
+
{
|
| 19689 |
+
"task": "easy_delivery",
|
| 19690 |
+
"steps": [
|
| 19691 |
+
{
|
| 19692 |
+
"step": 1,
|
| 19693 |
+
"x": 3,
|
| 19694 |
+
"y": 7,
|
| 19695 |
+
"action": "RIGHT",
|
| 19696 |
+
"reward": -0.05,
|
| 19697 |
+
"battery": 0.9833
|
| 19698 |
+
},
|
| 19699 |
+
{
|
| 19700 |
+
"step": 2,
|
| 19701 |
+
"x": 4,
|
| 19702 |
+
"y": 7,
|
| 19703 |
+
"action": "RIGHT",
|
| 19704 |
+
"reward": -0.05,
|
| 19705 |
+
"battery": 0.9667
|
| 19706 |
+
},
|
| 19707 |
+
{
|
| 19708 |
+
"step": 3,
|
| 19709 |
+
"x": 5,
|
| 19710 |
+
"y": 7,
|
| 19711 |
+
"action": "RIGHT",
|
| 19712 |
+
"reward": -0.05,
|
| 19713 |
+
"battery": 0.95
|
| 19714 |
+
},
|
| 19715 |
+
{
|
| 19716 |
+
"step": 4,
|
| 19717 |
+
"x": 6,
|
| 19718 |
+
"y": 7,
|
| 19719 |
+
"action": "RIGHT",
|
| 19720 |
+
"reward": -0.05,
|
| 19721 |
+
"battery": 0.9333
|
| 19722 |
+
},
|
| 19723 |
+
{
|
| 19724 |
+
"step": 5,
|
| 19725 |
+
"x": 7,
|
| 19726 |
+
"y": 7,
|
| 19727 |
+
"action": "RIGHT",
|
| 19728 |
+
"reward": -0.1,
|
| 19729 |
+
"battery": 0.9167
|
| 19730 |
+
},
|
| 19731 |
+
{
|
| 19732 |
+
"step": 6,
|
| 19733 |
+
"x": 8,
|
| 19734 |
+
"y": 7,
|
| 19735 |
+
"action": "RIGHT",
|
| 19736 |
+
"reward": 0.95,
|
| 19737 |
+
"battery": 0.9
|
| 19738 |
+
}
|
| 19739 |
+
],
|
| 19740 |
+
"grid_meta": {
|
| 19741 |
+
"width": 10,
|
| 19742 |
+
"height": 10
|
| 19743 |
+
},
|
| 19744 |
+
"delivery_positions": [
|
| 19745 |
+
[
|
| 19746 |
+
8,
|
| 19747 |
+
7
|
| 19748 |
+
]
|
| 19749 |
+
],
|
| 19750 |
+
"deliveries_done": 1,
|
| 19751 |
+
"total_reward": 0.65,
|
| 19752 |
+
"total_steps": 6
|
| 19753 |
}
|
| 19754 |
]
|
server/app.py
CHANGED
|
@@ -162,6 +162,20 @@ async def root():
|
|
| 162 |
return FileResponse(index_path)
|
| 163 |
return {"name": "Drone Delivery OpenEnv", "ui": "/ui"}
|
| 164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
@app.get("/ui")
|
| 166 |
async def ui():
|
| 167 |
index_path = STATIC_DIR / "index.html"
|
|
|
|
| 162 |
return FileResponse(index_path)
|
| 163 |
return {"name": "Drone Delivery OpenEnv", "ui": "/ui"}
|
| 164 |
|
| 165 |
+
@app.get("/favicon.png")
|
| 166 |
+
async def favicon_png():
|
| 167 |
+
icon_path = BASE_DIR / "src" / "img" / "icon.png"
|
| 168 |
+
if icon_path.exists():
|
| 169 |
+
# Set headers to prevent aggressive caching during development
|
| 170 |
+
headers = {"Cache-Control": "no-cache, no-store, must-revalidate"}
|
| 171 |
+
return FileResponse(icon_path, media_type="image/png", headers=headers)
|
| 172 |
+
raise HTTPException(404, detail="Icon not found.")
|
| 173 |
+
|
| 174 |
+
@app.get("/favicon.ico")
|
| 175 |
+
async def favicon_ico():
|
| 176 |
+
"""Redirect .ico requests to our branded .png version."""
|
| 177 |
+
return await favicon_png()
|
| 178 |
+
|
| 179 |
@app.get("/ui")
|
| 180 |
async def ui():
|
| 181 |
index_path = STATIC_DIR / "index.html"
|
server/static/index.html
CHANGED
|
@@ -4,7 +4,9 @@
|
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
-
<title>๐ Drone Delivery
|
|
|
|
|
|
|
| 8 |
<link
|
| 9 |
href="https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=JetBrains+Mono:wght@300;400;500;700&display=swap"
|
| 10 |
rel="stylesheet" />
|
|
|
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
+
<title>๐ SkyRelic - Drone Delivery Env</title>
|
| 8 |
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" sizes="any">
|
| 9 |
+
<link rel="shortcut icon" href="/favicon.ico">
|
| 10 |
<link
|
| 11 |
href="https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=JetBrains+Mono:wght@300;400;500;700&display=swap"
|
| 12 |
rel="stylesheet" />
|
src/img/icon.png
ADDED
|
|
src/svg/project_workflow.svg
ADDED
|
|