Extending UniLab: New Terrain¶
Terrain generation is a cold-path scene feature. Keep generation and asset
materialization out of step(), reset(), and hot domain-randomization loops.
Implementation Checklist¶
Add a
SubTerrainCfgimplementation insrc/unilab/terrains/heightfield_terrains.pyif the terrain needs new heightfield geometry.Add a preset in
src/unilab/terrains/config.pywith@terrain_presetif the terrain should be selectable by name.Wire terrain into a
TerrainGeneratorCfg, either through an existing named set such asROUGH_TERRAINS_CFGor through an owner YAML undersrc/unilab/conf/.Expose terrain to scenes through
SceneCfg.terrainandTerrainSceneCfginsrc/unilab/base/scene.py.If an env needs height observations, create the backend scanner on init via
bind_height_scanner(...); read samples through the returnedHeightScanner.Keep terrain spawn, curriculum, and observation dimensions reflected in the owning env config and
obs_groups_spec.
Validation Near Risk¶
Terrain generator shape and numerical behavior:
tests/terrains/test_terrain_generator.pyBackend terrain materialization contract:
tests/base/test_backend_conformance.pyBackend materialization boundaries:
tests/utils/test_xml_utils.py
Evidence In Repo¶
Terrain configs and presets:
src/unilab/terrains/config.pyTerrain generator:
unisim.terrain.generatorHeightfield terrain types:
src/unilab/terrains/heightfield_terrains.py