unilab.terrains.terrain_generator.TerrainGenerator

class unilab.terrains.terrain_generator.TerrainGenerator[source]

Bases: object

Generates procedural terrain grids with configurable difficulty.

Creates a grid of terrain patches where each patch can be a different terrain type. Supports two modes:

  • Random mode (curriculum=False): Every patch independently samples a

    terrain type weighted by proportions. Results in random variety across all patches.

  • Curriculum mode (curriculum=True): Each terrain type gets exactly one column

    (the generator uses len(sub_terrains) columns regardless of num_cols). Difficulty increases along rows. The proportion field controls robot spawning distribution, not column count.

Terrain types are weighted by proportion and their geometry is generated based on a difficulty value in the configured range. The grid is centered at the world origin. A border can be added around the entire grid along with optional overhead lighting.

Parameters:

Methods

__init__(cfg[, device])

generate()

Generate the full terrain as one backend-agnostic merged hfield.

write_png(path)

__init__(cfg, device='cpu')[source]
Parameters:
generate()[source]

Generate the full terrain as one backend-agnostic merged hfield.

Return type:

GeneratedTerrain

write_png(path)[source]
Parameters:

path (Path)

Return type:

GeneratedTerrain