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
|
Constant reward for every step, unconditional as in the legacy tasks. |
|
Penalize root roll/pitch angular velocity independently from yaw tracking. |
|
Penalize world-frame root height error for the flat-ground pilot. |
|
Penalize selected joint displacement from the default pose with an L1 kernel. |
|
Penalize vertical root velocity independently from planar tracking. |
|
Penalize selected joint deviation only below the commanded-motion threshold. |
|
Track commanded yaw velocity without folding roll/pitch into the kernel. |
|
Track commanded planar velocity with the legacy independent exponential kernel. |
Classes
Cold-path named-sensor binding shared by locomotion manager terms. |
|
Count feet without contact while the configured velocity command is standing. |
|
Reward foot contact matching the configured stance portion of gait phase. |
|
Reward foot height near a target during the configured swing phase. |
|
Four-foot phase observation with the legacy diagonal-trot ordering. |
- class unilab.tasks.locomotion.common.manager_terms.SensorTermBase[source]¶
Bases:
ManagerTermBaseCold-path named-sensor binding shared by locomotion manager terms.
- 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:
- 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:
- 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.
- class unilab.tasks.locomotion.common.manager_terms.feet_air_while_standing[source]¶
Bases:
ManagerTermBaseCount feet without contact while the configured velocity command is standing.
- Parameters:
cfg (
ManagerTermBaseCfg)env (
ManagerBasedRlEnv)
- class unilab.tasks.locomotion.common.manager_terms.feet_phase_contact[source]¶
Bases:
_FootSensorTermReward foot contact matching the configured stance portion of gait phase.
- Parameters:
cfg (
ManagerTermBaseCfg)env (
_GaitEnv)
- class unilab.tasks.locomotion.common.manager_terms.feet_phase_swing_height[source]¶
Bases:
_FootSensorTermReward foot height near a target during the configured swing phase.
- 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:
- 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:
- class unilab.tasks.locomotion.common.manager_terms.quadruped_gait_phase[source]¶
Bases:
_GaitTermFour-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.
- 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.
- 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.