Motion command#
MotionCommand (env/mdp/commands.py) is the central command term. It loads a
multi-clip motion bundle (NPZ), plays reference kinematics each step, and drives
RSI resampling at episode boundaries.
Configuration#
MotionCommandCfg fields (set per robot entity in <robot>_base_cfg):
Field |
Meaning |
|---|---|
|
Path to converted NPZ (from |
|
Body used for anchor-frame errors and assistive wrench (set in robot entity) |
|
Keybodies tracked in rewards / RSI / critic obs |
|
Optional subset for joint tracking metrics and RSI |
|
DR on reference root pose and joint offsets at resample |
|
RSI (reference-state initialization) settings ( |
|
Bin-conditioned assist on the anchor (Zest-style curriculum) |
Runtime behavior#
Each environment step:
Advance
time_stepsalong the active clip segment.Expose reference body/joint states to reward and observation terms via
command_name="motion"params.Apply assistive wrench (when enabled) scaled by the current bin’s failure level.
At episode reset (_resample_command):
Pick (trajectory, bin, frame) from RSI policy (adaptive / uniform / start).
Write reference root + joint state into sim (with pose/joint DR).
Initialize episode RSI bookkeeping (start bin, similarity denominator, assist gain).
Multi-clip playback#
MotionLoader indexes a bundle with multiple segments. Each parallel env can be on
a different clip. resampling_time_range in the base template is effectively
infinite — episodes end via terminations, not command timeout.
Reference vs robot state#
Tracking rewards compare robot bodies/joints to reference values from the
command. The action space adds residual joint deltas on top of reference joint
positions (ReferenceJointPositionActionCfg), so the policy tracks the command
rather than absolute pose targets.
Assistive wrench#
When assistive_wrench_enabled=True, compute_assist_gain_matrix maps bin
failure levels to a gain β ∈ [0, assistive_beta_max]. Hard bins get more assist
during early training. Play mode disables assist (see Architecture overview).
Visualization#
MotionCommandCfg.viz selects ghost vs frame debug (see Visualization (Viser)).
WBC extends mjlab’s Viser play viewer with reference alignment (anchor-relative
xy/yaw overlay), tracking-error coloring, and RSI bin panels during
wbc-mjlab-play --viewer viser.
API: MDP terms (Motion command).