unilab.tasks.locomotion.common.manager_terms

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

The equations come from UniLab’s quadruped joystick tasks and are reused by quadruped and biped owners alike. The adaptation uses community func + params terms, Torch state carriers, and packed named-sensor reads. 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.

require_command(env, term, command_name)

require_real(term, name, value, *[, ...])

Classes

SensorTermBase

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

base_height_l2

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

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.

joint_deviation_l1

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

quadruped_gait_phase

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

stand_still_l1

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

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)

property tensor_sensor_names: tuple[str, ...]
__init__(cfg, env)[source]
Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

reset(env_ids)[source]

Row boundary for stateless sensor terms.

Parameters:

env_ids (Tensor)

Return type:

None

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:

Tensor

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

Bases: ManagerTermBase

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

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

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

  • env (ManagerBasedRlEnv)

property tensor_body_names: tuple[str, ...]
property entity_name: str
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)

property tensor_sensor_names: tuple[str, ...]
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)

property tensor_sensor_names: tuple[str, ...]
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)

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

Bases: ManagerTermBase

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

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

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

  • env (ManagerBasedRlEnv)

property tensor_state_entity: str
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)

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

Bases: joint_deviation_l1

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

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

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

  • env (ManagerBasedRlEnv)