Command Terms¶
Command terms produce the goal a policy is conditioned on (a base velocity, a target pose, a gait phase, a motion
clip) and resample it on their own schedule. Other terms read a command by its config key through
env.command_manager. The commands guide covers resampling and debug visualization;
the term catalog lists every parameter.
The base class CommandTerm is on the managers page.
Velocity¶
SE(2) base-velocity commands: sampled, held constant, or driven by an operator's input device.
SE(2) velocity command terms for locomotion: sampled, held, and operator-driven.
Attributes¶
Classes¶
UniformVelocityCommand
¶
UniformVelocityCommand(env: EnvBase, options: CommandTermOptions)
Bases: CommandTerm
SE(2) velocity command sampled from a uniform distribution.
The command comprises a linear velocity in x and y direction and an angular velocity around the z-axis. It is given in the robot's base frame.
If the heading_command attribute is set to True, the angular velocity is computed from the heading
error similar to doing a proportional control on the heading error. The target heading is sampled uniformly
from the provided range. Otherwise, the angular velocity is sampled uniformly from the provided range.
Source code in eden/managers/terms/commands/velocity.py
Attributes¶
heading_control_stiffness
class-attribute
instance-attribute
¶
heading_control_stiffness: float = 1.0
lin_vel_x_range
class-attribute
instance-attribute
¶
lin_vel_y_range
class-attribute
instance-attribute
¶
ang_vel_z_range
class-attribute
instance-attribute
¶
vel_command_b
instance-attribute
¶
is_heading_env
instance-attribute
¶
command
property
¶
The desired base velocity command in the base frame. Shape is (num_envs, 3).
Methods:¶
ConstantVelocityCommand
¶
ConstantVelocityCommand(env: EnvBase, options: CommandTermOptions)
Bases: CommandTerm
SE(2) velocity command held at a fixed value instead of resampled.
Same command as :class:UniformVelocityCommand -- (vx, vy, wz) in the robot's
base frame -- with the random generator taken out: the value is whatever
:attr:command_value says, or whatever :meth:set_command was last given, and it
never changes on its own.
This is the term a deployment substitutes for the trained one. A policy deployed from its training config keeps resampling the command it was trained against, which on a robot reads as the machine wandering off on its own; holding a value the operator chose is what a deploy actually wants. It is equally the right term for an evaluation that has to hold one command for a whole episode.
The value is clamped into lin_vel_x_range / lin_vel_y_range /
ang_vel_z_range, which a deploy fills from the term it replaces, so the held
command cannot leave the distribution the policy was trained on. A degenerate
range — move_forward's lin_vel_x_range=(0.5, 0.5) — pins its axis: the policy
only ever saw one velocity there, so that axis is not controllable and the clamp
holds the single trained value whatever it is asked for. The clamp is logged.
Source code in eden/managers/terms/commands/velocity.py
Attributes¶
command_value
class-attribute
instance-attribute
¶
lin_vel_x_range
class-attribute
instance-attribute
¶
lin_vel_y_range
class-attribute
instance-attribute
¶
ang_vel_z_range
class-attribute
instance-attribute
¶
resampling_time_range
class-attribute
instance-attribute
¶
vel_command_b
instance-attribute
¶
command
property
¶
The desired base velocity command in the base frame. Shape is (num_envs, 3).
Methods:¶
build
¶
Source code in eden/managers/terms/commands/velocity.py
set_command
¶
set_command(command, *, warn_on_clamp: bool = True) -> Tensor
Hold (vx, vy, wz) from now on, clamped into the configured ranges.
Returns the clamped command, and warns when clamping actually bit — a value outside the trained ranges is worth seeing rather than silently trimming.
| PARAMETER | DESCRIPTION |
|---|---|
command
|
|
warn_on_clamp
|
Whether to log a clamp. Off for a value nothing will hold long enough to
matter — :class:
TYPE:
|
Source code in eden/managers/terms/commands/velocity.py
OperatorVelocityCommand
¶
OperatorVelocityCommand(env: EnvBase, options: CommandTermOptions)
Bases: ConstantVelocityCommand
SE(2) velocity command driven live by a human, from a keyboard or a gamepad.
A :class:ConstantVelocityCommand whose held value is re-read from an input device
every control step. Deploy a locomotion policy with this term substituted for its
trained :class:UniformVelocityCommand and the robot goes where the operator says
instead of where the training distribution says.
The device emits a normalized deflection; it is scaled into the same
lin_vel_*_range / ang_vel_z_range and clamped there, so full deflection is
the fastest command the policy was trained on and the operator cannot ask for more.
See :mod:eden.utils.devices.se2 for the bindings.
For deployment and interactive evaluation, not for training: it reads a physical device, so a training run would sit at whatever the sticks happen to say.
Source code in eden/managers/terms/commands/velocity.py
Attributes¶
Methods:¶
build
¶
Source code in eden/managers/terms/commands/velocity.py
Functions:¶
Target poses¶
Oracle pose command terms (uniform T3 / SE3 targets).
Attributes¶
Classes¶
UniformT3Command
¶
UniformT3Command(env: EnvBase, options: CommandTermOptions)
Bases: CommandTerm
Command that samples T(3) translation command.
| PARAMETER | DESCRIPTION |
|---|---|
x_range
|
Range of the x-coordinate of the target position.
|
y_range
|
Range of the y-coordinate of the target position.
|
z_range
|
Range of the z-coordinate of the target position.
|
debug_vis
|
When True (and not training), draw a debug sphere at the goal each step.
|
marker_frame_entity
|
Entity whose frame the command is expressed in. When set, the marker is
placed at
|
marker_entity_name
|
Name of a scene entity (e.g. a non-colliding
|
marker_radius
|
Fallback debug-sphere radius [m] (used only when
|
marker_color
|
Fallback debug-sphere RGBA.
|
Source code in eden/managers/terms/commands/oracle.py
Attributes¶
marker_color
class-attribute
instance-attribute
¶
Methods:¶
draw_vis
¶
Source code in eden/managers/terms/commands/oracle.py
UniformSE3Command
¶
UniformSE3Command(env: EnvBase, options: CommandTermOptions)
Bases: CommandTerm
Command that samples SE(3) translation and rotation command.
| PARAMETER | DESCRIPTION |
|---|---|
x_range
|
Range of the x-coordinate of the target position.
|
y_range
|
Range of the y-coordinate of the target position.
|
z_range
|
Range of the z-coordinate of the target position.
|
roll_range
|
Range of the roll angle of the target rotation (in radians).
|
pitch_range
|
Range of the pitch angle of the target rotation (in radians).
|
yaw_range
|
Range of the yaw angle of the target rotation (in radians).
|
Note
This term provides an equivalent command to UniformPoseCommand in IsaacLab.
Source code in eden/managers/terms/commands/oracle.py
Functions:¶
Gait phase¶
Gait phase command term for bipedal locomotion.
Attributes¶
Classes¶
GaitPhaseCommand
¶
GaitPhaseCommand(env: EnvBase, options: CommandTermOptions)
Bases: CommandTerm
Command generator that maintains a cyclic gait phase for each foot.
Generates a per-foot phase signal that advances at a configurable frequency.
The left foot starts at phase 0 and the right foot starts at phase_offset
(default pi for an alternating gait).
The command property returns the raw phase angles (num_envs, num_feet).
Use the sin_phase / cos_phase observation terms to feed these into the
policy.
| PARAMETER | DESCRIPTION |
|---|---|
gait_frequency
|
Gait cycle frequency in Hz (cycles per second). Default 1.25 Hz.
|
phase_offset
|
Phase offset between left and right foot in radians. Default pi (alternating).
|
num_feet
|
Number of feet. Default 2.
|
velocity_command_name
|
Optional name of a velocity-style command term (e.g.
|
stand_velocity_threshold
|
Velocity-magnitude threshold (m/s for linear, rad/s for angular) below which a command is treated as "stand". Default 0.01.
|
stand_phase_value
|
Phase value (radians) assigned to all feet for stand-mode envs.
Setting both feet to the same phase means the gait reward stops
penalizing alternation while standing. Default
|
Source code in eden/managers/terms/commands/gait.py
Motion clips¶
MotionCommand plays .npz motion clips on a plain RLEnvBase, for frozen-policy inference and single-clip
tracking. Training-grade motion tracking goes through MimicRLEnvBase and the
motion manager instead.
Motion-clip command term (single- and multi-clip) and npz loaders.
A :class:CommandTerm that drives motion-imitation / tracking policies from one
or more BeyondMimic-format .npz clips. Single-clip is the M == 1 case of
the multi-clip library. Shared by the frozen ONNX policy ports (sonic, twist2,
humanoid_gpt, protomotionv3, beyondmimic_moves) and the beyondmimic example.
Which motion path to use
Eden has two motion-reference systems; pick by use case:
- This command-term path (
MotionCommand) — lightweight, for frozen-policy inference / single-clip tracking on a plainRLEnvBase. Loads npz clips verbatim and exposes the current frame (plus arbitrary future frames via :meth:MotionCommand.gather_motion_frames) directly off the command term. No dataset pipeline. - The manager path (
eden.managers.motion_manager.MotionManager+eden.utils.motion_reference) — training-grade: dataset adapters, continuous-time interpolation, a future-frame window, symmetry augmentation, and motion-id / start-time curricula. Owned byMimicRLEnvBaseand consumed by the tracking reward / observation / termination terms. Seedocs/guides/motion-tracking.md.
Both expose the same world-frame vocabulary — links_*_w (tracked-link poses)
and base_*_w (floating-base root) — so reward / metric code reads the same
field names regardless of source.
Config vs data vocabulary
The configurable links_name list names the tracked links; their per-frame
data is read as links_*_w. Two links_name members are special: the
floating-base body (base_link_name, default links_name[0]; exposed as
base_*_w, used to reset the robot root) and anchor_link_name (the
yaw-warp reference, exposed as anchor_*_w). Both are resolved and validated
against links_name in :meth:build. The npz on-disk keys stay body_*_w
(file format); only the Python accessors are links_*.
Attributes¶
Classes¶
MotionLoader
¶
MotionLoader(motion_file: str, links_idx: Tensor, device: device = device('cpu'), links_name: list[str] | None = None)
Loader for a single motion clip.
A standalone verbatim loader for callers that only need one clip;
:class:MotionCommand itself loads through :class:MultiMotionLoader
(single-clip is its M=1 case).
| PARAMETER | DESCRIPTION |
|---|---|
motion_file
|
Path to the motion file.
TYPE:
|
links_idx
|
Genesis
TYPE:
|
device
|
Device to load the data on.
TYPE:
|
links_name
|
Names of the bodies to load, in the desired output order. When given and the npz carries
|
Source code in eden/managers/terms/commands/mimic.py
MultiMotionLoader
¶
MultiMotionLoader(motion_files: list[str], links_idx: Tensor, device: device, links_name: list[str] | None = None)
Batched verbatim loader for a list of BeyondMimic .npz clips.
Mirrors :class:MotionLoader field-for-field, but stacks M clips of
possibly different lengths into padded (M, T_max, ...) tensors plus a
per-clip frame_total (M,). Fields are loaded VERBATIM (no interpolation,
no velocity recompute) so each clip is bit-identical to the single-clip path.
With M == 1 (the single-clip case) T_max == T and no padding occurs,
so library[0, t] is plain single-clip indexing.
Padding edge-replicates each clip's last valid frame (never zeros): a zero
quaternion would NaN yaw_quat, and an over-read then degrades to a
"hold last frame" end-of-motion behavior (the per-env wrap keeps reads in
range anyway).
Source code in eden/managers/terms/commands/mimic.py
MotionCommand
¶
MotionCommand(env: EnvBase, options: CommandTermOptions)
Bases: CommandTerm
Motion command for mimicking one or more motion clips.
Backed by a :class:MultiMotionLoader clip library and a per-env
(motion_id, time_steps) gather. A single clip is just the M == 1
case: every env stays on clip 0 and the gather reduces to plain
single-clip indexing.
Passing motion_files=[...] (or a list to :func:motion_command_options)
assigns each env its own clip, re-sampled on every reset/wrap so all clips
are exercised regardless of num_envs vs num_clips.
Sampling modes: start / uniform work for any clip count; adaptive
(the failure-bin start-time curriculum) requires a single clip, since the
bins partition one clip's timeline.
Source code in eden/managers/terms/commands/mimic.py
Attributes¶
links_name
class-attribute
instance-attribute
¶
links_name: list[str] = ['pelvis', 'left_hip_roll_link', 'left_knee_link', 'left_ankle_roll_link', 'right_hip_roll_link', 'right_knee_link', 'right_ankle_roll_link', 'torso_link', 'left_shoulder_roll_link', 'left_elbow_link', 'left_wrist_yaw_link', 'right_shoulder_roll_link', 'right_elbow_link', 'right_wrist_yaw_link']
velocity_range
class-attribute
instance-attribute
¶
dofs_position_range
class-attribute
instance-attribute
¶
adaptive_failure_rate_max_over_mean
class-attribute
instance-attribute
¶
adaptive_failure_rate_max_over_mean: float = 10.0
sampling_mode
class-attribute
instance-attribute
¶
sampling_mode: Literal['adaptive', 'uniform', 'start'] = 'adaptive'
velocity_ranges
instance-attribute
¶
Methods:¶
build
¶
Source code in eden/managers/terms/commands/mimic.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | |
post_physics_refresh
¶
Source code in eden/managers/terms/commands/mimic.py
frame_total_per_env
¶
Per-env motion length in frames (each env's assigned clip length; a constant vector when there is a single clip).
clip_finished
¶
Per-env (N,) bool: has this env's clip reached its final frame?
The command path's answer to "is the motion over", and the counterpart of
:meth:~eden.managers.motion_manager.MotionManager.get_motion_phase >= 1 on the
manager path. It is only meaningful because :meth:advance_reference holds the clock
at frame_total - 1 instead of wrapping: in simulation
:meth:pre_physics_advance resamples at the boundary, so the clock regresses and this
goes False again, which is correct — a wrapped clip is not a finished one.
DeploymentBase.motion_finished reduces this for the deploy loop's end-of-clip
handover; nothing in the training loop reads it.
Source code in eden/managers/terms/commands/mimic.py
gather_motion_frames
¶
gather_motion_frames(field_name: str, frame_idx: Tensor) -> Tensor
Gather motion field field_name at per-env frame indices.
frame_idx is (N, K) long -> returns (N, K, ...). Each env
indexes its own assigned clip (motion_id); with a single clip every
env indexes the one shared clip's time axis.
Source code in eden/managers/terms/commands/mimic.py
pre_physics_advance
¶
Advance the clip clock (+ wrap-teleport) BEFORE the physics sub-steps.
Advance-then-grade: the reference frame is advanced before physics so the
post-physics robot (graded at reward/termination time) is compared against
the temporally-aligned frame — matching :class:MotionManager, whose clock
advances at the start of MimicRLEnvBase.step. Advancing in
:meth:compute (after reward) would grade against a
one-control-step-stale reference. Wrap-teleport runs here, before physics,
so the teleported robot is forward-stepped and its forward kinematics stay
fresh at reward time (no stale-FK spurious terminations).
Source code in eden/managers/terms/commands/mimic.py
advance_reference
¶
Advance deployment playback, holding the last frame without a wrap teleport.
rewind_reference
¶
Rewind the clip clock to frame 0 for every env — the deploy path's handover.
Clock only: no :meth:_resample_command, so the robot is neither teleported nor
pose-randomized and the clip assignment stands. That is the whole point on hardware,
where the sim's reset-state initialization has nothing to act on, and it mirrors what
MotionManager.rewind_to_start does for the manager path.
Source code in eden/managers/terms/commands/mimic.py
draw_vis
¶
Source code in eden/managers/terms/commands/mimic.py
Functions:¶
resolve_body_cols
¶
Column indices into a clip's body_*_w arrays for the requested links.
Resolution order:
- If the npz stores
body_names, resolve by name — independent of Genesis's internal link ordering (which changed breadth-first -> depth-first in genesis 1.2.0). - Else, if the canonical G1 breadth-first link list (
G1_DOFS29_TRACKED_LINKS_NAME) covers every requested link, resolve against that order. Everybody_names-less npz predates genesis 1.2.0 and was therefore written in the old breadth-first order, so this makes legacy G1 clips correct under a depth-first runtime instead of silently mis-sliced byidx_local. - Else (unrecognized body set, e.g. a non-G1 clip) fall back to the Genesis
idx_localinlinks_idx— order-coupled, correct only when generated under the runtime's ordering.
Source code in eden/managers/terms/commands/mimic.py
motion_command_options
¶
motion_command_options(motion_file: str | list[str], *, anchor_link_name: str, links_name: list[str], entity_name: str = 'robot', ghost_entity_name: str = '', debug_vis: bool = False, sampling_mode: str = 'start', **overrides) -> dict[str, 'CommandTermOptions']
Build the {"motion": <term>} command_options for a motion-tracking policy.
Always builds a single :class:MotionCommand; a list of clip paths populates
its motion_files (each env rolls its own assigned clip) and a single path
populates motion_file (the M=1 case). The accessor interface is identical
either way, so a policy reads motion source-agnostically — a new ONNX motion
policy reuses this helper by passing only its body/anchor names. overrides
replace shared term fields.