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

16 KiB

Implementation Report: Realistic 3D Asset Integration

Warehouse Robot Fleet Digital Twin
Subsystem: NVIDIA Omniverse OpenUSD 3D Visualization
Platform: Ubuntu 24.04 LTS | NVIDIA Omniverse Kit 110.4 | OpenUSD ASCII (.usda)


1. Assessment of Prior Implementation

Prior to this milestone, the warehouse 3D visualization relied on procedurally generated primitive cubes and cylinders (WarehouseUSDGenerator and AnimatedUSDGenerator):

  • Racks were represented by single extruded rectangular bounding boxes with solid colors.
  • Pallets and cargo cartons were simple monolithic blocks without structural detail.
  • Robots were represented by basic cuboids with small indicator prisms.
  • Architectural elements (walls, floors, columns) lacked structural framing, concrete slabs, dock doors, or safety bollards.
  • Stations and charging pads were flat rectangular plates.

While mathematically accurate and aligned with the NetworkX graph nodes, the visual appearance did not reflect a production-grade industrial facility.

Preservation Guarantees

The underlying discrete-event simulation engine, path planning, and spatial topology remain 100% preserved:

  • NetworkX Graph: Grid nodes, edge lengths, traversal costs, and 4.0m wider aisles in Zone B remain the single source of truth.
  • SimPy Discrete-Event Simulation: Master clock, Poisson order generation, time-space conflict reservations, priority yielding, and opportunity charging operate identically.
  • Strict Decoupling: Simulation logic contains zero dependencies on visual meshes or rendering APIs.

2. Modular Architecture & Responsibilities

The visualization subsystem is structured into dedicated, decoupled modules under src/warehouse_twin/visualization/:

src/warehouse_twin/visualization/
├── __init__.py               # Package exports
├── asset_loader.py          # Manifest resolution, validation, and USD referencing
├── coordinate_mapper.py     # Deterministic graph-to-world coordinate transformation
├── materials.py             # Industrial PBR UsdPreviewSurface shader library
├── route_visualizer.py      # Navigation highway corridor and lane visualizers
├── warehouse_builder.py     # Static 3D warehouse builder referencing modular assets
├── robot_animator.py        # Time-sampled kinematic track generator for 3D AMRs
├── animated_usd.py          # Legacy/primitive animation engine (preserved)
└── trajectory_player.py     # Continuous trajectory interpolation and playback state machine

assets/
├── warehouse/
│   ├── building_shell.usda  # Concrete floor, perimeter walls, structural I-beam columns
│   └── safety_barrier.usda  # Industrial tubular steel safety guardrail
├── racks/
│   ├── pallet_rack_heavy.usda   # Multi-tier heavy pallet rack with cross beams and decking
│   └── shelving_unit_light.usda # High-density small parts shelving for Zone A
├── pallets/
│   ├── euro_pallet.usda         # Standard European EPAL wooden pallet
│   └── pallet_with_cartons.usda # Euro-pallet loaded with corrugated cardboard cartons
├── robots/
│   ├── amr_light.usda       # Agile lightweight AMR with drive wheels, casters, LiDAR pucks
│   └── amr_heavy.usda       # Heavy-duty AMR with reinforced chassis, dual drives, lift bed
└── stations/
    ├── dock_inbound.usda    # Inbound dock bay with leveler ramp, bumpers, bollards
    ├── picking_station.usda # Ergonomic workstation table, terminal arm, roller conveyor
    └── charging_station.usda # Automated inductive charging pad with power pedestal tower

config/
└── asset_manifest.json      # Declarative catalog recording asset roles, dimensions, scales

Module Responsibilities

  1. asset_loader.py (AssetManifest, USDAssetLoader):

    • Parses and validates config/asset_manifest.json.
    • Resolves relative file paths between scene directories and asset files.
    • Generates non-destructive OpenUSD references (references = @.../asset.usda@).
    • Maintains registered prim paths to prevent namespace collisions or duplicate prims.
  2. coordinate_mapper.py (CoordinateMapper):

    • Maps 2D/3D graph coordinates to continuous world coordinates.
    • Configurable origin (0.0, 0.0, 0.0), floor elevation, and scale multiplier.
    • Computes multi-level shelf elevations for pallets seated on rack tiers.
  3. materials.py (MaterialManager):

    • Defines standard industrial PBR materials compliant with UsdPreviewSurface.
    • Includes ConcreteFloor, SafetyYellow, SafetyAmber, StructuralSteel, WoodPine, KraftCardboard, TechWhite, BeaconCyan, and BeaconEmerald.
  4. route_visualizer.py (RouteVisualizer):

    • Generates navigation highway corridors, lane markings, and aisle boundaries under /World/Routes/....
  5. warehouse_builder.py (Warehouse3DBuilder):

    • Constructs the complete static 3D warehouse stage.
    • Instantiates architecture, zones, storage racks, multi-tier pallets, stations, charging bays, barriers, camera presets, and robot fleet.
  6. robot_animator.py (Robot3DAnimator):

    • Connects simulation trajectory waypoints to 3D robot assets.
    • Generates time-sampled translation (xformOp:translate.timeSamples) and rotation (xformOp:rotateXYZ.timeSamples).
    • Overrides status dome beacon colors dynamically based on operational state.
    • Dynamically mounts cargo pallets atop the AMR lift bed with time-sampled visibility (visibility.timeSamples = { t: "inherited" / "invisible" }).

3. Validated 3D Assets & Manifest

All 11 assets are valid OpenUSD ASCII stages (.usda) adhering to metersPerUnit = 1.0 and upAxis = "Z":

Asset ID Role Dimensions (L x W x H) File Path Key Features
building_shell Architecture 60.0m x 40.0m x 8.0m assets/warehouse/building_shell.usda Concrete slab, perimeter walls, structural I-beam columns with hazard base guards
safety_barrier Barrier 1.8m x 0.25m x 0.9m assets/warehouse/safety_barrier.usda High-vis yellow tubular guardrails with mounting floor flanges
pallet_rack_heavy Storage Rack 2.8m x 1.2m x 4.5m assets/racks/pallet_rack_heavy.usda 4 structural steel uprights, 3 safety orange load beam tiers, steel decking, anchor footplates
shelving_unit_light Storage Shelf 1.9m x 0.8m x 3.2m assets/racks/shelving_unit_light.usda 4 slotted posts, 4 powder-coated blue steel shelves, canopy cover
euro_pallet Pallet 1.2m x 0.8m x 0.144m assets/pallets/euro_pallet.usda 5 top deck boards, 3 stringers, 9 spacer blocks, 3 base runners (EPAL standard)
pallet_with_cartons Inventory 1.2m x 0.8m x 0.95m assets/pallets/pallet_with_cartons.usda Euro-pallet loaded with 8 corrugated cardboard boxes, shipping labels, strap bands
amr_light Robot 0.8m x 0.6m x 0.35m assets/robots/amr_light.usda Beveled tech-white chassis, recessed drive wheels, casters, LiDAR scanner, 360 status dome, E-stop
amr_heavy Robot 1.4m x 1.0m x 0.45m assets/robots/amr_heavy.usda Reinforced amber steel chassis, dual high-torque wheels, corner LiDARs, hydraulic pallet lift bed
dock_inbound Station 2.6m x 3.0m x 3.6m assets/stations/dock_inbound.usda Hydraulic leveler ramp, rubber bumpers, yellow safety bollards, overhead roll-up portal frame
picking_station Station 2.0m x 1.5m x 1.8m assets/stations/picking_station.usda Steel workbench, articulated terminal display arm, roller conveyor, kitting tote bins
charging_station Station 1.5m x 1.5m x 1.4m assets/stations/charging_station.usda Copper inductive contact pad, vertical power pedestal tower, digital battery telemetry display

4. Coordinate & Scale Conventions

  • Units: 1 USD unit = 1.0 meter (metersPerUnit = 1.0).
  • Coordinate System: Right-handed Cartesian (upAxis = "Z").
    • +X: Facility Width (0.0m to 60.0m, East).
    • +Y: Facility Depth (0.0m to 40.0m, North).
    • +Z: Facility Elevation (0.0m ground floor to 8.0m roof clearance).
  • Origin: South-West corner of the warehouse interior floor is at (0.0, 0.0, 0.0).
  • Storage Rack Alignment: Racks are placed at exact storage location positions defined in config/warehouse.json.
  • Aisle Clearance:
    • Standard Zone A/C aisles: 2.5m - 3.0m width.
    • Slow-moving Zone B aisles: 4.0m width, strictly restricted to heavy_amr.

5. Generated 3D Stages

The system exports two primary stages into omniverse/scenes/:

  1. Static Realistic Stage (omniverse/scenes/warehouse_realistic.usda):

    • Complete facility populated with modular referenced building shell, multi-tier racks, pallets, cartons, stations, charging bays, barriers, camera presets, and stationary AMR fleet.
    • Size: ~35 KB (compact due to modular referencing).
  2. Animated Dynamic Stage (omniverse/scenes/warehouse_realistic_animated.usda):

    • Complete facility plus time-sampled kinematic tracks for the 4-AMR fleet across 1 hour of simulation (86,383 animation frames at 24 fps).
    • Time-sampled translation, rotation, status beacon colors, and dynamic cargo pallet attachment.
    • Size: ~1.3 MB.

6. How to Open and Play in NVIDIA Omniverse Kit

Option 1: Native Timeline Playback (Zero Extensions Required)

  1. Launch Omniverse Kit:
    /home/dmhai/Desktop/nvidia-omniverse/kit-app-template/_build/linux-x86_64/release/warehouse_twin.kit.sh
    
  2. In the Kit application, select File \rightarrow Open.
  3. Select omniverse/scenes/warehouse_realistic_animated.usda.
  4. Press Spacebar (or click Play on the timeline toolbar at the bottom).
  5. Use the Camera menu in the viewport to switch between:
    • OverviewCamera (elevated 3/4 perspective view of the entire facility).
    • TopDownCamera (orthographic floorplan view).
    • Free Camera (WASD + right-click navigation).

Option 2: Inspect Static Stage

warehouse-twin export-usd

Opens omniverse/scenes/warehouse_realistic.usda to inspect architecture, rack placement, pallets, and stations without playback.


7. Testing & Verification Summary

A dedicated test suite was added in tests/unit/test_assets_validation.py and tests/unit/test_realistic_3d_assets.py.

.venv/bin/pytest tests/ -v
  • Total Unit Tests Executed: 186
  • Passed: 186
  • Failed: 0
  • Pass Rate: 100.0%
  • Execution Time: ~3.23 seconds
tests/unit/test_assets_validation.py::test_asset_manifest_structure_and_completeness PASSED [  1%]
tests/unit/test_assets_validation.py::test_manifest_assets_exist_on_disk PASSED             [  1%]
tests/unit/test_assets_validation.py::test_rack_and_robot_usda_syntax PASSED                [  2%]
tests/unit/test_realistic_3d_assets.py::test_coordinate_mapper_bidirectional PASSED        [ 59%]
tests/unit/test_realistic_3d_assets.py::test_asset_loader_creates_valid_references PASSED  [ 60%]
tests/unit/test_realistic_3d_assets.py::test_warehouse_builder_generates_valid_scene PASSED[ 60%]
tests/unit/test_realistic_3d_assets.py::test_robot_animator_single_and_multi_robot PASSED  [ 61%]
...
============================= 186 passed in 3.23s ==============================

8. Warehouse Navigation, Rack-Side Picking, Layout & Collision Architecture

8.1 Audit and Diagnosis of Previous Behavior

During simulation execution, the following root causes were identified and resolved:

  1. Under-Rack Waypoints: The previous navigation graph placed rack target waypoints at geometric rack centers (x_{\text{center}}, y_{\text{center}}, 0.0), causing AMRs to travel directly into/underneath solid physical rack geometry.
  2. Missing Approach Offsets: AMRs lacked designated aisle presentation waypoints, causing orders to be "picked" while AMRs were located inside shelf structures.
  3. Rack-Clipping on Departure: Upon completing a pick, AMRs routed directly toward destination docks through adjacent racks because they had not moved away into the traversable aisle.
  4. Concentrated Charging: All charging berths were clustered along a single wall without approach spurs or headway buffers.
  5. Aisle Collisions: Visual animation did not prevent spatial overlaps between AMRs traversing shared narrow aisles or intersections.

8.2 Rack-Side Picking Points & Shelf Approach Geometry

Storage racks now expose explicit PickingPoint domain entities located strictly in traversable aisles outside rack footprints:

  • For a rack of dimensions (L, D, H) centered at (x_c, y_c) with clearance c = 0.8\,\text{m}:
    • South-Facing: (x_c, y_c - (D/2 + c)), approach yaw = 90^\circ (facing North).
    • North-Facing: (x_c, y_c + (D/2 + c)), approach yaw = -90^\circ (facing South).
    • West-Facing: (x_c - (L/2 + c), y_c), approach yaw = 0^\circ (facing East).
    • East-Facing: (x_c + (L/2 + c), y_c), approach yaw = 180^\circ (facing West).
  • The picking point is instantiated in the navigation graph as pick_{rack_id} connected to the aisle network. The solid rack center remains marked as an impassable obstacle (_rack_nodes).
  • Post-Pick Departure: The AMR transitions to the aisle waypoint via get_rack_aisle_waypoint prior to initiating loaded transit.

8.3 Configurable Discrete Grid (WarehouseGrid)

Located in warehouse_twin/layout/grid.py:

  • Grid resolution: 0.5\,\text{m} (configurable).
  • Cell types: FREE, RACK_FOOTPRINT, AISLE, PICKING_POSITION, CHARGING_POSITION, INTERSECTION, RESTRICTED, OBSTACLE.
  • Bi-directional continuous-to-discrete coordinate transformation: \text{col} = \lfloor x / \text{cell\_size} \rfloor, \quad \text{row} = \lfloor y / \text{cell\_size} \rfloor x = (\text{col} + 0.5) \times \text{cell\_size}, \quad y = (\text{row} + 0.5) \times \text{cell\_size}

8.4 Multi-Row Procedural Warehouse Layout Generator & Validator

Located in warehouse_twin/layout/layout_generator.py:

  • Procedural generation of multiple parallel rack rows with repeated modules, bay gaps, clear aisles, and connecting cross-aisles.
  • Centralized configuration file: config/warehouse_layout_config.json.
  • LayoutValidator: Generates LayoutValidationReport auditing boundary limits, AABB rack overlaps, charger isolation, and graph reachability.

8.5 Distributed Charging-Station Planner

Located in warehouse_twin/layout/charging_planner.py:

  • 6-step spatial placement strategy identifying non-obstructive perimeter alcoves.
  • Prevents charging berths from blocking primary aisles, rack faces, and intersections.
  • Enforces single-berth capacity (capacity = 1) and minimum separation between chargers (3.0\,\text{m}).

8.6 Multi-Robot Collision Avoidance & Deadlock Management

  • Footprint-Aware Spatial Clearance: TimeSpaceReservationGrid checks distance between concurrently reserved waypoints: \text{dist}(P_a, P_b) \ge 2 \times R_{\text{footprint}}
  • Time-Space Edge Reservations: Enforces headway buffers (1.0\,\text{s} safety buffer) and prevents opposite-direction traversal of single-lane corridors.
  • Deadlock Cycle Resolution (warehouse_twin/routing/deadlock_manager.py):
    • Directed wait-for dependency graph.
    • Cycle detection using NetworkX: detects circular wait dependencies (A \rightarrow B \rightarrow A).
    • Resolves circular wait immediately by commanding the deterministic victim robot to replan around the contested edge.
    • Tracks prolonged waits exceeding the deadlock timeout (30.0\,\text{s}).

8.7 OpenUSD Scene Integration

  • Synchronized OpenUSD stage export referencing verified 3D assets.
  • Dedicated def Scope "PickingPoints" containing /World/Warehouse/PickingPoints/{loc_id}_Front with visual ApproachMarker indicators and shelf metadata.
  • Generated scenes:
    • Static: omniverse/scenes/warehouse_realistic.usda
    • Animated: omniverse/scenes/warehouse_realistic_animated.usda