unilab.envs.locomotion.go2.rough.Go2RoughTerrainCfg¶
- class unilab.envs.locomotion.go2.rough.Go2RoughTerrainCfg[source]¶
Bases:
TerrainGeneratorCfgGo2RoughTerrainCfg(*, seed: ‘int | None’ = None, curriculum: ‘bool’ = False, size: ‘tuple[float, float]’ = (8.0, 8.0), horizontal_scale: ‘float’ = 0.2, vertical_scale: ‘float’ = 0.005, border_width: ‘float’ = 1.0, num_rows: ‘int’ = 6, num_cols: ‘int’ = 6, sub_terrains: ‘dict[str, SubTerrainCfg]’ = <factory>, difficulty_range: ‘tuple[float, float]’ = (0.0, 1.0), add_lights: ‘bool’ = True)
- Parameters:
Methods
__init__(*[, seed, curriculum, size, ...])Attributes
If True, adds a directional light above the terrain grid.
Width of the flat border around the entire terrain grid, in meters.
Controls terrain allocation mode:
Min and max difficulty values used when generating sub-terrains.
Heightfield grid resolution along x and y, in meters per cell.
Number of sub-terrain columns in the grid.
Number of sub-terrain rows in the grid.
Random seed for terrain generation.
Width and length of each sub-terrain patch, in meters.
Heightfield height resolution, in meters per integer unit of the noise array.
Named sub-terrain configurations to populate the grid.
-
size:
tuple[float,float] = (8.0, 8.0)¶ Width and length of each sub-terrain patch, in meters. Both components must be integer multiples of
horizontal_scale.
-
num_rows:
int= 6¶ Number of sub-terrain rows in the grid. Represents difficulty levels in curriculum mode. Note: Environments are randomly assigned to rows, so multiple envs can share the same patch.
-
num_cols:
int= 6¶ Number of sub-terrain columns in the grid.
In curriculum mode the generator ignores this value and uses one column per terrain type (
len(sub_terrains)). In random mode it is used as-is.
-
border_width:
float= 1.0¶ Width of the flat border around the entire terrain grid, in meters. Must be an integer multiple of
horizontal_scaleif non-zero. The border is a flat hfield slab whose top surface is flush with the inner-terrain floor at z=0; it is NOT a wall.
-
horizontal_scale:
float= 0.2¶ Heightfield grid resolution along x and y, in meters per cell. Shared by every sub-terrain (overwritten in
TerrainGenerator__init__). All length-like sub-terrain parameters (step_width, platform_width, border_width, etc.) must be integer multiples of this value.
-
sub_terrains:
dict[str,SubTerrainCfg]¶ Named sub-terrain configurations to populate the grid.
- __init__(*, seed=None, curriculum=False, size=(8.0, 8.0), horizontal_scale=0.2, vertical_scale=0.005, border_width=1.0, num_rows=6, num_cols=6, sub_terrains=<factory>, difficulty_range=(0.0, 1.0), add_lights=True)¶
-
curriculum:
bool= False¶ Controls terrain allocation mode:
- curriculum=True: Each terrain type gets exactly ONE column. The generator uses
len(sub_terrains)columns regardless ofnum_cols. Difficulty increases along rows. Theproportionfield controls how many robots are spawned per column, not column count.
- curriculum=False: Every patch is randomly sampled from all terrain types.
Proportions control sampling probability. Use this for random variety.