unilab.tasks.locomotion.common.rough_manager_terms¶
Manager-Based terrain terms shared by the production rough quadrupeds.
Functions
|
Squared deviation of selected joints from the keyframe default. |
Classes
Shared seven-terrain production generator for Go1, Go2, and Go2W. |
|
Strict cached yaw-aligned height scan in the legacy critic format. |
|
Joint-position action with legacy raw-action clipping. |
|
Settle completed episodes before the following terrain reset selects a cell. |
|
Cached terrain-footprint truncation term. |
|
Stage a terrain-aware randomized root state in the reset transaction. |
|
Rough-task velocity command with a planar-norm dead zone. |
- class unilab.tasks.locomotion.common.rough_manager_terms.QuadrupedRoughTerrainCfg[source]¶
Bases:
TerrainGeneratorCfgShared seven-terrain production generator for Go1, Go2, and Go2W.
- Parameters:
-
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.
-
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_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.
-
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.
-
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)¶
- class unilab.tasks.locomotion.common.rough_manager_terms.RoughHeightScan[source]¶
Bases:
ManagerTermBaseStrict cached yaw-aligned height scan in the legacy critic format.
- Parameters:
cfg (
ManagerTermBaseCfg)env (
ManagerBasedRlEnv)
- __init__(cfg, env)[source]¶
- Parameters:
cfg (
ManagerTermBaseCfg)env (
ManagerBasedRlEnv)
- class unilab.tasks.locomotion.common.rough_manager_terms.RoughJointPositionAction[source]¶
Bases:
JointPositionAction- Parameters:
env (
ManagerBasedRlEnv)
- cfg: RoughJointPositionActionCfg¶
- class unilab.tasks.locomotion.common.rough_manager_terms.RoughJointPositionActionCfg[source]¶
Bases:
JointPositionActionCfgJoint-position action with legacy raw-action clipping.
- Parameters:
- build(env)[source]¶
Build the action term from this config.
- Parameters:
env (
ManagerBasedRlEnv)- Return type:
- __init__(*, entity_name, clip=None, actuator_names, scale=1.0, offset=0.0, preserve_order=False, use_default_offset=True, clip_actions=100.0)¶
- class unilab.tasks.locomotion.common.rough_manager_terms.RoughTerrainCurriculum[source]¶
Bases:
ManagerTermBaseSettle completed episodes before the following terrain reset selects a cell.
- Parameters:
cfg (
ManagerTermBaseCfg)env (
ManagerBasedRlEnv)
- __init__(cfg, env)[source]¶
- Parameters:
cfg (
ManagerTermBaseCfg)env (
ManagerBasedRlEnv)
- class unilab.tasks.locomotion.common.rough_manager_terms.RoughTerrainOutOfBounds[source]¶
Bases:
ManagerTermBaseCached terrain-footprint truncation term.
- Parameters:
cfg (
ManagerTermBaseCfg)env (
ManagerBasedRlEnv)
- __init__(cfg, env)[source]¶
- Parameters:
cfg (
ManagerTermBaseCfg)env (
ManagerBasedRlEnv)
- class unilab.tasks.locomotion.common.rough_manager_terms.RoughTerrainReset[source]¶
Bases:
ManagerTermBaseStage a terrain-aware randomized root state in the reset transaction.
- Parameters:
cfg (
ManagerTermBaseCfg)env (
ManagerBasedRlEnv)
- __init__(cfg, env)[source]¶
- Parameters:
cfg (
ManagerTermBaseCfg)env (
ManagerBasedRlEnv)
- property spawn_manager: TerrainSpawnManager¶
- class unilab.tasks.locomotion.common.rough_manager_terms.RoughVelocityCommand[source]¶
Bases:
UniformVelocityCommand- Parameters:
cfg (
RoughVelocityCommandCfg)env (
ManagerBasedRlEnv)
- __init__(cfg, env)[source]¶
- Parameters:
cfg (
RoughVelocityCommandCfg)env (
ManagerBasedRlEnv)
- class unilab.tasks.locomotion.common.rough_manager_terms.RoughVelocityCommandCfg[source]¶
Bases:
UniformVelocityCommandCfgRough-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:
- __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: