unilab.tasks.motion_tracking.common.manager_terms

Manager-native NumPy terms for motion tracking.

Functions

bad_anchor_ori(env, command_name, threshold)

joint_pos_limits(env[, asset_cfg])

Penalize selected joint-limit violations through the entity facade.

motion_anchor_ori_b(env, command_name)

motion_anchor_pos_b(env, command_name)

motion_clip_end(env, command_name)

motion_global_anchor_orientation_error_exp(...)

motion_global_anchor_position_error_exp(env, ...)

motion_joint_pos_rel(env, command_name)

motion_joint_pos_rel_biased(env, command_name)

Joint position relative to the episode default, including encoder bias.

motion_joint_position_error_exp(env, ...)

motion_joint_velocity_error_exp(env, ...)

robot_body_ori_b(env, command_name)

robot_body_pos_b(env, command_name)

Classes

MotionCommand

Motion reference command on UniLab's NumPy/entity runtime.

MotionCommandCfg

Community-shaped motion command with Hydra-owned nested parameters.

MotionCommandParamsCfg

Hydra-owned motion data and sampling parameters.

MotionJointPositionAction

MotionJointPositionActionCfg

MotionJointPositionActionCfg(*, entity_name: 'str', clip: 'dict[str, tuple] | None' = None, actuator_names: 'tuple[str, ...] | list[str]', scale: 'float | dict[str, float]' = 1.0, offset: 'float | dict[str, float]' = 0.0, preserve_order: 'bool' = False, use_default_offset: 'bool' = True, command_name: 'str' = 'motion', simulate_action_latency: 'bool' = False)

bad_anchor_pos_z_only

Anchor-height termination backed by a parallel, pre-warmed Numba kernel.

bad_motion_body_pos_z_only

bad_undesired_body_contacts

motion_global_body_angular_velocity_error_exp

motion_global_body_linear_velocity_error_exp

motion_relative_body_orientation_error_exp

motion_relative_body_position_error_exp

motion_relative_body_position_z_error_exp

undesired_body_contacts

class unilab.tasks.motion_tracking.common.manager_terms.MotionCommand[source]

Bases: CommandTerm

Motion reference command on UniLab’s NumPy/entity runtime.

Parameters:
cfg: MotionCommandCfg
__init__(cfg, env)[source]
Parameters:
property command: ndarray
property joint_pos: ndarray
property joint_vel: ndarray
property body_pos_w: ndarray
property body_quat_w: ndarray
property body_lin_vel_w: ndarray
property body_ang_vel_w: ndarray
property anchor_pos_w: ndarray
property anchor_quat_w: ndarray
property anchor_lin_vel_w: ndarray
property anchor_ang_vel_w: ndarray
property robot_joint_pos: ndarray
property robot_joint_vel: ndarray
property robot_body_pos_w: ndarray
property robot_body_quat_w: ndarray
property robot_body_lin_vel_w: ndarray
property robot_body_ang_vel_w: ndarray
property robot_anchor_pos_w: ndarray
property robot_anchor_quat_w: ndarray
property robot_anchor_lin_vel_w: ndarray
property robot_anchor_ang_vel_w: ndarray
reset(env_ids)[source]

Resets the manager term.

Parameters:

env_ids (ndarray | slice | None)

Return type:

dict[str, float]

post_compute()[source]

Refresh state that depends on committed command-side simulation writes.

Return type:

None

class unilab.tasks.motion_tracking.common.manager_terms.MotionCommandCfg[source]

Bases: CommandTermCfg

Community-shaped motion command with Hydra-owned nested parameters.

Parameters:
entity_name: str
params: MotionCommandParamsCfg
build(env)[source]

Build the command term from this config.

Parameters:

env (ManagerBasedRlEnv)

Return type:

MotionCommand

property motion_file: str | list[str]
property anchor_body_name: str
property body_names: tuple[str, ...]
property sampling_mode: Literal['start', 'clip_start', 'uniform', 'adaptive', 'mixed']
__init__(*, resampling_time_range, debug_vis=False, entity_name, params)
Parameters:
class unilab.tasks.motion_tracking.common.manager_terms.MotionCommandParamsCfg[source]

Bases: object

Hydra-owned motion data and sampling parameters.

Parameters:
motion_file: str | list[str]
anchor_body_name: str
body_names: tuple[str, ...] | list[str]
sampling_mode: Literal['start', 'clip_start', 'uniform', 'adaptive', 'mixed'] = 'adaptive'
sampling_start_ratio: float = 0.0
truncate_on_clip_end: bool = False
pose_range: dict[str, tuple[float, float]]
velocity_range: dict[str, tuple[float, float]]
joint_position_range: tuple[float, float] = (-0.1, 0.1)
joint_default_position_range: tuple[float, float] = (0.0, 0.0)
adaptive_lambda: float = 0.8
adaptive_kernel_size: int = 1
adaptive_uniform_ratio: float = 0.1
adaptive_alpha: float = 0.001
__init__(motion_file, anchor_body_name, body_names, sampling_mode='adaptive', sampling_start_ratio=0.0, truncate_on_clip_end=False, pose_range=<factory>, velocity_range=<factory>, joint_position_range=(-0.1, 0.1), joint_default_position_range=(0.0, 0.0), adaptive_lambda=0.8, adaptive_kernel_size=1, adaptive_uniform_ratio=0.1, adaptive_alpha=0.001)
Parameters:
class unilab.tasks.motion_tracking.common.manager_terms.MotionJointPositionAction[source]

Bases: JointPositionAction

Parameters:
cfg: MotionJointPositionActionCfg
__init__(cfg, env)[source]
Parameters:
property target: ndarray

Most recently applied physical joint target in entity joint order.

process_actions(actions)[source]
Parameters:

actions (ndarray)

Return type:

None

reset(env_ids=None)[source]

Resets the manager term.

Parameters:

env_ids (ndarray | slice | None)

Return type:

None

apply_actions()[source]
Return type:

None

class unilab.tasks.motion_tracking.common.manager_terms.MotionJointPositionActionCfg[source]

Bases: JointPositionActionCfg

MotionJointPositionActionCfg(*, entity_name: ‘str’, clip: ‘dict[str, tuple] | None’ = None, actuator_names: ‘tuple[str, …] | list[str]’, scale: ‘float | dict[str, float]’ = 1.0, offset: ‘float | dict[str, float]’ = 0.0, preserve_order: ‘bool’ = False, use_default_offset: ‘bool’ = True, command_name: ‘str’ = ‘motion’, simulate_action_latency: ‘bool’ = False)

Parameters:
command_name: str = 'motion'
simulate_action_latency: bool = False
build(env)[source]

Build the action term from this config.

Parameters:

env (ManagerBasedRlEnv)

Return type:

MotionJointPositionAction

__init__(*, entity_name, clip=None, actuator_names, scale=1.0, offset=0.0, preserve_order=False, use_default_offset=True, command_name='motion', simulate_action_latency=False)
Parameters:
unilab.tasks.motion_tracking.common.manager_terms.bad_anchor_ori(env, command_name, threshold, asset_cfg=None)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

  • threshold (float)

  • asset_cfg (SceneEntityCfg | None)

Return type:

ndarray

class unilab.tasks.motion_tracking.common.manager_terms.bad_anchor_pos_z_only[source]

Bases: ManagerTermBase

Anchor-height termination backed by a parallel, pre-warmed Numba kernel.

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

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

  • env (ManagerBasedRlEnv)

class unilab.tasks.motion_tracking.common.manager_terms.bad_motion_body_pos_z_only[source]

Bases: _BodyTerm

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

class unilab.tasks.motion_tracking.common.manager_terms.bad_undesired_body_contacts[source]

Bases: _BodyTerm

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

unilab.tasks.motion_tracking.common.manager_terms.joint_pos_limits(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-limit violations through the entity facade.

Parameters:
  • env (ManagerBasedRlEnv)

  • asset_cfg (SceneEntityCfg)

Return type:

ndarray

unilab.tasks.motion_tracking.common.manager_terms.motion_anchor_ori_b(env, command_name)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

Return type:

ndarray

unilab.tasks.motion_tracking.common.manager_terms.motion_anchor_pos_b(env, command_name)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

Return type:

ndarray

unilab.tasks.motion_tracking.common.manager_terms.motion_clip_end(env, command_name)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

Return type:

ndarray

unilab.tasks.motion_tracking.common.manager_terms.motion_global_anchor_orientation_error_exp(env, command_name, std)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

  • std (float)

Return type:

ndarray

unilab.tasks.motion_tracking.common.manager_terms.motion_global_anchor_position_error_exp(env, command_name, std)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

  • std (float)

Return type:

ndarray

class unilab.tasks.motion_tracking.common.manager_terms.motion_global_body_angular_velocity_error_exp[source]

Bases: _NumbaBodyTerm

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

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

  • env (ManagerBasedRlEnv)

class unilab.tasks.motion_tracking.common.manager_terms.motion_global_body_linear_velocity_error_exp[source]

Bases: _NumbaBodyTerm

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

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

  • env (ManagerBasedRlEnv)

unilab.tasks.motion_tracking.common.manager_terms.motion_joint_pos_rel(env, command_name)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

Return type:

ndarray

unilab.tasks.motion_tracking.common.manager_terms.motion_joint_pos_rel_biased(env, command_name)[source]

Joint position relative to the episode default, including encoder bias.

Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

Return type:

ndarray

unilab.tasks.motion_tracking.common.manager_terms.motion_joint_position_error_exp(env, command_name, std)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

  • std (float)

Return type:

ndarray

unilab.tasks.motion_tracking.common.manager_terms.motion_joint_velocity_error_exp(env, command_name, std)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

  • std (float)

Return type:

ndarray

class unilab.tasks.motion_tracking.common.manager_terms.motion_relative_body_orientation_error_exp[source]

Bases: _NumbaBodyTerm

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

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

  • env (ManagerBasedRlEnv)

class unilab.tasks.motion_tracking.common.manager_terms.motion_relative_body_position_error_exp[source]

Bases: _NumbaBodyTerm

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

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

  • env (ManagerBasedRlEnv)

class unilab.tasks.motion_tracking.common.manager_terms.motion_relative_body_position_z_error_exp[source]

Bases: _BodyTerm

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)

unilab.tasks.motion_tracking.common.manager_terms.robot_body_ori_b(env, command_name)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

Return type:

ndarray

unilab.tasks.motion_tracking.common.manager_terms.robot_body_pos_b(env, command_name)[source]
Parameters:
  • env (ManagerBasedRlEnv)

  • command_name (str)

Return type:

ndarray

class unilab.tasks.motion_tracking.common.manager_terms.undesired_body_contacts[source]

Bases: _BodyTerm

Parameters:
  • cfg (ManagerTermBaseCfg)

  • env (ManagerBasedRlEnv)