unilab.tasks.locomotion.common.rough_manager_terms

Manager-Based terrain terms shared by the production rough quadrupeds.

Functions

joint_deviation_l2(env[, asset_cfg])

Squared deviation of selected joints from the keyframe default.

Classes

QuadrupedRoughTerrainCfg

Shared seven-terrain production generator for Go1, Go2, and Go2W.

RoughHeightScan

Strict cached yaw-aligned height scan in the legacy critic format.

RoughJointPositionAction

RoughJointPositionActionCfg

Joint-position action with legacy raw-action clipping.

RoughTerrainCurriculum

Settle completed episodes before the following terrain reset selects a cell.

RoughTerrainOutOfBounds

Cached terrain-footprint truncation term.

RoughTerrainReset

Stage a terrain-aware randomized root state in the reset transaction.

RoughVelocityCommand

RoughVelocityCommandCfg

Rough-task velocity command with a planar-norm dead zone.

class unilab.tasks.locomotion.common.rough_manager_terms.QuadrupedRoughTerrainCfg[source]

Bases: TerrainGeneratorCfg

Shared seven-terrain production generator for Go1, Go2, and Go2W.

Parameters:
seed: int | None = 42

Random seed for terrain generation. None uses a random seed.

curriculum: bool = False

Controls terrain allocation 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 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.

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.

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.

vertical_scale: float = 0.005

Heightfield height resolution, in meters per integer unit of the noise array. Shared by every sub-terrain (overwritten in TerrainGenerator __init__).

border_width: float = 20.0

Width of the flat border around the entire terrain grid, in meters. Must be an integer multiple of horizontal_scale if 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.

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.

add_lights: bool = True

If True, adds a directional light above the terrain grid.

sub_terrains: dict[str, SubTerrainCfg]

Named sub-terrain configurations to populate the grid.

__init__(*, seed=42, curriculum=False, size=(8.0, 8.0), horizontal_scale=0.2, vertical_scale=0.005, border_width=20.0, num_rows=6, num_cols=6, sub_terrains=<factory>, difficulty_range=(0.0, 1.0), add_lights=True)
Parameters:
class unilab.tasks.locomotion.common.rough_manager_terms.RoughHeightScan[source]

Bases: ManagerTermBase

Strict cached yaw-aligned height scan in the legacy critic format.

Parameters:
__init__(cfg, env)[source]
Parameters:
class unilab.tasks.locomotion.common.rough_manager_terms.RoughJointPositionAction[source]

Bases: JointPositionAction

Parameters:
cfg: RoughJointPositionActionCfg
__init__(cfg, env)[source]
Parameters:
process_actions(actions)[source]
Parameters:

actions (ndarray)

Return type:

None

class unilab.tasks.locomotion.common.rough_manager_terms.RoughJointPositionActionCfg[source]

Bases: JointPositionActionCfg

Joint-position action with legacy raw-action clipping.

Parameters:
clip_actions: float = 100.0
build(env)[source]

Build the action term from this config.

Parameters:

env (ManagerBasedRlEnv)

Return type:

RoughJointPositionAction

__init__(*, entity_name, clip=None, actuator_names, scale=1.0, offset=0.0, preserve_order=False, use_default_offset=True, clip_actions=100.0)
Parameters:
class unilab.tasks.locomotion.common.rough_manager_terms.RoughTerrainCurriculum[source]

Bases: ManagerTermBase

Settle completed episodes before the following terrain reset selects a cell.

Parameters:
__init__(cfg, env)[source]
Parameters:
class unilab.tasks.locomotion.common.rough_manager_terms.RoughTerrainOutOfBounds[source]

Bases: ManagerTermBase

Cached terrain-footprint truncation term.

Parameters:
__init__(cfg, env)[source]
Parameters:
class unilab.tasks.locomotion.common.rough_manager_terms.RoughTerrainReset[source]

Bases: ManagerTermBase

Stage a terrain-aware randomized root state in the reset transaction.

Parameters:
__init__(cfg, env)[source]
Parameters:
property spawn_manager: TerrainSpawnManager
class unilab.tasks.locomotion.common.rough_manager_terms.RoughVelocityCommand[source]

Bases: UniformVelocityCommand

Parameters:
cfg: RoughVelocityCommandCfg
__init__(cfg, env)[source]
Parameters:
class unilab.tasks.locomotion.common.rough_manager_terms.RoughVelocityCommandCfg[source]

Bases: UniformVelocityCommandCfg

Rough-task velocity command with a planar-norm dead zone.

Parameters:
  • resampling_time_range (tuple[float, float])

  • debug_vis (bool)

  • entity_name (str)

  • heading_command (bool)

  • heading_control_stiffness (float)

  • rel_standing_envs (float)

  • rel_heading_envs (float)

  • rel_world_envs (float)

  • rel_forward_envs (float)

  • init_velocity_prob (float)

  • ranges (Ranges)

  • viz (VizCfg)

  • planar_dead_zone (float)

planar_dead_zone: float = 0.08
build(env)[source]

Build the command term from this config.

Parameters:

env (ManagerBasedRlEnv)

Return type:

RoughVelocityCommand

__init__(*, resampling_time_range, debug_vis=False, entity_name, heading_command=False, heading_control_stiffness=1.0, rel_standing_envs=0.0, rel_heading_envs=1.0, rel_world_envs=0.0, rel_forward_envs=0.0, init_velocity_prob=0.0, ranges, viz=<factory>, planar_dead_zone=0.08)
Parameters:
  • resampling_time_range (tuple[float, float])

  • debug_vis (bool)

  • entity_name (str)

  • heading_command (bool)

  • heading_control_stiffness (float)

  • rel_standing_envs (float)

  • rel_heading_envs (float)

  • rel_world_envs (float)

  • rel_forward_envs (float)

  • init_velocity_prob (float)

  • ranges (Ranges)

  • viz (VizCfg)

  • planar_dead_zone (float)

unilab.tasks.locomotion.common.rough_manager_terms.joint_deviation_l2(env, asset_cfg=SceneEntityCfg(name='robot', joint_names=None, joint_ids=slice(None, None, None), body_names=None, body_ids=slice(None, None, None), geom_names=None, geom_ids=slice(None, None, None), site_names=None, site_ids=slice(None, None, None), actuator_names=None, actuator_ids=slice(None, None, None), tendon_names=None, tendon_ids=slice(None, None, None), camera_names=None, camera_ids=slice(None, None, None), light_names=None, light_ids=slice(None, None, None), material_names=None, material_ids=slice(None, None, None), texture_names=None, texture_ids=slice(None, None, None), pair_names=None, pair_ids=slice(None, None, None), preserve_order=False))[source]

Squared deviation of selected joints from the keyframe default.

Parameters:
  • env (ManagerBasedRlEnv)

  • asset_cfg (SceneEntityCfg)

Return type:

ndarray