unilab.envs.mdp.events.RandomizeBodyMassInertia

class unilab.envs.mdp.events.RandomizeBodyMassInertia[source]

Bases: ManagerTermBase

Startup-style mass+inertia scaling via one shared per-env factor.

NumPy adapter for the alpha-only slice of mjlab’s dr.pseudo_inertia: mass and principal inertia of the selected bodies are multiplied by the same factor s = e^{2α} with α ~ U(ln(lo)/2, ln(hi)/2) — i.e. s is log-uniform in scale_range; the CoM (body_ipos) and the principal frame (body_iquat) stay untouched.

Upstream runs this as a startup event (fixed per env for the whole run). UniLab startup events have no reset-transaction write path, so this term runs in reset mode but samples the factor only once — at the first reset — and reapplies the cached per-env values on every later reset. Both writes re-derive from immutable compile-time defaults, so reapplication is idempotent and non-accumulating.

Parameters:
  • cfg (EventTermCfg)

  • env (ManagerBasedRlEnv)

Methods

__init__(cfg, env)

reset(env_ids)

Resets the manager term.

Attributes

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

  • env (ManagerBasedRlEnv)

__call__(env, env_ids, asset_cfg, scale_range)[source]

Returns the value of the term required by the manager.

Parameters:
Return type:

None

property name: str
property num_envs: int
reset(env_ids)

Resets the manager term.

Parameters:

env_ids (ndarray | slice | None)

Return type:

Any