File size: 5,973 Bytes
f23abff
 
74a7155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f23abff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74a7155
f23abff
74a7155
 
 
f23abff
74a7155
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# AGENTS.md

## HDR background retention

HDR environment maps are retained for benchmark runtime generalization even when
no current task or USD statically references them. Do not prune `.hdr` maps under
`background/` based only on dependency reachability. Preserve EXR environment maps
as well. Keep scene-embedded map paths so DomeLight directory sampling still
works. This exception does not restore excluded robots, external packages, or
unused scene USDs.

## Data collection example retention

Data collection examples and replay presets are release roots alongside
benchmark tasks. Retain their complete candidate asset catalogs, metadata,
USD-attached behavior scripts, canonical interaction/grasp data, and configured
HDR background entry layers. Follow recursive USD, material, texture, and script
references before pruning. An asset need not occur in a sampled benchmark scene
to be required by an example task or its other scene instances.

## Engine pipeline retention

`genie_sim_engine_*` bringup scenes are release roots alongside benchmark tasks
and data collection examples. Preserve these configured entry assets and their
complete recursive USD, material, texture, mesh, and attached-script dependencies:

- `scenes/GDK/demo.usda` for pick-and-place and whole-body-control scenes.
- `scenes/blank/blank_cloth.usda` and `scenes/blank/T_Shirt_fold.usd` for the
  Swiftpicker shirt scene.
- `background/home/fried_noodles/background.usda` for the Wuji chef scenes.
- `robot/G2_crsB_wuji/robot.usda` for the chef evaluation visual robot.

The cloth scene references the retained local gridroom at
`background/common/environments/gridroom_black/gridroom_black.usd`, including its
`Materials/Textures` maps. Keep that relative reference local and portable.
Do not replace a missing configured world with a generated flat scene or prune
these dependencies merely because benchmark tasks do not reference them.

## Runtime assembly cache

Engine-generated assemblies belong in `scenes/<scene_stem>/`, including
`manifest.json`, robot USD/URDF, render layers, and payloads. Keep this complete
cache together; manifest paths and generated USD references must resolve after
moving it. Generated `scene_*` directories are ignored by `scenes/.gitignore`.
Retained authored entry assets such as `scenes/GDK/` and `scenes/blank/` remain
tracked; categorized backgrounds and shared assets stay under `background/`.

## Build, Lint, and Test Commands

### Running Tests
```bash
# No explicit test framework found - the project consists mainly of asset configuration files.
```

### Code Style and Conventions

### Python Code Style
- **Formatting**: Use standard PEP 8 style with 4-space indentation
- **Naming Conventions**:
  - `ITEM` dictionary for object metadata (lowercase with underscores)
  - `find_all_items()` and `extract_item_dict()` for function names (snake_case)
  - `usda_path`, `desc_path`, `combined_dict` for variable names (snake_case)
  - `ASSETS_PATH`, `CHROMA_DB_PATH`, `ASSETS_INDEX` for constants (uppercase_with_underscores)
- **Data Structure Style**:
  - Use dictionary definitions with `ITEM = { ... }` format in `item.py` files
  - Keep dictionaries nested with clear keys for objects, shapes, properties
  - Use list format `["name", "position", "quaternion", "scale", "size", "type"]` consistently
  - Include `description` key as empty dict `{}` when no description present
  
### Python Imports
- Import standard library modules at top of file: `os`, `ast`, `hashlib`
- Import pathlib for path operations: `from pathlib import Path`
- Use absolute imports for core functions
- No external library imports in asset files (only dictionaries)

### File Organization
- Asset files: `objects/{category}/{category}_{id}/{id}/item.py`
- Background files: `background/common/{category}/{category}_{id}/item.py`
- Keep `.usda`, `.usd`, `.json`, and texture files in same directory as corresponding item
- Organize by object category with unique identifiers

### Code Organization Principles
```python
# Dictionary-based configuration files
ITEM = {
    "description": {},                # Optional description dict
    "id": "{object_id}",              # Unique identifier
    "shapes": [                       # List of mesh definitions
        {
            "name": "{shape_name}",    # e.g., "bbox", "origin"
            "position": [x, y, z],     # Float position coordinates
            "quaternion": [w, x, y, z],# Quaternion for rotation
            "scale": [x, y, z],       # Scale multipliers
            "size": [x, y, z],        # Physical dimensions
            "type": "{geometry_type}", # e.g., "cube", "sphere"
        }
    ],
    "size": [],                       # Additional size specification
    "url": "path/to/object.usda"      # Path to USD file
}
```

### Error Handling
- Use try-except for file reading operations
- Print informational messages for warnings and errors
- Skip files with errors instead of raising exceptions
- Provide meaningful error messages with file paths

### Type Hints
- Use standard Python types in function signatures
- Path objects with `Path` type hint
- Dictionary types with `dict` hint
- List types with `list` hint
- Number types with `float` or use `number` from typing

### Documentation
- Document complex functions with docstrings
- Use descriptive comments for special cases
- Add error messages inline for critical operations
- Include WARN and ERROR prefixes for important messages

### Asset Tools (Scripts)

The `tools/` directory retains only `.gitignore` and these two standalone scripts:

- `tools/generate_recorder_usda.py`: generate recorder stages and cameras for assets.
- `tools/generate_object_snapshots_and_video.py`: render snapshots and preview videos
  from recorder stages using an Isaac Sim runtime.

Run them from a prepared runtime with `geniesim_assets` installed. The rendering
script starts Isaac Sim; do not import it for a metadata or syntax-only check.