unilab.envs.mdp.events.ApplyBodyImpulse

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

Bases: ManagerTermBase

Transient random body impulses with a cooldown->trigger->sustain->expire lifecycle.

NumPy adaptation of the pinned mjlab apply_body_impulse term. Each environment runs an independent timer: after a sampled cooldown, a uniformly sampled world-frame wrench is staged on the selected bodies and re-staged every step for a sampled duration, then expires back into cooldown. Use with mode="step".

body_point_offset shifts the force application point in the body link frame; the resulting cross(offset_w, force) torque is added at trigger time and held for the impulse duration. Torque channels (explicit torque_range or an offset) require the backend’s interval body-torque capability; force-only impulses only require interval body force. Backends without the required capability fail closed at construction.

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, force_range, torque_range, duration_s, cooldown_s, 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), body_point_offset=None)[source]

Returns the value of the term required by the manager.

Parameters:
Return type:

None

reset(env_ids=None)[source]

Resets the manager term.

Parameters:

env_ids (ndarray | slice | None)

Return type:

None

property name: str
property num_envs: int