Files
Warehouse-Digital-Twin-and-…/README.md
T

483 lines
28 KiB
Markdown

# Warehouse Robot Fleet Digital Twin
A modular, scalable discrete-event simulation and digital twin for Autonomous Mobile Robot (AMR) warehouse operations, featuring multi-zone inventory logistics, traffic congestion management, opportunity charging, and 3D visualization via NVIDIA Omniverse and OpenUSD.
---
## 1. Project Overview & Objectives
In modern automated distribution and manufacturing hubs, coordinating heterogeneous AMR fleets across mixed inventory velocities is a primary operational challenge. This project models, simulates, and optimizes fleet performance across three distinct operational zones:
- **Zone A (Fast-moving inventory)**: Frequent order arrivals, high-speed agile robots, short transit paths, and peak-demand prioritization (Filters, Belts, Fasteners, Fluid Lines, Tractor Panels).
- **Zone B (Slow-moving & specialized inventory)**: Heavy-duty parts, payload constraints, wider aisle requirements, and extended handling times (Combine Transmissions, Structural Frames, Engine Pistons).
- **Zone C (Raw materials & production-line supply)**: Scheduled material feeds, production deadlines, stock-out tracking, and priority line delivery (Steel Coils, Control Modules, Coating Drums).
The system decouples discrete-event simulation from 3D visualization, enabling deterministic headless simulation and KPI benchmarking, while supporting OpenUSD trajectory visualization in NVIDIA Omniverse Kit.
---
## 2. Architecture Overview
```
+-----------------------------------------------------------------------------------+
| CONFIG & SPECIFICATION LAYER |
| config/warehouse.json config/robots.json |
| config/inventory.json config/simulation.json |
| config/dispatch_policies.json |
+-----------------------------------------------------------------------------------+
|
v
+-----------------------------------------------------------------------------------+
| SIMULATION ENGINE (Headless & Deterministic) |
| - SimPy Discrete-Event Scheduler - Multi-Zone Order Generator |
| - NetworkX Graph & Path Planning - Dynamic Time-Space Traffic Resv. |
| - Pluggable Fleet Dispatching - Battery State & Opportunity Charging |
+-----------------------------------------------------------------------------------+
|
v
+-----------------------------------------------------------------------------------+
| OUTPUTS & STORAGE |
| logs/simulation.log results/trajectories/ results/experiments/ |
+-----------------------------------------------------------------------------------+
| |
v v
+-----------------------------------------+ +-------------------------------------+
| NVIDIA OMNIVERSE VISUALIZATION | | ANALYTICS & METRICS |
| Kit 110.4 + OpenUSD Scene Playback | | Throughput, Fleet Utilization, |
| Lightweight Robot Prims & Indicators | | Aisle Congestion & Latency KPIs |
+-----------------------------------------+ +-------------------------------------+
```
---
## 3. Features Implemented & Roadmap
### Currently Implemented (Phases 0, 1, 2, 3 & 4)
- [x] Host environment and Omniverse Kit template inspection.
- [x] Decoupled project structure adhering to modular standards.
- [x] Standard Python packaging (`pyproject.toml`) and editable install.
- [x] Multi-target rotating file logging (`application.log`, `simulation.log`, `errors.log`).
- [x] Robust configuration loader and schema validator for all 5 domains.
- [x] Automated environment verification script (`scripts/check_environment.sh`).
- [x] CLI entry point with `validate-env`, `validate-config`, `validate-graph`, `export-graph`, `export-usd`, and `run-sim`.
- [x] Warehouse domain models (`Position3D`, `WarehouseDimensions`, `ZoneArea`, `Station`, `StorageLocation`, `WarehouseModel`).
- [x] Topological navigation graph builder (`WarehouseGraphBuilder`) with wider aisles ($4.0\text{m}$) in slow-moving Zone B.
- [x] Operational stations, charging bays, and storage racks mapped to geometric grid nodes.
- [x] Movement constraints: Zone B aisles restricted exclusively to `heavy_amr`.
- [x] Strong connectivity and multi-class robot reachability validation.
- [x] Topological graph JSON export (`results/reports/warehouse_graph.json`).
- [x] Autonomous Mobile Robot (AMR) domain models (`Robot`, `RobotState`, `RobotTypeSpec`, `LEGAL_ROBOT_TRANSITIONS`).
- [x] Task domain models (`Task`, `TaskType`, `TaskPriority`, `TaskStatus`, `LEGAL_TASK_TRANSITIONS`, turnaround, execution, SLA deadline tracking).
- [x] Inventory domain models (`InventoryItem`, `InventoryCatalog` with 13 SKUs, stock reservation, consumption, replenishment triggers).
- [x] Event telemetry streaming models (`SimulationEvent`, `SimulationEventType`, JSONL formatting).
- [x] OpenUSD 3D scene export with AMR fleet entities positioned at charging bays (`omniverse/scenes/warehouse_phase2.usda`).
- [x] SimPy discrete-event simulation engine (`SimulationEnvironment`, master clock execution).
- [x] Stochastic and scheduled multi-zone order generator (`OrderGenerator`, Poisson Zone A, wide-aisle Gaussian Zone B, scheduled Zone C, replenishment).
- [x] Priority-based fleet dispatcher (`FleetDispatcher`, shortest-path distance scoring, capability filtering).
- [x] Robot mission lifecycle execution (empty transit, picking, loaded transit, dropoff, opportunity charging).
- [x] NetworkX spatial shortest-path planner (`PathPlanner`, Dijkstra/A*, congestion-aware edge costs, capability checks).
- [x] Time-space reservation grid (`TimeSpaceReservationGrid`, head-on conflict prevention, $1.0\text{s}$ headway safety buffer, intersection occupancy).
- [x] Cooperative traffic management (`TrafficManager`, right-of-way arbitration, priority yielding, deadlock timeout rerouting).
- [x] Trajectory generation & export (`results/trajectories/trajectory_sim.json` with $(t, x, y, z, \text{yaw}, \text{state})$ coordinates).
- [x] OpenUSD Phase 4 3D scene with navigation corridor overlays (`omniverse/scenes/warehouse_phase4.usda`).
- [x] Physics-informed battery model (`BatteryModel`, load-dependent scaling, $20\%$ reserve threshold, mission feasibility validation).
- [x] Capacity-constrained charging management (`ChargingManager`, `ChargingBay` with SimPy `Resource`, queue tracking, opportunistic/mandatory charging).
- [x] Production-line delivery deadlines (Zone C $300\,\text{s}$ lead time SLA, lateness tracking, overdue detection).
- [x] Inventory stock-out monitoring (`STOCKOUT_OCCURRED` telemetry and emergency replenishment).
- [x] Safe task reassignment and priority preemption (`TaskReassigner`).
- [x] OpenUSD Phase 5 3D scene (`omniverse/scenes/warehouse_phase5.usda`).
- [x] Comprehensive KPI calculation engine (`KPICalculator`, latency percentiles, loaded/empty distance ratios, SLA compliance).
- [x] Structured telemetry store (`EventStore`, `events.jsonl`, `tasks.csv`, `robots.csv`, `aisle_congestion.csv`, `kpi_summary.json`).
- [x] Spatial 2D congestion heatmaps (`CongestionHeatmapGenerator`, interactive SVG, ASCII floorplans, automated bottleneck diagnosis).
- [x] Executive Markdown report generator (`ExperimentReportGenerator`, `report.md`).
- [x] Experiment execution & scenario comparison framework (`ExperimentRunner`, `ScenarioComparator`, Monte Carlo multi-seed execution, fleet size sweeps).
- [x] Comprehensive unit test suite (129 passed in 0.97s).
### Completed - Phase 7: NVIDIA Omniverse USD 3D Visualization
- [x] Time-sampled OpenUSD animation stage generator (`AnimatedUSDGenerator`, `warehouse_phase7_animated.usda`).
- [x] Native timeline scrubbing and playback in Omniverse Kit with zero extension dependencies.
- [x] Continuous trajectory player and spatial interpolator (`TrajectoryPlayer`, angular wrap-around handling, continuous battery SoC).
- [x] Interactive Omniverse Kit 110.4 extension (`omni.warehouse.twin.visualizer`, `omni.ui.Window`, live fleet HUD, playback controls).
- [x] Synchronized visual indicators (Status dome glow, battery health LED, cargo box attachment).
- [x] Comprehensive unit test suite (137 passed in 1.01s).
### Completed - Phase 8: Operational Dashboard
- [x] Zero-dependency decoupled dashboard server (`DashboardServer`, standard library `http.server`).
- [x] Fast telemetry data provider & CSV parser (`DashboardDataProvider`, read-only safety guarantees).
- [x] Sleek dark-mode Single Page Web Application (`index.html`, `app.css`, `app.js`).
- [x] 6 Executive KPI cards (Throughput, Turnaround p50/p95, SLA %, Fleet Util %, Energy, Contention).
- [x] Latency distribution percentile matrix ($p_{50}, p_{90}, p_{95}, p_{99}$, mean, max).
- [x] Real-time AMR fleet telemetry matrix with dynamic battery health bars.
- [x] Embedded 2D spatial SVG congestion heatmap viewer and top corridor bottleneck diagnosis table.
- [x] Scenario comparison matrices for fleet sizing ($2, 4, 6, 8$ AMRs) and dispatch policies.
- [x] Audit-ready executive Markdown report viewer with instant download.
- [x] Optional Streamlit interface (`streamlit_app.py`).
- [x] Comprehensive unit test suite (144 passed in 2.43s).
### Completed - Phase 9: Optimization Scenarios, Layout Variations, and Final Demonstration
- [x] Facility layout variation engine (Baseline, Decentralized Charging, Directional Highway Corridors, Velocity-Based SKU Slotting, and Hybrid Optimal).
- [x] Multi-objective fleet composition optimizer with non-dominated Pareto frontier calculation (throughput, $p_{90}$ latency, conflict delays, energy intensity).
- [x] Quantitative mathematical benchmark comparator with multi-factor audit scoring ($[0, 100]$) and automated qualitative takeaways.
- [x] Optimization reporting suite (`optimization_report.md`, `optimization_summary.json`, comparative 2D SVG floorplan `layout_comparison.svg`).
- [x] End-to-end demonstration runner (`FinalDemoRunner`) executing layout benchmarking, fleet Pareto search, and OpenUSD generation.
- [x] Time-sampled OpenUSD showcase scene (`omniverse/scenes/warehouse_final_demo.usda`) for native playback in NVIDIA Omniverse Kit.
- [x] Operational dashboard "Optimization & Layouts" view with live delta badges, audit score card (84.6/100), and interactive SVG floorplans.
- [x] Dedicated CLI subcommands: `warehouse-twin optimize` and `warehouse-twin run-demo`.
- [x] Comprehensive unit test suite (157 passed in 3.05s, 100% pass rate).
---
## 4. Supported Environment
- **Operating System**: Ubuntu 24.04.3 LTS (x86_64).
- **Python**: Python 3.12 (Host has 3.12.3; compatible with >= 3.10).
- **Core Dependencies**: `simpy` 4.1.2, `networkx` 3.7, `pytest` 9.1.1.
- **NVIDIA GPU**: NVIDIA GeForce RTX 5090 (Driver 580.178.04, CUDA 13.0).
- **NVIDIA Omniverse Kit**: Kit 110.4.0 (located at `/home/dmhai/Desktop/nvidia-omniverse/kit-app-template`).
- **Isaac Sim**: **NOT required**. The core simulation operates completely independently of Isaac Sim.
---
## 5. Installation & Setup
1. **Clone or enter the project directory**:
```bash
cd /home/dmhai/warehouse-digital-twin
```
2. **Activate the virtual environment**:
```bash
source .venv/bin/activate
```
3. **Install the package in editable mode**:
```bash
pip install -e .
```
4. **Run environment verification**:
```bash
./scripts/check_environment.sh
```
---
## 6. Configuration Instructions
All parameters are externalized in `config/`:
- `config/warehouse.json`: Facility dimensions (60m x 40m), Zone A/B/C bounds, docks, stations, and charging bays.
- `config/robots.json`: Robot types (Light AMR, Heavy AMR), speeds, payloads, battery capacities, and fleet composition.
- `config/inventory.json`: Item catalogs for Zones A, B, and C with stock counts, weights, and replenishment parameters.
- `config/simulation.json`: Duration (3600s), tick resolution, random seed, and arrival rates.
- `config/dispatch_policies.json`: Dispatch policies, reservation parameters, and charging thresholds.
---
## 7. Running Commands
### Verify Environment
```bash
warehouse-twin validate-env
```
### Validate Configuration Files
```bash
warehouse-twin validate-config
```
### Validate Navigation Graph & Connectivity
```bash
warehouse-twin validate-graph
```
### Export Warehouse Graph to JSON
```bash
warehouse-twin export-graph
# Or with custom output location:
warehouse-twin export-graph --output results/reports/custom_graph.json
```
### Run Automated Tests
```bash
./scripts/run_tests.sh
# Or directly with pytest:
pytest tests/ -v
```
### Run Reproducible Experiment (Phase 6)
```bash
warehouse-twin run-experiment --experiment-id baseline_1hr --duration 3600 --seed 42
```
Generates complete telemetry in `results/experiments/baseline_1hr/`:
- `events.jsonl`, `tasks.csv`, `robots.csv`, `aisle_congestion.csv`, `kpi_summary.json`
- `congestion_heatmap.svg` (2D spatial interactive heatmap)
- `report.md` (Executive summary with latency distributions and bottleneck recommendations)
### Run Scenario Comparisons (Phase 6)
```bash
# Compare fleet sizing across 2, 4, 6, and 8 AMRs:
warehouse-twin compare-scenarios --scenario-type fleet_size --fleet-sizes 2 4 6 8 --duration 3600
# Benchmark dispatching heuristics under identical workloads:
warehouse-twin compare-scenarios --scenario-type dispatch_policy --policies priority_nearest_idle nearest_idle balanced_utilization --duration 3600
```
---
## 8. Low-Disk-Space Protection
The primary drive (`/`) has constrained free space (~8.9 GB free). To prevent disk exhaustion:
1. All application logs use rotating file handlers capped at 10 MB.
2. Large trajectory recordings and experiment results are ignored by `.gitignore`.
3. To redirect logs and results to an external or secondary drive, set:
```bash
export WAREHOUSE_TWIN_SECONDARY_DRIVE="/path/to/external/storage"
```
---
## 9. Omniverse 3D Visualization (Realistic Assets & Time-Sampled Playback)
The visualizer supports modular, realistic 3D OpenUSD assets (architectural building shell, multi-tier pallet racks, parts shelving, wooden Euro-pallets, cargo cartons, charging pedestals, inbound dock ramps, and high-detail AMRs) referencing a declarative manifest (`config/asset_manifest.json`):
### Option A: Realistic 3D Warehouse Scene (Static)
Generate a realistic 3D warehouse scene with structural shell, racks, multi-level pallets, stations, and parked fleet:
```bash
warehouse-twin export-usd
```
Exports to `omniverse/scenes/warehouse_realistic.usda`.
### Option B: Realistic 3D Animated Fleet Simulation (Native Timeline Playback)
Export complete time-sampled kinematic tracks for all AMRs, dynamic status beacons, and mounted cargo attachments:
```bash
warehouse-twin export-usd \
--trajectory results/trajectories/trajectory_sim.json \
--output omniverse/scenes/warehouse_realistic_animated.usda \
--step-seconds 2.0
```
1. Launch Omniverse Kit:
```bash
/home/dmhai/Desktop/nvidia-omniverse/kit-app-template/_build/linux-x86_64/release/warehouse_twin.kit.sh
```
2. In the Kit window, select **File $\rightarrow$ Open** and choose `omniverse/scenes/warehouse_realistic_animated.usda`.
3. Press **Spacebar** or click **Play** on the timeline toolbar to view the simulation with realistic assets!
4. Use the viewport camera dropdown to switch to `OverviewCamera` or `TopDownCamera`.
### Option C: Interactive Trajectory Playback Extension
1. Launch Omniverse Kit.
2. Open `omniverse/scenes/warehouse_realistic.usda`.
3. The `omni.warehouse.twin.visualizer` window automatically provides Play/Pause controls, time scrubbing slider, speed multipliers ($0.5\times$ to $10.0\times$), and real-time fleet telemetry HUD.
> [!NOTE]
> To export using legacy block/primitive geometry instead of realistic 3D assets, append `--legacy-blocks` to the command line.
---
## 10. Operational Dashboard (Phase 8)
Launch the interactive web dashboard to explore telemetry, KPIs, heatmaps, and scenario comparisons:
```bash
warehouse-twin dashboard --port 8501 --results-dir results
```
Open your browser at `http://127.0.0.1:8501`.
Key Views:
- **Overview & KPIs**: Executive cards, throughput, p50/p95 turnaround latency, SLA compliance.
- **AMR Fleet & Battery**: Live robot status, battery gauges, loaded vs empty travel ratios, charging bay occupancy.
- **Corridor Congestion**: 2D spatial SVG heatmap and prioritized bottleneck recommendations.
- **Tasks & SLAs**: Completed, in-progress, pending counts, and task-type performance breakdowns.
- **Scenario Comparison**: Side-by-side comparison tables across fleet sizes ($2, 4, 6, 8$ AMRs) and dispatch policies.
- **Executive Report**: Embedded audit-ready Markdown report viewer with instant file download.
- **Optimization & Layouts**: Live audit score card (84.6/100), metric delta badges, layout architecture table, and interactive SVG floorplan comparison.
---
## 11. Optimization Scenarios & Layout Variations (Phase 9)
Run layout optimization and fleet composition analysis:
```bash
# Evaluate all layout variants (Baseline, Decentralized Charging, Directional Highways, Velocity Slotting, Hybrid Optimal):
warehouse-twin optimize --type layout --duration 1800 --seed 42 --output-dir results/optimization
# Run multi-objective fleet composition Pareto frontier optimization:
warehouse-twin optimize --type fleet --duration 1800 --seed 42 --output-dir results/optimization
# Run both layout and fleet optimization simultaneously:
warehouse-twin optimize --type all --duration 1800 --seed 42 --output-dir results/optimization
```
Artifacts generated:
- `results/optimization/optimization_report.md`: Complete executive audit report with delta tables and quantitative scoring.
- `results/optimization/optimization_summary.json`: Structured machine-readable metrics for programmatic ingestion.
- `results/optimization/layout_comparison.svg`: Comparative 2D floorplan showing circulation loops, charger relocations, and slotting gradients.
---
## 12. Capstone Final Demonstration (Phase 9)
Execute the end-to-end 5-stage demonstration pipeline:
```bash
# Run complete demonstration workflow:
warehouse-twin run-demo --duration 1800 --seed 42 --output-dir results/demonstration --usd-output omniverse/scenes/warehouse_final_demo.usda
# Quick verification mode (~5 seconds):
warehouse-twin run-demo --quick
```
The demonstration runner automatically:
1. Simulates the baseline facility layout.
2. Simulates the hybrid optimal layout (decentralized chargers, directional highways, velocity slotting).
3. Evaluates quantitative deltas and computes the composite audit score ($84.6 / 100$).
4. Evaluates fleet composition Pareto frontier.
5. Generates the time-sampled OpenUSD showcase stage (`omniverse/scenes/warehouse_final_demo.usda`).
6. Exports Markdown audit report, summary JSON, and comparative SVG floorplan.
### Play Showcase Stage in NVIDIA Omniverse Kit:
1. Launch Omniverse Kit:
```bash
/home/dmhai/Desktop/nvidia-omniverse/kit-app-template/_build/linux-x86_64/release/warehouse_twin.kit.sh
```
2. Open `omniverse/scenes/warehouse_final_demo.usda` via `File -> Open`.
3. Press **Spacebar** or click **Play** on the timeline toolbar to view the optimized fleet circulation, decentralized charging, and multi-zone operations in real time!
---
---
## 13. Grid Design, Rack-Side Order Picking, Collision Avoidance & Charging Architecture
### A. Discrete Grid & Coordinate System Conventions
- **Coordinate System**: Right-handed Cartesian (`+X` = East / Length, `+Y` = North / Depth, `+Z` = Up / Height). Units: **meters**.
- **Continuous World to Discrete Grid Conversion**:
$$\text{col} = \left\lfloor \frac{x}{\text{cell\_size}} \right\rfloor, \quad \text{row} = \left\lfloor \frac{y}{\text{cell\_size}} \right\rfloor$$
$$x = \left(\text{col} + 0.5\right) \times \text{cell\_size}, \quad y = \left(\text{row} + 0.5\right) \times \text{cell\_size}$$
- **Cell Classification**: `FREE`, `RACK_FOOTPRINT` (impassable), `AISLE` (traversable), `PICKING_POSITION` (dedicated approach waypoint), `CHARGING_POSITION` (exclusive berth), `INTERSECTION`, `RESTRICTED`, `OBSTACLE`.
### B. Front-Facing Rack-Side Picking Points
Robots approach the designated front picking side of the rack and stop strictly outside the rack's physical collision footprint:
- **South-Facing Shelf**: Approach position $(x, y - (d/2 + c))$, approach yaw $= 90^\circ$ (facing North toward shelf face).
- **North-Facing Shelf**: Approach position $(x, y + (d/2 + c))$, approach yaw $= -90^\circ$ (facing South toward shelf face).
- **West-Facing Shelf**: Approach position $(x - (l/2 + c), y)$, approach yaw $= 0^\circ$ (facing East toward shelf face).
- **East-Facing Shelf**: Approach position $(x + (l/2 + c), y)$, approach yaw $= 180^\circ$ (facing West toward shelf face).
- **State Machine Lifecycle**:
$$\text{IDLE} \rightarrow \text{DISPATCHED} \rightarrow \text{NAVIGATING\_TO\_RACK} \rightarrow \text{ALIGNING} \rightarrow \text{PICKING} \rightarrow \text{PICK\_CONFIRMED} \rightarrow \text{MOVE\_AWAY} \rightarrow \text{LOADED\_TRANSIT} \rightarrow \text{DELIVERING} \rightarrow \text{COMPLETED}$$
- After picking completes, the AMR first transitions to the traversable aisle waypoint before initiating loaded transit, preventing any clipping through solid rack geometry.
### C. Procedural Multi-Row Warehouse Layout Generator & Validator
- Centralized configuration: `config/warehouse_layout_config.json`.
- `ModularWarehouseBuilder` procedurally generates parallel rack rows, bays per row, clear aisles, and cross-aisles.
- `LayoutValidator` generates an audit report (`LayoutValidationReport`) enforcing boundary limits, AABB footprint isolation, aisle width clearances, and topological reachability.
### D. Intelligent Charging-Station Placement Planner
- Replaces hard-coded cluster with a configurable 6-step spatial planner (`ChargingStationPlanner`).
- Places stations in dedicated, non-obstructive perimeter alcoves outside high-traffic corridors and intersections.
- Enforces single-berth capacity (`capacity = 1`) and dedicated approach spurs.
### E. Multi-Robot Collision Avoidance, Footprint Clearance & Deadlocks
- **Footprint-Aware Spatial Clearance**: `TimeSpaceReservationGrid` verifies that concurrently reserved waypoints satisfy $\text{dist}(P_a, P_b) \ge 2 \times R_{\text{footprint}}$ (e.g. $1.0\text{m}$ safe separation).
- **Temporal Reservations**: Detects head-on conflicts in narrow aisles, following distance/headway violations ($1.0\text{s}$ buffer), and intersection contention.
- **Deadlock Cycle Resolution**: `DeadlockManager` maintains a directed wait-for graph, detects circular dependency cycles, and resolves them immediately by commanding the deterministic victim robot to replan around contested edges.
### F. OpenUSD 3D Scene Generation
- Generates `omniverse/scenes/warehouse_realistic.usda` and animated `warehouse_realistic_animated.usda`.
- Dedicated `def Scope "PickingPoints"` containing `/World/Warehouse/PickingPoints/{loc_id}_Front` with visual approach markers and shelf metadata.
- Referenced 3D assets: `shelving_unit_light`, `pallet_rack_heavy`, `dock_inbound`, `outbound_dock`, `charging_station`, `amr_light`, and `amr_heavy`.
---
## 14. Project Status & Verification
**Status**: **ALL OBJECTIVES COMPLETED & VERIFIED**.
- **Test Suite**: **195 passed unit & integration tests (100% pass rate in 5.95s)**.
- **Layout Validation**: `ModularWarehouseBuilder` and `LayoutValidator` fully verified.
- **Collision Avoidance & Deadlocks**: Footprint clearances, headway enforcement, and wait-for cycle recovery tested and verified.
- **OpenUSD Scenes**: Ready for native inspection in NVIDIA Omniverse Kit (`omniverse/scenes/warehouse_realistic.usda`, `warehouse_realistic_animated.usda`, and `results/demo/*/warehouse.usda`).
---
## 15. Three-Stage NVIDIA Omniverse Digital Twin Demonstration
A flagship, reproducible, end-to-end demonstration workflow showing warehouse performance transformation across three distinct stages:
1. **Stage 1: Initial Baseline Facility**
- Centralized Northwest charging alcoves (`charge_bay_1` to `charge_bay_4` at $x \le 8.0, y=36.0$).
- Bidirectional highway corridors with shared central cross-arterials.
- Default catalog inventory allocation across 13 industrial racks.
- Baseline performance: $72.0\,\text{tasks/hr}$, 4 traffic conflict stalls, $9.51\,\text{s}$ yield delay.
2. **Stage 2: Systematic Multi-Candidate Optimization Search**
- Quantitative evaluation of 5 candidate warehouse configurations under identical workload (4 AMRs: 2 Light, 2 Heavy) and fixed random seed (42):
1. `Baseline Layout` (Benchmark starting point)
2. `Decentralized Charging` (Eliminates long empty travel to NW corner)
3. `Directional Highway Corridors` (Eliminates head-on yield waiting)
4. `Velocity-Based SKU Slotting` (Shortens transit distance for fast-moving items)
5. `Hybrid Optimal Facility` (Synergistic combination achieving peak throughput)
- Evaluates storage utilization ($100\%$ rack occupancy) and reallocates 9 high-frequency SKUs adjacent to outbound pack docks, reducing velocity-weighted pick distance by **16.8%**.
3. **Stage 3: Final Optimized Hybrid Facility**
- Decentralized charging infrastructure distributed across Zone A ($x=4, 8$), Zone B ($x=30$), and Zone C ($x=52$).
- Directional one-way highway circulation loop eliminating head-on contention stalls.
- Validated gains: $+16.7\%$ throughput ($84.0\,\text{tasks/hr}$), $-50.0\%$ traffic conflicts (2 events), $-47.3\%$ yield wait time ($5.01\,\text{s}$), and $-10.4\%$ energy intensity ($0.01\,\text{kWh/task}$). Overall Optimization Score: **89.1 / 100.0**.
### How to Run the Demonstration
```bash
# Run complete demonstration in quick mode (300s simulation per stage)
warehouse-twin run-staged-demo --quick
# Run production demonstration (1800s / 30min simulation per stage)
warehouse-twin run-staged-demo --duration 1800 --fps 30 --playback-speed 8.0
# Run a single stage independently (e.g. stage 3 only)
warehouse-twin run-staged-demo --stage 3 --quick
# Alternatively via run-demo
warehouse-twin run-demo --staged --quick
```
### Generated Artifacts & Inventory
- **OpenUSD Stages** (Ready for native Omniverse Kit loading):
- `results/demo/initial/warehouse.usda`
- `results/demo/optimizing/warehouse.usda`
- `results/demo/optimized/warehouse.usda`
- **Broadcast-Grade 1080p MP4 Videos** (H.264 High profile, 30fps):
- `results/demo/videos/01_initial.mp4` (or `01_baseline.mp4`)
- `results/demo/videos/02_optimizing.mp4` (or `02_optimization_progress.mp4`)
- `results/demo/videos/03_optimized.mp4` (or `03_final_optimized.mp4`)
- `results/demo/videos/warehouse_optimization_story.mp4` (Full Executive Trilogy)
- **Tabular Datasets & Reports**:
- `results/demonstration/staged_demo/stage_kpi_comparison.json`
- `results/demonstration/staged_demo/stage_kpi_comparison.csv`
- `results/demonstration/staged_demo/final_demo_report.md`
### Synchronized KPI Dashboard
Launch either the built-in HTTP server or the Streamlit analytics app:
```bash
# Start lightweight operational dashboard
warehouse-twin dashboard --port 8080
# Or start Streamlit app
streamlit run src/warehouse_twin/dashboard/streamlit_app.py
```
Navigate to the **🎬 3-Stage Demo & Videos** tab to switch between stages, control playback speed (0.5x, 1x, 8x, 16x), view synchronized telemetry scorecards with directional delta calculations, and review the candidate optimization matrix.
### Inspecting 3D Stages in NVIDIA Omniverse Kit
```bash
/home/dmhai/Desktop/nvidia-omniverse/kit-app-template/_build/linux-x86_64/release/warehouse_twin.kit.sh \
--ext-folder /home/dmhai/warehouse-digital-twin/omniverse/extensions \
--enable omni.warehouse.twin.visualizer
```
In Omniverse Kit, go to **File $\to$ Open** and load any generated stage (`results/demo_staged/usd/stage_01_baseline.usda`, `results/demo_staged/usd/stage_02_optimization_progress.usda`, or `results/demo_staged/usd/stage_03_final_optimized.usda`). Press **Space** on the timeline to watch the animated AMR fleet in real time.