unilab.tasks.locomotion.common.manager_terms

Shared Manager-Based terms and term bases for the locomotion families.

The equations come from UniLab’s existing Go1/Go2 joystick tasks and are reused by quadruped and biped owners alike. The adaptation uses community func + params terms, NumPy, and the base-owned sensor facade. Reward terms that read named XML sensors live in sensor_reward_terms.py and build on the SensorTermBase cold-path binding contract defined here.

Functions

alive(env)

Constant reward for every step, unconditional as in the legacy tasks.

ang_vel_xy_l2(env[, asset_cfg])

Penalize root roll/pitch angular velocity independently from yaw tracking.

base_height_l2(env, target_height[, asset_cfg])

Penalize world-frame root height error for the flat-ground pilot.

joint_deviation_l1(env[, asset_cfg])

Penalize selected joint displacement from the default pose with an L1 kernel.

lin_vel_z_l2(env[, asset_cfg])

Penalize vertical root velocity independently from planar tracking.

stand_still_l1(env, command_name[, ...])

Penalize selected joint deviation only below the commanded-motion threshold.

track_ang_vel_z_exp(env, std, command_name)

Track commanded yaw velocity without folding roll/pitch into the kernel.

track_lin_vel_xy_exp(env, std, command_name)

Track commanded planar velocity with the legacy independent exponential kernel.

Classes

SensorTermBase

Cold-path named-sensor binding shared by locomotion manager terms.

feet_air_while_standing

Count feet without contact while the configured velocity command is standing.

feet_phase_contact

Reward foot contact matching the configured stance portion of gait phase.

feet_phase_swing_height

Reward foot height near a target during the configured swing phase.

quadruped_gait_phase

Four-foot phase observation with the legacy diagonal-trot ordering.

class unilab.tasks.locomotion.common.manager_terms.SensorTermBase[source]

Bases: ManagerTermBase

Cold-path named-sensor binding shared by locomotion manager terms.

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

__init__(cfg, env)[source]
Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

unilab.tasks.locomotion.common.manager_terms.alive(env)[source]

Constant reward for every step, unconditional as in the legacy tasks.

Parameters:

env (ManagerBasedRlEnv)

Return type:

ndarray

unilab.tasks.locomotion.common.manager_terms.ang_vel_xy_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]

Penalize root roll/pitch angular velocity independently from yaw tracking.

Parameters:
  • env (ManagerBasedRlEnv)

  • asset_cfg (SceneEntityCfg)

Return type:

ndarray

unilab.tasks.locomotion.common.manager_terms.base_height_l2(env, target_height, 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]

Penalize world-frame root height error for the flat-ground pilot.

Parameters:
  • env (ManagerBasedRlEnv)

  • target_height (float)

  • asset_cfg (SceneEntityCfg)

Return type:

ndarray

class unilab.tasks.locomotion.common.manager_terms.feet_air_while_standing[source]

Bases: ManagerTermBase

Count feet without contact while the configured velocity command is standing.

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

__init__(cfg, env)[source]
Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

class unilab.tasks.locomotion.common.manager_terms.feet_phase_contact[source]

Bases: _FootSensorTerm

Reward foot contact matching the configured stance portion of gait phase.

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (_GaitEnv)

__init__(cfg, env)[source]
Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (_GaitEnv)

class unilab.tasks.locomotion.common.manager_terms.feet_phase_swing_height[source]

Bases: _FootSensorTerm

Reward foot height near a target during the configured swing phase.

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (_GaitEnv)

__init__(cfg, env)[source]
Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (_GaitEnv)

unilab.tasks.locomotion.common.manager_terms.joint_deviation_l1(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]

Penalize selected joint displacement from the default pose with an L1 kernel.

Parameters:
  • env (ManagerBasedRlEnv)

  • asset_cfg (SceneEntityCfg)

Return type:

ndarray

unilab.tasks.locomotion.common.manager_terms.lin_vel_z_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]

Penalize vertical root velocity independently from planar tracking.

Parameters:
  • env (ManagerBasedRlEnv)

  • asset_cfg (SceneEntityCfg)

Return type:

ndarray

class unilab.tasks.locomotion.common.manager_terms.quadruped_gait_phase[source]

Bases: _GaitTerm

Four-foot phase observation with the legacy diagonal-trot ordering.

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (_GaitEnv)

unilab.tasks.locomotion.common.manager_terms.stand_still_l1(env, command_name, command_threshold=0.1, 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]

Penalize selected joint deviation only below the commanded-motion threshold.

Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

  • command_threshold (float)

  • asset_cfg (SceneEntityCfg)

Return type:

ndarray

unilab.tasks.locomotion.common.manager_terms.track_ang_vel_z_exp(env, std, command_name, 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]

Track commanded yaw velocity without folding roll/pitch into the kernel.

Parameters:
  • env (ManagerBasedRlEnv)

  • std (float)

  • command_name (str)

  • asset_cfg (SceneEntityCfg)

Return type:

ndarray

unilab.tasks.locomotion.common.manager_terms.track_lin_vel_xy_exp(env, std, command_name, 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]

Track commanded planar velocity with the legacy independent exponential kernel.

Parameters:
  • env (ManagerBasedRlEnv)

  • std (float)

  • command_name (str)

  • asset_cfg (SceneEntityCfg)

Return type:

ndarray