Locomotion tasks#
Task definitions, tensor contracts and downloadable robot assets for the locomotion environments. See Locomotion RL tasks for configuration, data preparation and controls.
Package entry points#
The Humanoid package exports its effort-controlled running environment. The task manager package exports actor/critic observation builders and reward functions. Joint-position actions and root-velocity disturbances are standard EmbodiChain manager components configured by these tasks.
|
Preserve the benchmark's 63 observations and clipped motor effort action. |
|
Convert policy actions to joint positions around a configured default pose. |
|
Apply independently scheduled root-velocity disturbances. |
|
Return the task-owned actor or privileged critic observation. |
|
Select one named raw reward from the task-owned locomotion MDP. |
|
Return the task-defined weighted reward for one control step. |
Robot configuration loaders#
Each velocity package exports a configuration type and load_config() for
its packaged task.json. These loaders preserve the robot’s joint order,
action scale, observation dimensions and control timing.
|
Dimensions, control parameters, and timing for ANYmal-C. |
|
Load ANYmal-C settings from its packaged task definition. |
|
Dimensions and timing used by the G1 velocity task. |
|
Load G1 settings from the packaged task definition. |
|
Dimensions and timing used by the Go1 velocity task. |
|
Load the official MJLab Go1 flat-velocity task settings. |
|
Dimensions and timing used by the Go2 velocity task. |
|
Load Go2 settings from the packaged task definition. |
|
Dimensions and timing used by the H1_2 velocity task. |
|
Load H1_2 settings from the packaged task definition. |
|
Dimensions and timing used by the MicroDuck velocity task. |
|
Load MicroDuck settings from its packaged task definition. |
Implementation reference#
Observation functors for native locomotion environments.
Functions:
|
Return the task-owned actor or privileged critic observation. |
- embodichain_tasks.locomotion.managers.observations.velocity_locomotion_observation(env, obs, privileged=False, enable_corruption=False)[source]#
Return the task-owned actor or privileged critic observation.
- Parameters:
env (
EmbodiedEnv) – Environment providing the task state and robot.obs (
TensorDict[str,Union[Tensor,TensorDict[str,Tensor]]]) – Observation-manager input; the task builds its own observation tensors.privileged (
bool) – Return the critic observation when true, otherwise the actor observation.enable_corruption (
bool) – Request the task-defined observation noise.
- Return type:
Tensor- Returns:
The selected actor or privileged critic tensor.
Reward functors for native locomotion environments.
Functions:
|
Select one named raw reward from the task-owned locomotion MDP. |
|
Return the task-defined weighted reward for one control step. |
- embodichain_tasks.locomotion.managers.rewards.velocity_locomotion_reward(env, obs, action, info, term)[source]#
Select one named raw reward from the task-owned locomotion MDP.
- Parameters:
env (
EmbodiedEnv) – Environment providing the task state and robot.obs (
TensorDict[str,Union[Tensor,TensorDict[str,Tensor]]]) – Observation-manager input; the task builds its own observation tensors.action (
Union[Tensor,TensorDict[str,Tensor]]) – Policy actions with one row per environment and one column per controlled joint.info (
dict[str,Any]) – Step information forwarded to the task reward computation.term (
str) – Raw reward term name to select from the task result.
- Return type:
Tensor- Returns:
The selected raw reward tensor with one value per environment.
- embodichain_tasks.locomotion.managers.rewards.velocity_locomotion_total_reward(env, obs, action, info)[source]#
Return the task-defined weighted reward for one control step.
- Parameters:
env (
EmbodiedEnv) – Environment providing the task state and robot.obs (
TensorDict[str,Union[Tensor,TensorDict[str,Tensor]]]) – Observation-manager input; the task builds its own observation tensors.action (
Union[Tensor,TensorDict[str,Tensor]]) – Policy actions with one row per environment and one column per controlled joint.info (
dict[str,Any]) – Step information forwarded to the task reward computation.
- Return type:
Tensor- Returns:
The task total reward with one value per environment.
ANYbotics ANYmal-C flat-ground velocity task.
Classes:
Track planar velocity commands with the 12-DOF ANYmal-C model. |
- class embodichain_tasks.locomotion.velocity.anymal_c_flat.ANYmalCFlatEnv[source]#
Bases:
EmbodiChainVelocityEnvTrack planar velocity commands with the 12-DOF ANYmal-C model.
Methods:
build_observations_fn(state)Build the 48-value ANYmal-C flat policy observation.
compute_rewards_fn(state, terminated)Compute dt-scaled ANYmal-C flat velocity rewards.
compute_termination_fn(state)Terminate on base contact or non-finite state and truncate on timeout.
Attributes:
Classes:
alias of
ANYmalCState- action_manager: ActionManager | None#
- static build_observations_fn(state)#
Build the 48-value ANYmal-C flat policy observation.
- Parameters:
config (
ANYmalCVelocityConfig) – Task joint, observation, reward and timing settings.state (
ANYmalCState) – Batched task state in the configured joint and body order.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and critic observation tensors, each with one row per environment.
- static compute_rewards_fn(state, terminated)#
Compute dt-scaled ANYmal-C flat velocity rewards.
- Parameters:
config (
ANYmalCVelocityConfig) – Task joint, observation, reward and timing settings.state (
ANYmalCState) – Batched task state in the configured joint and body order.terminated (
Tensor) – Failure mask; unused by ANYmal-C reward terms.
- Return type:
- Returns:
Raw terms, weighted terms scaled by control timestep, and their total.
- static compute_termination_fn(state)#
Terminate on base contact or non-finite state and truncate on timeout.
- Parameters:
config (
ANYmalCVelocityConfig) – Task joint, observation, reward and timing settings.state (
ANYmalCState) – Batched task state in the configured joint and body order.
- Return type:
tuple[Tensor,Tensor]- Returns:
Per-environment failure and episode-timeout masks.
- dataset_manager: DatasetManager | None#
- episode_success_status: torch.Tensor#
- event_manager: EventManager | None#
- foot_link_names: tuple[str, ...] = ('LF_FOOT', 'LH_FOOT', 'RF_FOOT', 'RH_FOOT')#
- foot_offsets: tuple[tuple[float, float, float], ...] = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))#
- illegal_contact_link_names: tuple[str, ...] = ('base', 'LF_THIGH', 'LH_THIGH', 'RF_THIGH', 'RH_THIGH')#
- observation_manager: ObservationManager | None#
- orientation_link_name: str | None = 'base'#
- reward_manager: RewardManager | None#
- rollout_buffer: TensorDict | None#
- state_type#
alias of
ANYmalCState
- velocity_task_config: Any = ANYmalCVelocityConfig(data={'schema': 'isaaclab-anymal-c-velocity-flat-direct', 'official_task': 'Isaac-Velocity-Flat-Anymal-C-Direct-v0', 'physics': {'physics_dt': 0.005, 'control_dt': 0.02, 'decimation': 4, 'episode_length_s': 20.0, 'default_backend_mapping': {'solver_position_iterations': 4, 'solver_velocity_iterations': 0}}, 'robot': {'root_body': 'base', 'root_height': 0.6, 'joint_names': ['LF_HAA', 'LF_HFE', 'LF_KFE', 'LH_HAA', 'LH_HFE', 'LH_KFE', 'RF_HAA', 'RF_HFE', 'RF_KFE', 'RH_HAA', 'RH_HFE', 'RH_KFE'], 'default_joint_position': [0.0, 0.4, -0.8, 0.0, -0.4, 0.8, 0.0, 0.4, -0.8, 0.0, -0.4, 0.8], 'action_scale': 0.5, 'stiffness': 40.0, 'damping': 5.0, 'effort_limit': 80.0, 'velocity_limit': 7.5, 'actuator_model': 'ANYDRIVE_3_SIMPLE_ACTUATOR_CFG'}, 'contact': {'foot_body_names': ['LF_FOOT', 'LH_FOOT', 'RF_FOOT', 'RH_FOOT'], 'base_body_name': 'base', 'thigh_body_names': ['LF_THIGH', 'LH_THIGH', 'RF_THIGH', 'RH_THIGH'], 'force_threshold': 1.0, 'history_substeps': 4}, 'observations': {'actor_dimension': 48, 'critic_dimension': 48, 'order': ['base_lin_vel', 'base_ang_vel', 'projected_gravity', 'velocity_commands', 'joint_pos_rel', 'joint_vel', 'actions']}, 'actions': {'joint_pos': {'use_default_offset': True}}, 'commands': {'twist': {'resampling_time_range': [20.0, 20.0], 'rel_standing_envs': 0.0, 'rel_heading_envs': 0.0, 'heading_command': False, 'heading_control_stiffness': 0.0, 'ranges': {'lin_vel_x': [-1.0, 1.0], 'lin_vel_y': [-1.0, 1.0], 'ang_vel_z': [-1.0, 1.0]}}}, 'events': {'reset_base': {'params': {'pose_range': {'x': [0.0, 0.0], 'y': [0.0, 0.0], 'z': [0.0, 0.0], 'yaw': [0.0, 0.0]}}}, 'reset_robot_joints': {'params': {'position_range': [1.0, 1.0], 'velocity_range': [0.0, 0.0], 'operation': 'scale'}}}, 'rewards': {'track_lin_vel_xy_exp': {'weight': 1.0, 'std_squared': 0.25}, 'track_ang_vel_z_exp': {'weight': 0.5, 'std_squared': 0.25}, 'lin_vel_z_l2': {'weight': -2.0}, 'ang_vel_xy_l2': {'weight': -0.05}, 'dof_torques_l2': {'weight': -2.5e-05}, 'dof_acc_l2': {'weight': -2.5e-07}, 'action_rate_l2': {'weight': -0.01}, 'feet_air_time': {'weight': 0.5, 'threshold': 0.5}, 'undesired_contacts': {'weight': -1.0, 'threshold': 1.0}, 'flat_orientation_l2': {'weight': -5.0}}, 'terminations': {'base_contact': {'threshold': 1.0}, 'time_out': {'time_out': True}}}, joint_names=('LF_HAA', 'LF_HFE', 'LF_KFE', 'LH_HAA', 'LH_HFE', 'LH_KFE', 'RF_HAA', 'RF_HFE', 'RF_KFE', 'RH_HAA', 'RH_HFE', 'RH_KFE'), default_joint_position=(0.0, 0.4, -0.8, 0.0, -0.4, 0.8, 0.0, 0.4, -0.8, 0.0, -0.4, 0.8), action_scale=(0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5), actor_observation_dim=48, critic_observation_dim=48, action_dim=12, physics_dt=0.005, control_dt=0.02, max_episode_steps=1000)#
Load the ANYmal-C flat velocity task configuration.
Classes:
Dimensions, control parameters, and timing for ANYmal-C. |
Functions:
Load ANYmal-C settings from its packaged task definition. |
- class embodichain_tasks.locomotion.velocity.contracts.anymal_c.config.ANYmalCVelocityConfig[source]#
Bases:
objectDimensions, control parameters, and timing for ANYmal-C.
Methods:
__init__([data, joint_names, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
Attributes:
- __init__(data=<factory>, joint_names=<factory>, default_joint_position=<factory>, action_scale=<factory>, actor_observation_dim=<factory>, critic_observation_dim=<factory>, action_dim=<factory>, physics_dt=<factory>, control_dt=<factory>, max_episode_steps=<factory>)#
-
action_dim:
int#
-
action_scale:
tuple[float,...]#
-
actor_observation_dim:
int#
-
control_dt:
float#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
-
critic_observation_dim:
int#
-
data:
dict#
-
default_joint_position:
tuple[float,...]#
-
joint_names:
tuple[str,...]#
-
max_episode_steps:
int#
-
physics_dt:
float#
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores all names starting with “__” (i.e. built-in methods).
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[str,Any]- Returns:
Converted dictionary mapping.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.
- embodichain_tasks.locomotion.velocity.contracts.anymal_c.config.load_config()[source]#
Load ANYmal-C settings from its packaged task definition.
- Return type:
- Returns:
Joint order, default pose, action scale, observation dimensions and timing.
- Raises:
ValueError – Joint, default-pose and action dimensions differ.
Observation, action, reward, and termination functions for ANYmal-C.
Classes:
Raw, weighted, and total ANYmal-C rewards. |
|
Physical tensors consumed by the ANYmal-C flat velocity task. |
Functions:
|
Map normalized actions to default-offset joint targets. |
|
Build the 48-value ANYmal-C flat policy observation. |
|
Compute dt-scaled ANYmal-C flat velocity rewards. |
|
Terminate on base contact or non-finite state and truncate on timeout. |
- class embodichain_tasks.locomotion.velocity.contracts.anymal_c.mdp.ANYmalCReward[source]#
Bases:
objectRaw, weighted, and total ANYmal-C rewards.
Methods:
__init__(raw_terms, weighted_terms, total)Attributes:
- __init__(raw_terms, weighted_terms, total)#
-
raw_terms:
dict[str,Tensor]#
-
total:
Tensor#
-
weighted_terms:
dict[str,Tensor]#
- class embodichain_tasks.locomotion.velocity.contracts.anymal_c.mdp.ANYmalCState[source]#
Bases:
objectPhysical tensors consumed by the ANYmal-C flat velocity task.
Methods:
__init__(base_lin_vel_b, base_ang_vel_b, ...)Attributes:
- __init__(base_lin_vel_b, base_ang_vel_b, projected_gravity_b, command, joint_pos, joint_vel, joint_acc, joint_torque, action, last_action, episode_step, root_height, foot_air_time, last_foot_air_time, first_foot_contact, illegal_contact_force_by_body)#
-
action:
Tensor#
-
base_ang_vel_b:
Tensor#
-
base_lin_vel_b:
Tensor#
-
command:
Tensor#
-
episode_step:
Tensor#
-
first_foot_contact:
Tensor#
-
foot_air_time:
Tensor#
-
illegal_contact_force_by_body:
Tensor#
-
joint_acc:
Tensor#
-
joint_pos:
Tensor#
-
joint_torque:
Tensor#
-
joint_vel:
Tensor#
-
last_action:
Tensor#
-
last_foot_air_time:
Tensor#
-
projected_gravity_b:
Tensor#
-
root_height:
Tensor#
- embodichain_tasks.locomotion.velocity.contracts.anymal_c.mdp.action_target(config, action)[source]#
Map normalized actions to default-offset joint targets.
- Parameters:
config (
ANYmalCVelocityConfig) – Task joint, observation, reward and timing settings.action (
Tensor) – Normalized policy actions in configured joint order.
- Return type:
Tensor- Returns:
Joint-position targets with the configured default pose and action scale.
- embodichain_tasks.locomotion.velocity.contracts.anymal_c.mdp.build_observations(config, state)[source]#
Build the 48-value ANYmal-C flat policy observation.
- Parameters:
config (
ANYmalCVelocityConfig) – Task joint, observation, reward and timing settings.state (
ANYmalCState) – Batched task state in the configured joint and body order.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and critic observation tensors, each with one row per environment.
- embodichain_tasks.locomotion.velocity.contracts.anymal_c.mdp.compute_rewards(config, state, terminated)[source]#
Compute dt-scaled ANYmal-C flat velocity rewards.
- Parameters:
config (
ANYmalCVelocityConfig) – Task joint, observation, reward and timing settings.state (
ANYmalCState) – Batched task state in the configured joint and body order.terminated (
Tensor) – Failure mask; unused by ANYmal-C reward terms.
- Return type:
- Returns:
Raw terms, weighted terms scaled by control timestep, and their total.
- embodichain_tasks.locomotion.velocity.contracts.anymal_c.mdp.compute_termination(config, state)[source]#
Terminate on base contact or non-finite state and truncate on timeout.
- Parameters:
config (
ANYmalCVelocityConfig) – Task joint, observation, reward and timing settings.state (
ANYmalCState) – Batched task state in the configured joint and body order.
- Return type:
tuple[Tensor,Tensor]- Returns:
Per-environment failure and episode-timeout masks.
Load the Unitree G1 velocity task configuration.
Classes:
Dimensions and timing used by the G1 velocity task. |
Functions:
Load G1 settings from the packaged task definition. |
- class embodichain_tasks.locomotion.velocity.contracts.g1.config.G1VelocityConfig[source]#
Bases:
objectDimensions and timing used by the G1 velocity task.
Methods:
__init__([data, joint_names, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
Attributes:
- __init__(data=<factory>, joint_names=<factory>, default_joint_position=<factory>, action_scale=<factory>, actor_observation_dim=<factory>, critic_observation_dim=<factory>, action_dim=<factory>, phase_period=<factory>, physics_dt=<factory>, control_dt=<factory>, max_episode_steps=<factory>)#
-
action_dim:
int#
-
action_scale:
tuple[float,...]#
-
actor_observation_dim:
int#
-
control_dt:
float#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
-
critic_observation_dim:
int#
-
data:
dict#
-
default_joint_position:
tuple[float,...]#
-
joint_names:
tuple[str,...]#
-
max_episode_steps:
int#
-
phase_period:
float#
-
physics_dt:
float#
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores all names starting with “__” (i.e. built-in methods).
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[str,Any]- Returns:
Converted dictionary mapping.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.
- embodichain_tasks.locomotion.velocity.contracts.g1.config.load_config()[source]#
Load G1 settings from the packaged task definition.
- Return type:
- Returns:
The robot task configuration loaded from the packaged task.json.
Observation, action, reward and done functions for G1 velocity.
Classes:
Raw, weighted and total G1 reward values. |
|
Physical tensors consumed only by the G1 velocity task. |
Functions:
|
Map G1 policy actions to default-offset joint targets. |
|
Build G1 actor and critic observations without random noise. |
|
Compute the official G1 reward terms and dt-scaled total. |
|
Compute G1 tilt termination and time-limit truncation. |
- class embodichain_tasks.locomotion.velocity.contracts.g1.mdp.G1Reward[source]#
Bases:
objectRaw, weighted and total G1 reward values.
Methods:
__init__(raw_terms, weighted_terms, total)Attributes:
- __init__(raw_terms, weighted_terms, total)#
-
raw_terms:
dict[str,Tensor]#
-
total:
Tensor#
-
weighted_terms:
dict[str,Tensor]#
- class embodichain_tasks.locomotion.velocity.contracts.g1.mdp.G1State[source]#
Bases:
objectPhysical tensors consumed only by the G1 velocity task.
Methods:
__init__(base_lin_vel_b, base_ang_vel_b, ...)Attributes:
- __init__(base_lin_vel_b, base_ang_vel_b, projected_gravity_b, command, joint_pos, joint_vel, joint_acc, action, last_action, episode_step, root_height, foot_height, foot_vel_w, foot_contact, foot_force_w, foot_air_time, first_foot_contact, soft_joint_lower, soft_joint_upper, reward_body_ang_vel_w, angular_momentum_w, self_collision_count, reward_command=None, reward_base_lin_vel_b=None, reward_base_ang_vel_b=None, orientation_projected_gravity_b=None)#
-
action:
Tensor#
-
angular_momentum_w:
Tensor#
-
base_ang_vel_b:
Tensor#
-
base_lin_vel_b:
Tensor#
-
command:
Tensor#
-
episode_step:
Tensor#
-
first_foot_contact:
Tensor#
-
foot_air_time:
Tensor#
-
foot_contact:
Tensor#
-
foot_force_w:
Tensor#
-
foot_height:
Tensor#
-
foot_vel_w:
Tensor#
-
joint_acc:
Tensor#
-
joint_pos:
Tensor#
-
joint_vel:
Tensor#
-
last_action:
Tensor#
-
orientation_projected_gravity_b:
Tensor|None= None#
-
projected_gravity_b:
Tensor#
-
reward_base_ang_vel_b:
Tensor|None= None#
-
reward_base_lin_vel_b:
Tensor|None= None#
-
reward_body_ang_vel_w:
Tensor#
-
reward_command:
Tensor|None= None#
-
root_height:
Tensor#
-
self_collision_count:
Tensor#
-
soft_joint_lower:
Tensor#
-
soft_joint_upper:
Tensor#
- embodichain_tasks.locomotion.velocity.contracts.g1.mdp.action_target(config, action)[source]#
Map G1 policy actions to default-offset joint targets.
- Parameters:
config (
G1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.action (
Tensor) – Policy actions with one row per environment and one column per controlled joint.
- Return type:
Tensor- Returns:
Default-offset joint position targets in policy joint order.
- embodichain_tasks.locomotion.velocity.contracts.g1.mdp.build_observations(config, state)[source]#
Build G1 actor and critic observations without random noise.
- Parameters:
config (
G1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
G1State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and privileged critic tensors, in that order.
- embodichain_tasks.locomotion.velocity.contracts.g1.mdp.compute_rewards(config, state, terminated)[source]#
Compute the official G1 reward terms and dt-scaled total.
- Parameters:
config (
G1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
G1State) – Batched physical state in the task schema and its declared coordinate frames.terminated (
Tensor) – Boolean failure mask for each environment before time-limit truncation.
- Return type:
- Returns:
Raw terms, weighted terms, and the summed reward for each environment.
- embodichain_tasks.locomotion.velocity.contracts.g1.mdp.compute_termination(config, state)[source]#
Compute G1 tilt termination and time-limit truncation.
- Parameters:
config (
G1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
G1State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Failure and time-limit masks, respectively, with one value per environment.
Load the Unitree Go1 velocity task configuration.
Classes:
Dimensions and timing used by the Go1 velocity task. |
Functions:
Load the official MJLab Go1 flat-velocity task settings. |
- class embodichain_tasks.locomotion.velocity.contracts.go1.config.Go1VelocityConfig[source]#
Bases:
objectDimensions and timing used by the Go1 velocity task.
Methods:
__init__([data, joint_names, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
Attributes:
- __init__(data=<factory>, joint_names=<factory>, default_joint_position=<factory>, action_scale=<factory>, actor_observation_dim=<factory>, critic_observation_dim=<factory>, action_dim=<factory>, physics_dt=<factory>, control_dt=<factory>, max_episode_steps=<factory>)#
-
action_dim:
int#
-
action_scale:
tuple[float,...]#
-
actor_observation_dim:
int#
-
control_dt:
float#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
-
critic_observation_dim:
int#
-
data:
dict#
-
default_joint_position:
tuple[float,...]#
-
joint_names:
tuple[str,...]#
-
max_episode_steps:
int#
-
physics_dt:
float#
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores all names starting with “__” (i.e. built-in methods).
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[str,Any]- Returns:
Converted dictionary mapping.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.
- embodichain_tasks.locomotion.velocity.contracts.go1.config.load_config()[source]#
Load the official MJLab Go1 flat-velocity task settings.
- Return type:
- Returns:
The robot task configuration loaded from the packaged task.json.
Official MJLab Go1 flat-velocity observation, reward, and done functions.
Classes:
Raw, weighted, and total Go1 reward values. |
|
Physical tensors consumed by the official MJLab Go1 task. |
Functions:
|
Map actions to official default-offset joint position targets. |
|
Build the official 48-value actor and 72-value asymmetric critic inputs. |
|
Compute the official Go1 flat-velocity reward terms. |
|
Compute failure termination and time-limit truncation. |
|
Apply the official uniform observation noise in place. |
|
Return the official flat-terrain 70-degree tilt termination. |
- class embodichain_tasks.locomotion.velocity.contracts.go1.mdp.Go1Reward[source]#
Bases:
objectRaw, weighted, and total Go1 reward values.
Methods:
__init__(raw_terms, weighted_terms, total)Attributes:
- __init__(raw_terms, weighted_terms, total)#
-
raw_terms:
dict[str,Tensor]#
-
total:
Tensor#
-
weighted_terms:
dict[str,Tensor]#
- class embodichain_tasks.locomotion.velocity.contracts.go1.mdp.Go1State[source]#
Bases:
objectPhysical tensors consumed by the official MJLab Go1 task.
Methods:
__init__(base_lin_vel_b, base_ang_vel_b, ...)Attributes:
- __init__(base_lin_vel_b, base_ang_vel_b, projected_gravity_b, command, joint_pos, encoder_bias, joint_vel, action, last_action, episode_step, root_height, foot_height, foot_vel_w, foot_contact, foot_force_w, foot_air_time, first_foot_contact, foot_swing_height_cost, soft_joint_lower, soft_joint_upper, illegal_contact_force, illegal_contact_force_by_body)#
-
action:
Tensor#
-
base_ang_vel_b:
Tensor#
-
base_lin_vel_b:
Tensor#
-
command:
Tensor#
-
encoder_bias:
Tensor#
-
episode_step:
Tensor#
-
first_foot_contact:
Tensor#
-
foot_air_time:
Tensor#
-
foot_contact:
Tensor#
-
foot_force_w:
Tensor#
-
foot_height:
Tensor#
-
foot_swing_height_cost:
Tensor#
-
foot_vel_w:
Tensor#
-
illegal_contact_force:
Tensor#
-
illegal_contact_force_by_body:
Tensor#
-
joint_pos:
Tensor#
-
joint_vel:
Tensor#
-
last_action:
Tensor#
-
projected_gravity_b:
Tensor#
-
root_height:
Tensor#
-
soft_joint_lower:
Tensor#
-
soft_joint_upper:
Tensor#
- embodichain_tasks.locomotion.velocity.contracts.go1.mdp.action_target(config, action)[source]#
Map actions to official default-offset joint position targets.
- Parameters:
config (
Go1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.action (
Tensor) – Policy actions with one row per environment and one column per controlled joint.
- Return type:
Tensor- Returns:
Default-offset joint position targets in policy joint order.
- embodichain_tasks.locomotion.velocity.contracts.go1.mdp.build_observations(config, state)[source]#
Build the official 48-value actor and 72-value asymmetric critic inputs.
- Parameters:
config (
Go1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go1State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and privileged critic tensors, in that order.
- embodichain_tasks.locomotion.velocity.contracts.go1.mdp.compute_rewards(config, state, terminated)[source]#
Compute the official Go1 flat-velocity reward terms.
- Parameters:
config (
Go1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go1State) – Batched physical state in the task schema and its declared coordinate frames.terminated (
Tensor) – Boolean failure mask for each environment before time-limit truncation.
- Return type:
- Returns:
Raw terms, weighted terms, and the summed reward for each environment.
- embodichain_tasks.locomotion.velocity.contracts.go1.mdp.compute_termination(config, state)[source]#
Compute failure termination and time-limit truncation.
- Parameters:
config (
Go1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go1State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Failure and time-limit masks, respectively, with one value per environment.
- embodichain_tasks.locomotion.velocity.contracts.go1.mdp.corrupt_actor_observation(config, actor, generator)[source]#
Apply the official uniform observation noise in place.
- Parameters:
config (
Go1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.actor (
Tensor) – Actor observation tensor to corrupt in place.generator (
Generator) – Random generator used to sample the task noise or delays.
- Return type:
Tensor- Returns:
The actor observation tensor after adding the configured noise.
- embodichain_tasks.locomotion.velocity.contracts.go1.mdp.termination_causes(config, state)[source]#
Return the official flat-terrain 70-degree tilt termination.
- Parameters:
config (
Go1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go1State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
dict[str,Tensor]- Returns:
Named boolean failure masks with one value per environment.
Load the Unitree Go2 velocity task configuration.
Classes:
Dimensions and timing used by the Go2 velocity task. |
Functions:
Load Go2 settings from the packaged task definition. |
- class embodichain_tasks.locomotion.velocity.contracts.go2.config.Go2VelocityConfig[source]#
Bases:
objectDimensions and timing used by the Go2 velocity task.
Methods:
__init__([data, joint_names, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
Attributes:
- __init__(data=<factory>, joint_names=<factory>, default_joint_position=<factory>, action_scale=<factory>, actor_observation_dim=<factory>, critic_observation_dim=<factory>, action_dim=<factory>, phase_period=<factory>, physics_dt=<factory>, control_dt=<factory>, max_episode_steps=<factory>)#
-
action_dim:
int#
-
action_scale:
tuple[float,...]#
-
actor_observation_dim:
int#
-
control_dt:
float#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
-
critic_observation_dim:
int#
-
data:
dict#
-
default_joint_position:
tuple[float,...]#
-
joint_names:
tuple[str,...]#
-
max_episode_steps:
int#
-
phase_period:
float#
-
physics_dt:
float#
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores all names starting with “__” (i.e. built-in methods).
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[str,Any]- Returns:
Converted dictionary mapping.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.
- embodichain_tasks.locomotion.velocity.contracts.go2.config.load_config()[source]#
Load Go2 settings from the packaged task definition.
- Return type:
- Returns:
The robot task configuration loaded from the packaged task.json.
Observation, action, reward and done functions for Go2 velocity.
Classes:
Raw, weighted and total Go2 reward values. |
|
Physical tensors consumed only by the Go2 velocity task. |
Functions:
|
Map Go2 policy actions to default-offset joint targets. |
|
Build Go2 actor and critic observations without random noise. |
|
Compute the official Go2 reward terms and dt-scaled total. |
|
Compute Go2 tilt/contact termination and time-limit truncation. |
|
Return the individual Go2 failure conditions. |
- class embodichain_tasks.locomotion.velocity.contracts.go2.mdp.Go2Reward[source]#
Bases:
objectRaw, weighted and total Go2 reward values.
Methods:
__init__(raw_terms, weighted_terms, total)Attributes:
- __init__(raw_terms, weighted_terms, total)#
-
raw_terms:
dict[str,Tensor]#
-
total:
Tensor#
-
weighted_terms:
dict[str,Tensor]#
- class embodichain_tasks.locomotion.velocity.contracts.go2.mdp.Go2State[source]#
Bases:
objectPhysical tensors consumed only by the Go2 velocity task.
Methods:
__init__(base_lin_vel_b, base_ang_vel_b, ...)Attributes:
- __init__(base_lin_vel_b, base_ang_vel_b, projected_gravity_b, command, joint_pos, joint_vel, joint_acc, action, last_action, episode_step, root_height, foot_height, foot_vel_w, foot_contact, foot_force_w, foot_air_time, first_foot_contact, soft_joint_lower, soft_joint_upper, reward_body_ang_vel_w, angular_momentum_w, illegal_contact_force, illegal_contact_force_by_body=None, reward_command=None, reward_base_lin_vel_b=None, reward_base_ang_vel_b=None, orientation_projected_gravity_b=None, self_collision_count=None)#
-
action:
Tensor#
-
angular_momentum_w:
Tensor#
-
base_ang_vel_b:
Tensor#
-
base_lin_vel_b:
Tensor#
-
command:
Tensor#
-
episode_step:
Tensor#
-
first_foot_contact:
Tensor#
-
foot_air_time:
Tensor#
-
foot_contact:
Tensor#
-
foot_force_w:
Tensor#
-
foot_height:
Tensor#
-
foot_vel_w:
Tensor#
-
illegal_contact_force:
Tensor#
-
illegal_contact_force_by_body:
Tensor|None= None#
-
joint_acc:
Tensor#
-
joint_pos:
Tensor#
-
joint_vel:
Tensor#
-
last_action:
Tensor#
-
orientation_projected_gravity_b:
Tensor|None= None#
-
projected_gravity_b:
Tensor#
-
reward_base_ang_vel_b:
Tensor|None= None#
-
reward_base_lin_vel_b:
Tensor|None= None#
-
reward_body_ang_vel_w:
Tensor#
-
reward_command:
Tensor|None= None#
-
root_height:
Tensor#
-
self_collision_count:
Tensor|None= None#
-
soft_joint_lower:
Tensor#
-
soft_joint_upper:
Tensor#
- embodichain_tasks.locomotion.velocity.contracts.go2.mdp.action_target(config, action)[source]#
Map Go2 policy actions to default-offset joint targets.
- Parameters:
config (
Go2VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.action (
Tensor) – Policy actions with one row per environment and one column per controlled joint.
- Return type:
Tensor- Returns:
Default-offset joint position targets in policy joint order.
- embodichain_tasks.locomotion.velocity.contracts.go2.mdp.build_observations(config, state)[source]#
Build Go2 actor and critic observations without random noise.
- Parameters:
config (
Go2VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go2State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and privileged critic tensors, in that order.
- embodichain_tasks.locomotion.velocity.contracts.go2.mdp.compute_rewards(config, state, terminated)[source]#
Compute the official Go2 reward terms and dt-scaled total.
- Parameters:
config (
Go2VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go2State) – Batched physical state in the task schema and its declared coordinate frames.terminated (
Tensor) – Boolean failure mask for each environment before time-limit truncation.
- Return type:
- Returns:
Raw terms, weighted terms, and the summed reward for each environment.
- embodichain_tasks.locomotion.velocity.contracts.go2.mdp.compute_termination(config, state)[source]#
Compute Go2 tilt/contact termination and time-limit truncation.
- Parameters:
config (
Go2VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go2State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Failure and time-limit masks, respectively, with one value per environment.
- embodichain_tasks.locomotion.velocity.contracts.go2.mdp.termination_causes(state)[source]#
Return the individual Go2 failure conditions.
- Parameters:
state (
Go2State) – Batched physical state in the task schema and its declared coordinate frames.- Return type:
dict[str,Tensor]- Returns:
Named boolean failure masks with one value per environment.
Load the Unitree H1_2 velocity task configuration.
Classes:
Dimensions and timing used by the H1_2 velocity task. |
Functions:
Load H1_2 settings from the packaged task definition. |
- class embodichain_tasks.locomotion.velocity.contracts.h1_2.config.H12VelocityConfig[source]#
Bases:
objectDimensions and timing used by the H1_2 velocity task.
Methods:
__init__([data, joint_names, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
Attributes:
- __init__(data=<factory>, joint_names=<factory>, default_joint_position=<factory>, action_scale=<factory>, actor_observation_dim=<factory>, critic_observation_dim=<factory>, action_dim=<factory>, phase_period=<factory>, physics_dt=<factory>, control_dt=<factory>, max_episode_steps=<factory>)#
-
action_dim:
int#
-
action_scale:
tuple[float,...]#
-
actor_observation_dim:
int#
-
control_dt:
float#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
-
critic_observation_dim:
int#
-
data:
dict#
-
default_joint_position:
tuple[float,...]#
-
joint_names:
tuple[str,...]#
-
max_episode_steps:
int#
-
phase_period:
float#
-
physics_dt:
float#
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores all names starting with “__” (i.e. built-in methods).
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[str,Any]- Returns:
Converted dictionary mapping.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.
- embodichain_tasks.locomotion.velocity.contracts.h1_2.config.load_config()[source]#
Load H1_2 settings from the packaged task definition.
- Return type:
- Returns:
The robot task configuration loaded from the packaged task.json.
Observation, action, reward and done functions for H1_2 velocity.
Classes:
Raw, weighted and total H1_2 reward values. |
|
Physical tensors consumed only by the H1_2 velocity task. |
Functions:
|
Map H1_2 policy actions to default-offset joint targets. |
|
Build H1_2 actor and critic observations without random noise. |
|
Compute the official H1_2 reward terms and dt-scaled total. |
|
Compute H1_2 tilt termination and time-limit truncation. |
- class embodichain_tasks.locomotion.velocity.contracts.h1_2.mdp.H12Reward[source]#
Bases:
objectRaw, weighted and total H1_2 reward values.
Methods:
__init__(raw_terms, weighted_terms, total)Attributes:
- __init__(raw_terms, weighted_terms, total)#
-
raw_terms:
dict[str,Tensor]#
-
total:
Tensor#
-
weighted_terms:
dict[str,Tensor]#
- class embodichain_tasks.locomotion.velocity.contracts.h1_2.mdp.H12State[source]#
Bases:
objectPhysical tensors consumed only by the H1_2 velocity task.
Methods:
__init__(base_lin_vel_b, base_ang_vel_b, ...)Attributes:
- __init__(base_lin_vel_b, base_ang_vel_b, projected_gravity_b, command, joint_pos, joint_vel, joint_acc, action, last_action, episode_step, root_height, foot_height, foot_vel_w, foot_contact, foot_force_w, foot_air_time, first_foot_contact, soft_joint_lower, soft_joint_upper, reward_body_ang_vel_w, angular_momentum_w, self_collision_count, reward_command=None, reward_base_lin_vel_b=None, reward_base_ang_vel_b=None, orientation_projected_gravity_b=None)#
-
action:
Tensor#
-
angular_momentum_w:
Tensor#
-
base_ang_vel_b:
Tensor#
-
base_lin_vel_b:
Tensor#
-
command:
Tensor#
-
episode_step:
Tensor#
-
first_foot_contact:
Tensor#
-
foot_air_time:
Tensor#
-
foot_contact:
Tensor#
-
foot_force_w:
Tensor#
-
foot_height:
Tensor#
-
foot_vel_w:
Tensor#
-
joint_acc:
Tensor#
-
joint_pos:
Tensor#
-
joint_vel:
Tensor#
-
last_action:
Tensor#
-
orientation_projected_gravity_b:
Tensor|None= None#
-
projected_gravity_b:
Tensor#
-
reward_base_ang_vel_b:
Tensor|None= None#
-
reward_base_lin_vel_b:
Tensor|None= None#
-
reward_body_ang_vel_w:
Tensor#
-
reward_command:
Tensor|None= None#
-
root_height:
Tensor#
-
self_collision_count:
Tensor#
-
soft_joint_lower:
Tensor#
-
soft_joint_upper:
Tensor#
- embodichain_tasks.locomotion.velocity.contracts.h1_2.mdp.action_target(config, action)[source]#
Map H1_2 policy actions to default-offset joint targets.
- Parameters:
config (
H12VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.action (
Tensor) – Policy actions with one row per environment and one column per controlled joint.
- Return type:
Tensor- Returns:
Default-offset joint position targets in policy joint order.
- embodichain_tasks.locomotion.velocity.contracts.h1_2.mdp.build_observations(config, state)[source]#
Build H1_2 actor and critic observations without random noise.
- Parameters:
config (
H12VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
H12State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and privileged critic tensors, in that order.
- embodichain_tasks.locomotion.velocity.contracts.h1_2.mdp.compute_rewards(config, state, terminated)[source]#
Compute the official H1_2 reward terms and dt-scaled total.
- Parameters:
config (
H12VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
H12State) – Batched physical state in the task schema and its declared coordinate frames.terminated (
Tensor) – Boolean failure mask for each environment before time-limit truncation.
- Return type:
- Returns:
Raw terms, weighted terms, and the summed reward for each environment.
- embodichain_tasks.locomotion.velocity.contracts.h1_2.mdp.compute_termination(config, state)[source]#
Compute H1_2 tilt termination and time-limit truncation.
- Parameters:
config (
H12VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
H12State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Failure and time-limit masks, respectively, with one value per environment.
Load the Pollen Robotics MicroDuck velocity task configuration.
Classes:
Dimensions and timing used by the MicroDuck velocity task. |
Functions:
Load MicroDuck settings from its packaged task definition. |
- class embodichain_tasks.locomotion.velocity.contracts.microduck.config.MicroDuckVelocityConfig[source]#
Bases:
objectDimensions and timing used by the MicroDuck velocity task.
Methods:
__init__([data, joint_names, ...])copy(**kwargs)Return a new object replacing specified fields with new values.
replace(**kwargs)Return a new object replacing specified fields with new values.
to_dict()Convert an object into dictionary recursively.
validate([prefix])Check the validity of configclass object.
Attributes:
- __init__(data=<factory>, joint_names=<factory>, default_joint_position=<factory>, action_scale=<factory>, actor_observation_dim=<factory>, critic_observation_dim=<factory>, action_dim=<factory>, phase_period=<factory>, physics_dt=<factory>, control_dt=<factory>, max_episode_steps=<factory>)#
-
action_dim:
int#
-
action_scale:
tuple[float,...]#
-
actor_observation_dim:
int#
-
control_dt:
float#
- copy(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
-
critic_observation_dim:
int#
-
data:
dict#
-
default_joint_position:
tuple[float,...]#
-
joint_names:
tuple[str,...]#
-
max_episode_steps:
int#
-
phase_period:
float#
-
physics_dt:
float#
- replace(**kwargs)#
Return a new object replacing specified fields with new values.
This is especially useful for frozen classes. Example usage:
@configclass(frozen=True) class C: x: int y: int c = C(1, 2) c1 = c.replace(x=3) assert c1.x == 3 and c1.y == 2
- Parameters:
obj (
object) – The object to replace.**kwargs – The fields to replace and their new values.
- Return type:
object- Returns:
The new object.
- to_dict()#
Convert an object into dictionary recursively.
Note
Ignores all names starting with “__” (i.e. built-in methods).
- Parameters:
obj (
object) – An instance of a class to convert.- Raises:
ValueError – When input argument is not an object.
- Return type:
dict[str,Any]- Returns:
Converted dictionary mapping.
- validate(prefix='')#
Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING entries.
- Parameters:
obj (
object) – The object to check.prefix (
str) – The prefix to add to the missing fields. Defaults to ‘’.
- Return type:
list[str]- Returns:
A list of missing fields.
- Raises:
TypeError – When the object is not a valid configuration object.
- embodichain_tasks.locomotion.velocity.contracts.microduck.config.load_config()[source]#
Load MicroDuck settings from its packaged task definition.
- Return type:
- Returns:
Joint order, default pose, action scale, observation dimensions and timing.
- Raises:
ValueError – Joint, default-pose and action dimensions differ.
Observation, action, reward and done functions for MicroDuck velocity.
Classes:
Raw, weighted and total MicroDuck reward values. |
|
Physical tensors consumed only by the MicroDuck velocity task. |
Functions:
|
Map MicroDuck policy actions to default-offset joint targets. |
|
Build MicroDuck actor and critic observations without random noise. |
|
Compute the official MicroDuck reward terms and dt-scaled total. |
|
Compute MicroDuck tilt/contact/height termination and truncation. |
- class embodichain_tasks.locomotion.velocity.contracts.microduck.mdp.MicroDuckReward[source]#
Bases:
objectRaw, weighted and total MicroDuck reward values.
Methods:
__init__(raw_terms, weighted_terms, total)Attributes:
- __init__(raw_terms, weighted_terms, total)#
-
raw_terms:
dict[str,Tensor]#
-
total:
Tensor#
-
weighted_terms:
dict[str,Tensor]#
- class embodichain_tasks.locomotion.velocity.contracts.microduck.mdp.MicroDuckState[source]#
Bases:
objectPhysical tensors consumed only by the MicroDuck velocity task.
Methods:
__init__(base_lin_vel_b, base_ang_vel_b, ...)Attributes:
- __init__(base_lin_vel_b, base_ang_vel_b, projected_gravity_b, command, joint_pos, joint_vel, joint_acc, action, last_action, episode_step, root_height, illegal_contact_force, foot_height, foot_vel_w, foot_contact, foot_force_w, foot_air_time, first_foot_contact, soft_joint_lower, soft_joint_upper, reward_body_ang_vel_w, angular_momentum_w, self_collision_count, reward_command=None, reward_base_lin_vel_b=None, reward_base_ang_vel_b=None, orientation_projected_gravity_b=None)#
-
action:
Tensor#
-
angular_momentum_w:
Tensor#
-
base_ang_vel_b:
Tensor#
-
base_lin_vel_b:
Tensor#
-
command:
Tensor#
-
episode_step:
Tensor#
-
first_foot_contact:
Tensor#
-
foot_air_time:
Tensor#
-
foot_contact:
Tensor#
-
foot_force_w:
Tensor#
-
foot_height:
Tensor#
-
foot_vel_w:
Tensor#
-
illegal_contact_force:
Tensor#
-
joint_acc:
Tensor#
-
joint_pos:
Tensor#
-
joint_vel:
Tensor#
-
last_action:
Tensor#
-
orientation_projected_gravity_b:
Tensor|None= None#
-
projected_gravity_b:
Tensor#
-
reward_base_ang_vel_b:
Tensor|None= None#
-
reward_base_lin_vel_b:
Tensor|None= None#
-
reward_body_ang_vel_w:
Tensor#
-
reward_command:
Tensor|None= None#
-
root_height:
Tensor#
-
self_collision_count:
Tensor#
-
soft_joint_lower:
Tensor#
-
soft_joint_upper:
Tensor#
- embodichain_tasks.locomotion.velocity.contracts.microduck.mdp.action_target(config, action)[source]#
Map MicroDuck policy actions to default-offset joint targets.
- Parameters:
config (
MicroDuckVelocityConfig) – Task joint, observation, reward and timing settings.action (
Tensor) – Normalized policy actions in configured joint order.
- Return type:
Tensor- Returns:
Joint-position targets with the configured default pose and action scale.
- embodichain_tasks.locomotion.velocity.contracts.microduck.mdp.build_observations(config, state)[source]#
Build MicroDuck actor and critic observations without random noise.
- Parameters:
config (
MicroDuckVelocityConfig) – Task joint, observation, reward and timing settings.state (
MicroDuckState) – Batched task state in the configured joint and body order.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and critic observation tensors, each with one row per environment.
- embodichain_tasks.locomotion.velocity.contracts.microduck.mdp.compute_rewards(config, state, terminated)[source]#
Compute the official MicroDuck reward terms and dt-scaled total.
- Parameters:
config (
MicroDuckVelocityConfig) – Task joint, observation, reward and timing settings.state (
MicroDuckState) – Batched task state in the configured joint and body order.terminated (
Tensor) – Failure mask used by configured reward terms.
- Return type:
- Returns:
Raw terms, weighted terms scaled by control timestep, and their total.
- embodichain_tasks.locomotion.velocity.contracts.microduck.mdp.compute_termination(config, state)[source]#
Compute MicroDuck tilt/contact/height termination and truncation.
- Parameters:
config (
MicroDuckVelocityConfig) – Task joint, observation, reward and timing settings.state (
MicroDuckState) – Batched task state in the configured joint and body order.
- Return type:
tuple[Tensor,Tensor]- Returns:
Per-environment failure and episode-timeout masks.
Unitree G1 flat-ground velocity task.
Classes:
Track planar velocity commands with the 29-DOF G1 model. |
- class embodichain_tasks.locomotion.velocity.g1_flat.UnitreeG1FlatEnv[source]#
Bases:
EmbodiChainVelocityEnvTrack planar velocity commands with the 29-DOF G1 model.
Methods:
build_observations_fn(state)Build G1 actor and critic observations without random noise.
compute_rewards_fn(state, terminated)Compute the official G1 reward terms and dt-scaled total.
compute_termination_fn(state)Compute G1 tilt termination and time-limit truncation.
corrupt_actor_fn(actor, generator)Apply the task-defined actor observation noise.
Attributes:
Classes:
alias of
G1State- action_manager: ActionManager | None#
- static build_observations_fn(state)#
Build G1 actor and critic observations without random noise.
- Parameters:
config (
G1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
G1State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and privileged critic tensors, in that order.
- static compute_rewards_fn(state, terminated)#
Compute the official G1 reward terms and dt-scaled total.
- Parameters:
config (
G1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
G1State) – Batched physical state in the task schema and its declared coordinate frames.terminated (
Tensor) – Boolean failure mask for each environment before time-limit truncation.
- Return type:
- Returns:
Raw terms, weighted terms, and the summed reward for each environment.
- static compute_termination_fn(state)#
Compute G1 tilt termination and time-limit truncation.
- Parameters:
config (
G1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
G1State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Failure and time-limit masks, respectively, with one value per environment.
- static corrupt_actor_fn(actor, generator)[source]#
Apply the task-defined actor observation noise.
- Parameters:
actor (
Tensor) – Actor observation tensor to corrupt in place.generator (
Generator) – Random generator used to sample the task noise or delays.
- Return type:
Tensor- Returns:
The actor observation tensor after adding the configured noise.
- dataset_manager: DatasetManager | None#
- episode_success_status: torch.Tensor#
- event_manager: EventManager | None#
- foot_link_names: tuple[str, ...] = ('left_ankle_roll_link', 'right_ankle_roll_link')#
- foot_offsets: tuple[tuple[float, float, float], ...] = ((0.04, 0.0, -0.035), (0.04, 0.0, -0.035))#
- observation_manager: ObservationManager | None#
- orientation_link_name: str | None = 'torso_link'#
- reward_manager: RewardManager | None#
- rollout_buffer: TensorDict | None#
- velocity_task_config: Any = G1VelocityConfig(data={'schema': 'unitree-velocity-task', 'official_task': 'Unitree-G1-Flat', 'physics': {'physics_dt': 0.005, 'control_dt': 0.02, 'decimation': 4, 'episode_length_s': 20.0, 'reference_task': 'Isaac Lab G1 velocity: G1_MINIMAL_CFG -> G1_CFG', 'default_backend_mapping': {'solver_position_iterations': 8, 'solver_velocity_iterations': 4}, 'mujoco': {'timestep': 0.005, 'integrator': 'implicitfast', 'impratio': 1.0, 'cone': 'pyramidal', 'jacobian': 'auto', 'solver': 'newton', 'iterations': 10, 'tolerance': 1e-08, 'ls_iterations': 20, 'ls_tolerance': 0.01, 'ccd_iterations': 50, 'gravity': [0.0, 0.0, -9.81], 'multiccd': False}}, 'robot': {'joint_names': ['left_hip_pitch_joint', 'left_hip_roll_joint', 'left_hip_yaw_joint', 'left_knee_joint', 'left_ankle_pitch_joint', 'left_ankle_roll_joint', 'right_hip_pitch_joint', 'right_hip_roll_joint', 'right_hip_yaw_joint', 'right_knee_joint', 'right_ankle_pitch_joint', 'right_ankle_roll_joint', 'waist_yaw_joint', 'waist_roll_joint', 'waist_pitch_joint', 'left_shoulder_pitch_joint', 'left_shoulder_roll_joint', 'left_shoulder_yaw_joint', 'left_elbow_joint', 'left_wrist_roll_joint', 'left_wrist_pitch_joint', 'left_wrist_yaw_joint', 'right_shoulder_pitch_joint', 'right_shoulder_roll_joint', 'right_shoulder_yaw_joint', 'right_elbow_joint', 'right_wrist_roll_joint', 'right_wrist_pitch_joint', 'right_wrist_yaw_joint'], 'body_names': ['pelvis', 'left_hip_pitch_link', 'left_hip_roll_link', 'left_hip_yaw_link', 'left_knee_link', 'left_ankle_pitch_link', 'left_ankle_roll_link', 'right_hip_pitch_link', 'right_hip_roll_link', 'right_hip_yaw_link', 'right_knee_link', 'right_ankle_pitch_link', 'right_ankle_roll_link', 'waist_yaw_link', 'waist_roll_link', 'torso_link', 'left_shoulder_pitch_link', 'left_shoulder_roll_link', 'left_shoulder_yaw_link', 'left_elbow_link', 'left_wrist_roll_link', 'left_wrist_pitch_link', 'left_wrist_yaw_link', 'right_shoulder_pitch_link', 'right_shoulder_roll_link', 'right_shoulder_yaw_link', 'right_elbow_link', 'right_wrist_roll_link', 'right_wrist_pitch_link', 'right_wrist_yaw_link'], 'root_position': [0.0, 0.0, 0.8], 'root_quaternion_wxyz': [1.0, 0.0, 0.0, 0.0], 'default_joint_position': [-0.1, 0.0, 0.0, 0.3, -0.2, 0.0, -0.1, 0.0, 0.0, 0.3, -0.2, 0.0, 0.0, 0.0, 0.0, 0.35, 0.18, 0.0, 0.87, 0.0, 0.0, 0.0, 0.35, -0.18, 0.0, 0.87, 0.0, 0.0, 0.0], 'action_scale': [0.5475464629911068, 0.35066146637882434, 0.5475464629911068, 0.35066146637882434, 0.43857731392336724, 0.43857731392336724, 0.5475464629911068, 0.35066146637882434, 0.5475464629911068, 0.35066146637882434, 0.43857731392336724, 0.43857731392336724, 0.5475464629911068, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.07450087032950714, 0.07450087032950714, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.07450087032950714, 0.07450087032950714], 'stiffness': [40.17923863450712, 99.09842777666111, 40.17923863450712, 99.09842777666111, 28.50124619574858, 28.50124619574858, 40.17923863450712, 99.09842777666111, 40.17923863450712, 99.09842777666111, 28.50124619574858, 28.50124619574858, 40.17923863450712, 28.50124619574858, 28.50124619574858, 14.25062309787429, 14.25062309787429, 14.25062309787429, 14.25062309787429, 14.25062309787429, 16.77832748089279, 16.77832748089279, 14.25062309787429, 14.25062309787429, 14.25062309787429, 14.25062309787429, 14.25062309787429, 16.77832748089279, 16.77832748089279], 'damping': [2.557889775413375, 6.308801853496639, 2.557889775413375, 6.308801853496639, 1.814445686584846, 1.814445686584846, 2.557889775413375, 6.308801853496639, 2.557889775413375, 6.308801853496639, 1.814445686584846, 1.814445686584846, 2.557889775413375, 1.814445686584846, 1.814445686584846, 0.907222843292423, 0.907222843292423, 0.907222843292423, 0.907222843292423, 0.907222843292423, 1.06814150219, 1.06814150219, 0.907222843292423, 0.907222843292423, 0.907222843292423, 0.907222843292423, 0.907222843292423, 1.06814150219, 1.06814150219], 'armature': [0.01017752004132231, 0.025101924999999997, 0.01017752004132231, 0.025101924999999997, 0.00721945, 0.00721945, 0.01017752004132231, 0.025101924999999997, 0.01017752004132231, 0.025101924999999997, 0.00721945, 0.00721945, 0.01017752004132231, 0.00721945, 0.00721945, 0.003609725, 0.003609725, 0.003609725, 0.003609725, 0.003609725, 0.00425, 0.00425, 0.003609725, 0.003609725, 0.003609725, 0.003609725, 0.003609725, 0.00425, 0.00425], 'effort_limit': [88.0, 139.0, 88.0, 139.0, 50.0, 50.0, 88.0, 139.0, 88.0, 139.0, 50.0, 50.0, 88.0, 50.0, 50.0, 25.0, 25.0, 25.0, 25.0, 25.0, 5.0, 5.0, 25.0, 25.0, 25.0, 25.0, 25.0, 5.0, 5.0], 'velocity_limit': [32.0, 20.0, 32.0, 20.0, 37.0, 37.0, 32.0, 20.0, 32.0, 20.0, 37.0, 37.0, 32.0, 37.0, 37.0, 37.0, 37.0, 37.0, 37.0, 37.0, 22.0, 22.0, 37.0, 37.0, 37.0, 37.0, 37.0, 22.0, 22.0], 'soft_joint_position_limit_factor': 0.9, 'collision_configuration': [{'geom_names_expr': ['.*_collision'], 'contype': 1, 'conaffinity': 1, 'condim': {'^(left|right)_foot[1-7]_collision$': 3, '.*_collision': 1}, 'priority': {'^(left|right)_foot[1-7]_collision$': 1}, 'friction': {'^(left|right)_foot[1-7]_collision$': [0.6]}, 'solref': None, 'solimp': None, 'disable_other_geoms': True}]}, 'observations': {'actor_dimension': 98, 'actor': {'terms': {'base_ang_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_ang_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.2, 'n_max': 0.2}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'projected_gravity': {'func': 'mjlab.envs.mdp.observations.projected_gravity', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.05, 'n_max': 0.05}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'command': {'func': 'mjlab.envs.mdp.observations.generated_commands', 'params': {'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'phase': {'func': 'src.tasks.velocity.mdp.observations.phase', 'params': {'period': 0.6, 'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_pos': {'func': 'mjlab.envs.mdp.observations.joint_pos_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.01, 'n_max': 0.01}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_vel': {'func': 'mjlab.envs.mdp.observations.joint_vel_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -1.5, 'n_max': 1.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'actions': {'func': 'mjlab.envs.mdp.observations.last_action', 'params': {}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}}, 'concatenate_terms': True, 'concatenate_dim': -1, 'enable_corruption': True, 'history_length': 1, 'flatten_history_dim': True, 'nan_policy': 'disabled', 'nan_check_per_term': True}, 'critic': {'terms': {'base_ang_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_ang_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.2, 'n_max': 0.2}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'projected_gravity': {'func': 'mjlab.envs.mdp.observations.projected_gravity', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.05, 'n_max': 0.05}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'command': {'func': 'mjlab.envs.mdp.observations.generated_commands', 'params': {'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'phase': {'func': 'src.tasks.velocity.mdp.observations.phase', 'params': {'period': 0.6, 'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_pos': {'func': 'mjlab.envs.mdp.observations.joint_pos_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.01, 'n_max': 0.01}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_vel': {'func': 'mjlab.envs.mdp.observations.joint_vel_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -1.5, 'n_max': 1.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'actions': {'func': 'mjlab.envs.mdp.observations.last_action', 'params': {}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'base_lin_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_lin_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.5, 'n_max': 0.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_height': {'func': 'src.tasks.velocity.mdp.observations.foot_height', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['left_foot', 'right_foot'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_air_time': {'func': 'src.tasks.velocity.mdp.observations.foot_air_time', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_contact': {'func': 'src.tasks.velocity.mdp.observations.foot_contact', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_contact_forces': {'func': 'src.tasks.velocity.mdp.observations.foot_contact_forces', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}}, 'concatenate_terms': True, 'concatenate_dim': -1, 'enable_corruption': False, 'history_length': 1, 'flatten_history_dim': True, 'nan_policy': 'disabled', 'nan_check_per_term': True}}, 'actions': {'joint_pos': {'entity_name': 'robot', 'clip': None, 'transmission_type': 'joint', 'actuator_names': ['.*'], 'scale': {'.*_elbow_joint': 0.43857731392336724, '.*_shoulder_pitch_joint': 0.43857731392336724, '.*_shoulder_roll_joint': 0.43857731392336724, '.*_shoulder_yaw_joint': 0.43857731392336724, '.*_wrist_roll_joint': 0.43857731392336724, '.*_hip_pitch_joint': 0.5475464629911068, '.*_hip_yaw_joint': 0.5475464629911068, 'waist_yaw_joint': 0.5475464629911068, '.*_hip_roll_joint': 0.35066146637882434, '.*_knee_joint': 0.35066146637882434, '.*_wrist_pitch_joint': 0.07450087032950714, '.*_wrist_yaw_joint': 0.07450087032950714, 'waist_pitch_joint': 0.43857731392336724, 'waist_roll_joint': 0.43857731392336724, '.*_ankle_pitch_joint': 0.43857731392336724, '.*_ankle_roll_joint': 0.43857731392336724}, 'offset': 0.0, 'preserve_order': False, 'use_default_offset': True}}, 'commands': {'twist': {'resampling_time_range': [3.0, 8.0], 'debug_vis': True, 'entity_name': 'robot', 'heading_command': True, 'heading_control_stiffness': 0.5, 'rel_standing_envs': 0.05, 'rel_heading_envs': 1.0, 'init_velocity_prob': 0.0, 'ranges': {'lin_vel_x': [-1.0, 2.0], 'lin_vel_y': [-1.0, 1.0], 'ang_vel_z': [-1.0, 1.0], 'heading': [-3.141592653589793, 3.141592653589793]}, 'viz': {'z_offset': 1.15, 'scale': 0.5}}}, 'rewards': {'track_linear_velocity': {'func': 'src.tasks.velocity.mdp.rewards.track_linear_velocity', 'params': {'command_name': 'twist', 'std': 0.5}, 'weight': 1.0}, 'track_angular_velocity': {'func': 'src.tasks.velocity.mdp.rewards.track_angular_velocity', 'params': {'command_name': 'twist', 'std': 0.7071067811865476}, 'weight': 1.0}, 'body_orientation_l2': {'func': 'src.tasks.velocity.mdp.rewards.body_orientation_l2', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['torso_link'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'pose': {'func': 'src.tasks.velocity.mdp.rewards.variable_posture', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': '.*', 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'command_name': 'twist', 'std_standing': {'.*': 0.05}, 'std_walking': {'.*hip_pitch.*': 0.5, '.*hip_roll.*': 0.15, '.*hip_yaw.*': 0.15, '.*knee.*': 0.5, '.*ankle_pitch.*': 0.15, '.*ankle_roll.*': 0.1, '.*waist_yaw.*': 0.15, '.*waist_roll.*': 0.1, '.*waist_pitch.*': 0.1, '.*shoulder_pitch.*': 0.15, '.*shoulder_roll.*': 0.1, '.*shoulder_yaw.*': 0.1, '.*elbow.*': 0.1, '.*wrist.*': 0.1}, 'std_running': {'.*hip_pitch.*': 0.5, '.*hip_roll.*': 0.25, '.*hip_yaw.*': 0.25, '.*knee.*': 0.5, '.*ankle_pitch.*': 0.25, '.*ankle_roll.*': 0.1, '.*waist_yaw.*': 0.25, '.*waist_roll.*': 0.1, '.*waist_pitch.*': 0.1, '.*shoulder_pitch.*': 0.25, '.*shoulder_roll.*': 0.1, '.*shoulder_yaw.*': 0.1, '.*elbow.*': 0.1, '.*wrist.*': 0.1}, 'walking_threshold': 0.1, 'running_threshold': 1.5}, 'weight': 1.0}, 'body_ang_vel': {'func': 'src.tasks.velocity.mdp.rewards.body_angular_velocity_penalty', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['torso_link'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -0.05}, 'angular_momentum': {'func': 'src.tasks.velocity.mdp.rewards.angular_momentum_penalty', 'params': {'sensor_name': 'robot/root_angmom'}, 'weight': -0.025}, 'is_terminated': {'func': 'mjlab.envs.mdp.rewards.is_terminated', 'params': {}, 'weight': -200.0}, 'joint_acc_l2': {'func': 'mjlab.envs.mdp.rewards.joint_acc_l2', 'params': {}, 'weight': -2.5e-07}, 'joint_pos_limits': {'func': 'mjlab.envs.mdp.rewards.joint_pos_limits', 'params': {}, 'weight': -10.0}, 'action_rate_l2': {'func': 'mjlab.envs.mdp.rewards.action_rate_l2', 'params': {}, 'weight': -0.05}, 'foot_gait': {'func': 'src.tasks.velocity.mdp.rewards.feet_gait', 'params': {'period': 0.6, 'offset': [0.0, 0.5], 'threshold': 0.56, 'command_threshold': 0.1, 'command_name': 'twist', 'sensor_name': 'feet_ground_contact'}, 'weight': 0.5}, 'foot_clearance': {'func': 'src.tasks.velocity.mdp.rewards.feet_clearance', 'params': {'target_height': 0.1, 'command_name': 'twist', 'command_threshold': 0.1, 'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['left_foot', 'right_foot'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'foot_slip': {'func': 'src.tasks.velocity.mdp.rewards.feet_slip', 'params': {'sensor_name': 'feet_ground_contact', 'command_name': 'twist', 'command_threshold': 0.1, 'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['left_foot', 'right_foot'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -0.25}, 'soft_landing': {'func': 'src.tasks.velocity.mdp.rewards.soft_landing', 'params': {'sensor_name': 'feet_ground_contact', 'command_name': 'twist', 'command_threshold': 0.1}, 'weight': -0.001}, 'stand_still': {'func': 'src.tasks.velocity.mdp.rewards.stand_still', 'params': {'command_name': 'twist', 'command_threshold': 0.1, 'asset_cfg': {'name': 'robot', 'joint_names': '.*', 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'self_collisions': {'func': 'mjlab.tasks.velocity.mdp.rewards.self_collision_cost', 'params': {'sensor_name': 'self_collision', 'force_threshold': 10.0}, 'weight': -1.0}}, 'terminations': {'time_out': {'func': 'mjlab.envs.mdp.terminations.time_out', 'params': {}, 'time_out': True}, 'fell_over': {'func': 'mjlab.envs.mdp.terminations.bad_orientation', 'params': {'limit_angle': 1.2217304763960306}, 'time_out': False}}, 'events': {'reset_base': {'func': 'mjlab.envs.mdp.events.reset_root_state_uniform', 'params': {'pose_range': {'x': [-0.5, 0.5], 'y': [-0.5, 0.5], 'z': [0.0, 0.0], 'yaw': [-3.14, 3.14]}, 'velocity_range': {}}, 'mode': 'reset', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'reset_robot_joints': {'func': 'mjlab.envs.mdp.events.reset_joints_by_offset', 'params': {'position_range': [-0.0, 0.0], 'velocity_range': [-0.0, 0.0], 'asset_cfg': {'name': 'robot', 'joint_names': ['.*'], 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'mode': 'reset', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'push_robot': {'func': 'mjlab.envs.mdp.events.push_by_setting_velocity', 'params': {'velocity_range': {'x': [-0.5, 0.5], 'y': [-0.5, 0.5], 'z': [-0.4, 0.4], 'roll': [-0.52, 0.52], 'pitch': [-0.52, 0.52], 'yaw': [-0.78, 0.78]}}, 'mode': 'interval', 'interval_range_s': [5.0, 6.0], 'is_global_time': False, 'min_step_count_between_reset': 0}, 'foot_friction': {'func': 'mjlab.envs.mdp.dr.geom.geom_friction', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': ['left_foot1_collision', 'left_foot2_collision', 'left_foot3_collision', 'left_foot4_collision', 'left_foot5_collision', 'left_foot6_collision', 'left_foot7_collision', 'right_foot1_collision', 'right_foot2_collision', 'right_foot3_collision', 'right_foot4_collision', 'right_foot5_collision', 'right_foot6_collision', 'right_foot7_collision'], 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'operation': 'abs', 'ranges': [0.3, 1.6], 'shared_random': True}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'encoder_bias': {'func': 'mjlab.envs.mdp.dr.joint.encoder_bias', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'bias_range': [-0.015, 0.015]}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'base_com': {'func': 'mjlab.envs.mdp.dr.body.body_com_offset', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['torso_link'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'operation': 'add', 'ranges': {'0': [-0.05, 0.05], '1': [-0.05, 0.05], '2': [-0.05, 0.05]}}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}}, 'curriculum': {'command_vel': {'func': 'src.tasks.velocity.mdp.curriculums.commands_vel', 'params': {'command_name': 'twist', 'velocity_stages': [{'step': 0, 'lin_vel_x': [-0.5, 1.0], 'lin_vel_y': [-0.5, 0.5], 'ang_vel_z': [-1.0, 1.0]}, {'step': 120000, 'lin_vel_x': [-1.0, 2.0], 'lin_vel_y': [-1.0, 1.0]}]}}}, 'ppo': {'seed': 42, 'num_steps_per_env': 24, 'max_iterations': 10001, 'obs_groups': {'actor': ['actor'], 'critic': ['critic']}, 'save_interval': 100, 'experiment_name': 'g1_velocity', 'run_name': '', 'logger': 'wandb', 'wandb_project': 'mjlab', 'wandb_tags': [], 'resume': False, 'load_run': '.*', 'load_checkpoint': 'model_.*.pt', 'clip_actions': None, 'upload_model': True, 'class_name': 'OnPolicyRunner', 'actor': {'hidden_dims': [512, 256, 128], 'activation': 'elu', 'obs_normalization': True, 'cnn_cfg': None, 'distribution_cfg': {'class_name': 'GaussianDistribution', 'init_std': 1.0, 'std_type': 'scalar'}, 'class_name': 'MLPModel'}, 'critic': {'hidden_dims': [512, 256, 128], 'activation': 'elu', 'obs_normalization': True, 'cnn_cfg': None, 'distribution_cfg': None, 'class_name': 'MLPModel'}, 'algorithm': {'num_learning_epochs': 5, 'num_mini_batches': 4, 'learning_rate': 0.001, 'schedule': 'adaptive', 'gamma': 0.99, 'lam': 0.95, 'entropy_coef': 0.01, 'desired_kl': 0.01, 'max_grad_norm': 1.0, 'value_loss_coef': 1.0, 'use_clipped_value_loss': True, 'clip_param': 0.2, 'normalize_advantage_per_mini_batch': False, 'optimizer': 'adam', 'share_cnn_encoders': False, 'class_name': 'PPO'}}}, joint_names=('left_hip_pitch_joint', 'left_hip_roll_joint', 'left_hip_yaw_joint', 'left_knee_joint', 'left_ankle_pitch_joint', 'left_ankle_roll_joint', 'right_hip_pitch_joint', 'right_hip_roll_joint', 'right_hip_yaw_joint', 'right_knee_joint', 'right_ankle_pitch_joint', 'right_ankle_roll_joint', 'waist_yaw_joint', 'waist_roll_joint', 'waist_pitch_joint', 'left_shoulder_pitch_joint', 'left_shoulder_roll_joint', 'left_shoulder_yaw_joint', 'left_elbow_joint', 'left_wrist_roll_joint', 'left_wrist_pitch_joint', 'left_wrist_yaw_joint', 'right_shoulder_pitch_joint', 'right_shoulder_roll_joint', 'right_shoulder_yaw_joint', 'right_elbow_joint', 'right_wrist_roll_joint', 'right_wrist_pitch_joint', 'right_wrist_yaw_joint'), default_joint_position=(-0.1, 0.0, 0.0, 0.3, -0.2, 0.0, -0.1, 0.0, 0.0, 0.3, -0.2, 0.0, 0.0, 0.0, 0.0, 0.35, 0.18, 0.0, 0.87, 0.0, 0.0, 0.0, 0.35, -0.18, 0.0, 0.87, 0.0, 0.0, 0.0), action_scale=(0.5475464629911068, 0.35066146637882434, 0.5475464629911068, 0.35066146637882434, 0.43857731392336724, 0.43857731392336724, 0.5475464629911068, 0.35066146637882434, 0.5475464629911068, 0.35066146637882434, 0.43857731392336724, 0.43857731392336724, 0.5475464629911068, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.07450087032950714, 0.07450087032950714, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.43857731392336724, 0.07450087032950714, 0.07450087032950714), actor_observation_dim=98, critic_observation_dim=113, action_dim=29, phase_period=0.6, physics_dt=0.005, control_dt=0.02, max_episode_steps=1000)#
Unitree Go1 flat-ground velocity task.
Classes:
Track planar velocity commands with the 12-DOF Go1 model. |
- class embodichain_tasks.locomotion.velocity.go1_flat.UnitreeGo1FlatEnv[source]#
Bases:
EmbodiChainVelocityEnvTrack planar velocity commands with the 12-DOF Go1 model.
Methods:
build_observations_fn(state)Build the official 48-value actor and 72-value asymmetric critic inputs.
compute_rewards_fn(state, terminated)Compute the official Go1 flat-velocity reward terms.
compute_termination_fn(state)Compute failure termination and time-limit truncation.
corrupt_actor_fn(actor, generator)Apply the task-defined actor observation noise.
Attributes:
Classes:
alias of
Go1State- action_manager: ActionManager | None#
- static build_observations_fn(state)#
Build the official 48-value actor and 72-value asymmetric critic inputs.
- Parameters:
config (
Go1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go1State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and privileged critic tensors, in that order.
- static compute_rewards_fn(state, terminated)#
Compute the official Go1 flat-velocity reward terms.
- Parameters:
config (
Go1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go1State) – Batched physical state in the task schema and its declared coordinate frames.terminated (
Tensor) – Boolean failure mask for each environment before time-limit truncation.
- Return type:
- Returns:
Raw terms, weighted terms, and the summed reward for each environment.
- static compute_termination_fn(state)#
Compute failure termination and time-limit truncation.
- Parameters:
config (
Go1VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go1State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Failure and time-limit masks, respectively, with one value per environment.
- static corrupt_actor_fn(actor, generator)[source]#
Apply the task-defined actor observation noise.
- Parameters:
actor (
Tensor) – Actor observation tensor to corrupt in place.generator (
Generator) – Random generator used to sample the task noise or delays.
- Return type:
Tensor- Returns:
The actor observation tensor after adding the configured noise.
- dataset_manager: DatasetManager | None#
- episode_success_status: torch.Tensor#
- event_manager: EventManager | None#
- foot_link_names: tuple[str, ...] = ('FR_foot', 'FL_foot', 'RR_foot', 'RL_foot')#
- foot_offsets: tuple[tuple[float, float, float], ...] = ((0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0), (0.0, 0.0, 0.0))#
- illegal_contact_link_names: tuple[str, ...] = ('trunk', 'FR_hip', 'FR_thigh', 'FR_calf', 'FL_hip', 'FL_thigh', 'FL_calf', 'RR_hip', 'RR_thigh', 'RR_calf', 'RL_hip', 'RL_thigh', 'RL_calf')#
- observation_manager: ObservationManager | None#
- orientation_link_name: str | None = 'trunk'#
- reward_manager: RewardManager | None#
- rollout_buffer: TensorDict | None#
- velocity_task_config: Any = Go1VelocityConfig(data={'schema': 'unitree-velocity-task', 'official_task': 'Mjlab-Velocity-Flat-Unitree-Go1', 'physics': {'physics_dt': 0.005, 'control_dt': 0.02, 'decimation': 4, 'episode_length_s': 20.0, 'default_backend_mapping': {'solver_position_iterations': 4, 'solver_velocity_iterations': 0}, 'mujoco': {'integrator': 'implicitfast', 'solver': 'newton', 'iterations': 10, 'line_search_iterations': 20, 'tolerance': 1e-08, 'ccd_iterations': 50}}, 'robot': {'root_body': 'trunk', 'root_height': 0.278, 'joint_names': ['FR_hip_joint', 'FR_thigh_joint', 'FR_calf_joint', 'FL_hip_joint', 'FL_thigh_joint', 'FL_calf_joint', 'RR_hip_joint', 'RR_thigh_joint', 'RR_calf_joint', 'RL_hip_joint', 'RL_thigh_joint', 'RL_calf_joint'], 'default_joint_position': [0.1, 0.9, -1.8, -0.1, 0.9, -1.8, 0.1, 0.9, -1.8, -0.1, 0.9, -1.8], 'action_scale': [0.3727530386870487, 0.3727530386870487, 0.24850202579136574, 0.3727530386870487, 0.3727530386870487, 0.24850202579136574, 0.3727530386870487, 0.3727530386870487, 0.24850202579136574, 0.3727530386870487, 0.3727530386870487, 0.24850202579136574], 'stiffness': [15.895242654143557, 15.895242654143557, 35.76429597182301, 15.895242654143557, 15.895242654143557, 35.76429597182301, 15.895242654143557, 15.895242654143557, 35.76429597182301, 15.895242654143557, 15.895242654143557, 35.76429597182301], 'damping': [1.0119225760208341, 1.0119225760208341, 2.276825796046877, 1.0119225760208341, 1.0119225760208341, 2.276825796046877, 1.0119225760208341, 1.0119225760208341, 2.276825796046877, 1.0119225760208341, 1.0119225760208341, 2.276825796046877], 'armature': [0.004026312, 0.004026312, 0.009059202, 0.004026312, 0.004026312, 0.009059202, 0.004026312, 0.004026312, 0.009059202, 0.004026312, 0.004026312, 0.009059202], 'effort_limit': [23.7, 23.7, 35.55, 23.7, 23.7, 35.55, 23.7, 23.7, 35.55, 23.7, 23.7, 35.55], 'enable_self_collisions': False}, 'contact_contract': {'foot_site_names': ['FR', 'FL', 'RR', 'RL'], 'foot_geom_names': ['FR_foot_collision', 'FL_foot_collision', 'RR_foot_collision', 'RL_foot_collision'], 'collision_foot_body_names': ['FR_foot', 'FL_foot', 'RR_foot', 'RL_foot'], 'collision_nonfoot_body_names': ['trunk', 'FR_hip', 'FR_thigh', 'FR_calf', 'FL_hip', 'FL_thigh', 'FL_calf', 'RR_hip', 'RR_thigh', 'RR_calf', 'RL_hip', 'RL_thigh', 'RL_calf'], 'force_threshold': 10.0, 'history_substeps': 4}, 'observations': {'actor_dimension': 48, 'critic_dimension': 72, 'actor': {'terms': {'base_lin_vel': {'noise': {'n_min': -0.5, 'n_max': 0.5}}, 'base_ang_vel': {'noise': {'n_min': -0.2, 'n_max': 0.2}}, 'projected_gravity': {'noise': {'n_min': -0.05, 'n_max': 0.05}}, 'joint_pos': {'noise': {'n_min': -0.01, 'n_max': 0.01}}, 'joint_vel': {'noise': {'n_min': -1.5, 'n_max': 1.5}}, 'actions': {'noise': None}, 'command': {'noise': None}}}}, 'actions': {'joint_pos': {'use_default_offset': True}}, 'commands': {'twist': {'resampling_time_range': [3.0, 8.0], 'rel_standing_envs': 0.1, 'rel_heading_envs': 0.3, 'rel_forward_envs': 0.2, 'heading_command': True, 'heading_control_stiffness': 0.5, 'ranges': {'lin_vel_x': [-1.0, 1.0], 'lin_vel_y': [-1.0, 1.0], 'ang_vel_z': [-0.5, 0.5], 'heading': [-3.141592653589793, 3.141592653589793]}}}, 'events': {'reset_base': {'params': {'pose_range': {'x': [-0.5, 0.5], 'y': [-0.5, 0.5], 'z': [0.01, 0.05], 'yaw': [-3.14, 3.14]}, 'velocity_range': {}}}, 'reset_robot_joints': {'params': {'position_range': [0.0, 0.0], 'velocity_range': [0.0, 0.0]}}, 'push_robot': {'interval_range_s': [1.0, 3.0], 'params': {'velocity_range': {'x': [-0.5, 0.5], 'y': [-0.5, 0.5], 'z': [-0.4, 0.4], 'roll': [-0.52, 0.52], 'pitch': [-0.52, 0.52], 'yaw': [-0.78, 0.78]}}}, 'foot_friction_slide': {'params': {'asset_cfg': {'geom_names': ['FR_foot_collision', 'FL_foot_collision', 'RR_foot_collision', 'RL_foot_collision']}, 'ranges': [0.3, 1.5], 'shared_random': True}}, 'foot_friction_spin': {'params': {'ranges': [0.0001, 0.02], 'distribution': 'log_uniform', 'shared_random': True}}, 'foot_friction_roll': {'params': {'ranges': [1e-05, 0.005], 'distribution': 'log_uniform', 'shared_random': True}}, 'encoder_bias': {'params': {'bias_range': [-0.015, 0.015]}}, 'base_com': {'params': {'asset_cfg': {'body_names': ['trunk']}, 'ranges': {'0': [-0.025, 0.025], '1': [-0.025, 0.025], '2': [-0.03, 0.03]}}}}, 'rewards': {'track_linear_velocity': {'weight': 2.0, 'params': {'std': 0.5}}, 'track_angular_velocity': {'weight': 2.0, 'params': {'std': 0.7071067811865476}}, 'upright': {'weight': 1.0, 'params': {'std': 0.4472135954999579}}, 'pose': {'weight': 1.0, 'params': {'walking_threshold': 0.05, 'running_threshold': 1.5, 'std_standing': {'.*(FR|FL|RR|RL)_(hip|thigh)_joint.*': 0.05, '.*(FR|FL|RR|RL)_calf_joint.*': 0.1}, 'std_walking': {'.*(FR|FL|RR|RL)_(hip|thigh)_joint.*': 0.3, '.*(FR|FL|RR|RL)_calf_joint.*': 0.6}, 'std_running': {'.*(FR|FL|RR|RL)_(hip|thigh)_joint.*': 0.3, '.*(FR|FL|RR|RL)_calf_joint.*': 0.6}}}, 'dof_pos_limits': {'weight': -1.0}, 'action_rate_l2': {'weight': -0.1}, 'foot_clearance': {'weight': -2.0, 'params': {'target_height': 0.1, 'command_threshold': 0.05}}, 'foot_swing_height': {'weight': -0.25, 'params': {'target_height': 0.1, 'command_threshold': 0.05}}, 'foot_slip': {'weight': -0.1, 'params': {'command_threshold': 0.05}}, 'soft_landing': {'weight': -1e-05, 'params': {'command_threshold': 0.05}}}, 'terminations': {'fell_over': {'params': {'limit_angle': 1.2217304763960306}}}, 'curriculum': {'command_vel': {'params': {'velocity_stages': [{'step': 0, 'lin_vel_x': [-1.0, 1.0], 'ang_vel_z': [-0.5, 0.5]}, {'step': 120000, 'lin_vel_x': [-1.5, 2.0], 'ang_vel_z': [-0.7, 0.7]}, {'step': 240000, 'lin_vel_x': [-2.0, 3.0]}]}}}, 'ppo': {'seed': 42, 'num_steps_per_env': 24, 'max_iterations': 10000, 'save_interval': 50, 'policy': {'init_noise_std': 1.0, 'actor_obs_normalization': True, 'critic_obs_normalization': True, 'actor_hidden_dims': [512, 256, 128], 'critic_hidden_dims': [512, 256, 128], 'activation': 'elu'}, 'algorithm': {'class_name': 'PPO', 'num_learning_epochs': 5, 'num_mini_batches': 4, 'learning_rate': 0.001, 'schedule': 'adaptive', 'gamma': 0.99, 'lam': 0.95, 'entropy_coef': 0.01, 'desired_kl': 0.01, 'max_grad_norm': 1.0, 'value_loss_coef': 1.0, 'use_clipped_value_loss': True, 'clip_param': 0.2, 'normalize_advantage_per_mini_batch': False}}}, joint_names=('FR_hip_joint', 'FR_thigh_joint', 'FR_calf_joint', 'FL_hip_joint', 'FL_thigh_joint', 'FL_calf_joint', 'RR_hip_joint', 'RR_thigh_joint', 'RR_calf_joint', 'RL_hip_joint', 'RL_thigh_joint', 'RL_calf_joint'), default_joint_position=(0.1, 0.9, -1.8, -0.1, 0.9, -1.8, 0.1, 0.9, -1.8, -0.1, 0.9, -1.8), action_scale=(0.3727530386870487, 0.3727530386870487, 0.24850202579136574, 0.3727530386870487, 0.3727530386870487, 0.24850202579136574, 0.3727530386870487, 0.3727530386870487, 0.24850202579136574, 0.3727530386870487, 0.3727530386870487, 0.24850202579136574), actor_observation_dim=48, critic_observation_dim=72, action_dim=12, physics_dt=0.005, control_dt=0.02, max_episode_steps=1000)#
Unitree Go2 flat-ground velocity task.
Classes:
Track planar velocity commands with the 12-DOF Go2 model. |
- class embodichain_tasks.locomotion.velocity.go2_flat.UnitreeGo2FlatEnv[source]#
Bases:
EmbodiChainVelocityEnvTrack planar velocity commands with the 12-DOF Go2 model.
Methods:
build_observations_fn(state)Build Go2 actor and critic observations without random noise.
compute_rewards_fn(state, terminated)Compute the official Go2 reward terms and dt-scaled total.
compute_termination_fn(state)Compute Go2 tilt/contact termination and time-limit truncation.
corrupt_actor_fn(actor, generator)Apply the task-defined actor observation noise.
Attributes:
Classes:
alias of
Go2State- action_manager: ActionManager | None#
- static build_observations_fn(state)#
Build Go2 actor and critic observations without random noise.
- Parameters:
config (
Go2VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go2State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and privileged critic tensors, in that order.
- static compute_rewards_fn(state, terminated)#
Compute the official Go2 reward terms and dt-scaled total.
- Parameters:
config (
Go2VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go2State) – Batched physical state in the task schema and its declared coordinate frames.terminated (
Tensor) – Boolean failure mask for each environment before time-limit truncation.
- Return type:
- Returns:
Raw terms, weighted terms, and the summed reward for each environment.
- static compute_termination_fn(state)#
Compute Go2 tilt/contact termination and time-limit truncation.
- Parameters:
config (
Go2VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
Go2State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Failure and time-limit masks, respectively, with one value per environment.
- static corrupt_actor_fn(actor, generator)[source]#
Apply the task-defined actor observation noise.
- Parameters:
actor (
Tensor) – Actor observation tensor to corrupt in place.generator (
Generator) – Random generator used to sample the task noise or delays.
- Return type:
Tensor- Returns:
The actor observation tensor after adding the configured noise.
- dataset_manager: DatasetManager | None#
- episode_success_status: torch.Tensor#
- event_manager: EventManager | None#
- foot_link_names: tuple[str, ...] = ('FR_calf', 'FL_calf', 'RR_calf', 'RL_calf')#
- foot_offsets: tuple[tuple[float, float, float], ...] = ((0.0, 0.0, -0.213), (0.0, 0.0, -0.213), (0.0, 0.0, -0.213), (0.0, 0.0, -0.213))#
- illegal_contact_link_names: tuple[str, ...] = ('base_link', 'FR_hip', 'FR_thigh', 'FL_hip', 'FL_thigh', 'RR_hip', 'RR_thigh', 'RL_hip', 'RL_thigh')#
- observation_manager: ObservationManager | None#
- orientation_link_name: str | None = 'base_link'#
- reward_manager: RewardManager | None#
- rollout_buffer: TensorDict | None#
- velocity_task_config: Any = Go2VelocityConfig(data={'schema': 'unitree-velocity-task', 'official_task': 'Unitree-Go2-Flat', 'physics': {'physics_dt': 0.005, 'control_dt': 0.02, 'decimation': 4, 'episode_length_s': 20.0, 'reference_task': 'Isaac Lab Go2 velocity: UNITREE_GO2_CFG', 'default_backend_mapping': {'solver_position_iterations': 4, 'solver_velocity_iterations': 0}, 'mujoco': {'timestep': 0.005, 'integrator': 'implicitfast', 'impratio': 1.0, 'cone': 'pyramidal', 'jacobian': 'auto', 'solver': 'newton', 'iterations': 10, 'tolerance': 1e-08, 'ls_iterations': 20, 'ls_tolerance': 0.01, 'ccd_iterations': 50, 'gravity': [0.0, 0.0, -9.81], 'multiccd': False}}, 'contact_contract': {'level': 'rigid_body', 'foot_body_names': ['FR_calf', 'FL_calf', 'RR_calf', 'RL_calf'], 'illegal_contact_body_names': ['base_link', 'FR_hip', 'FR_thigh', 'FL_hip', 'FL_thigh', 'RR_hip', 'RR_thigh', 'RL_hip', 'RL_thigh'], 'history_substeps': 4}, 'robot': {'joint_names': ['FL_hip_joint', 'FL_thigh_joint', 'FL_calf_joint', 'FR_hip_joint', 'FR_thigh_joint', 'FR_calf_joint', 'RL_hip_joint', 'RL_thigh_joint', 'RL_calf_joint', 'RR_hip_joint', 'RR_thigh_joint', 'RR_calf_joint'], 'body_names': ['base_link', 'FL_hip', 'FL_thigh', 'FL_calf', 'FR_hip', 'FR_thigh', 'FR_calf', 'RL_hip', 'RL_thigh', 'RL_calf', 'RR_hip', 'RR_thigh', 'RR_calf'], 'root_position': [0.0, 0.0, 0.32], 'root_quaternion_wxyz': [1.0, 0.0, 0.0, 0.0], 'default_joint_position': [-0.1, 0.9, -1.8, 0.1, 0.9, -1.8, -0.1, 0.9, -1.8, 0.1, 0.9, -1.8], 'action_scale': [0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25], 'stiffness': [20.0, 20.0, 40.0, 20.0, 20.0, 40.0, 20.0, 20.0, 40.0, 20.0, 20.0, 40.0], 'damping': [1.0, 1.0, 2.0, 1.0, 1.0, 2.0, 1.0, 1.0, 2.0, 1.0, 1.0, 2.0], 'armature': [0.01, 0.01, 0.02, 0.01, 0.01, 0.02, 0.01, 0.01, 0.02, 0.01, 0.01, 0.02], 'effort_limit': [23.5, 23.5, 45.0, 23.5, 23.5, 45.0, 23.5, 23.5, 45.0, 23.5, 23.5, 45.0], 'soft_joint_position_limit_factor': 0.9, 'collision_configuration': [{'geom_names_expr': ['.*_collision'], 'contype': 1, 'conaffinity': 0, 'condim': {'^[FR][LR]_foot_collision$': 3, '.*_collision': 1}, 'priority': {'^[FR][LR]_foot_collision$': 1}, 'friction': {'^[FR][LR]_foot_collision$': [0.6]}, 'solref': None, 'solimp': {'^[FR][LR]_foot_collision$': [0.9, 0.95, 0.023]}, 'disable_other_geoms': True}]}, 'observations': {'actor_dimension': 47, 'actor': {'terms': {'base_ang_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_ang_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.2, 'n_max': 0.2}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'projected_gravity': {'func': 'mjlab.envs.mdp.observations.projected_gravity', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.05, 'n_max': 0.05}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'command': {'func': 'mjlab.envs.mdp.observations.generated_commands', 'params': {'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'phase': {'func': 'src.tasks.velocity.mdp.observations.phase', 'params': {'period': 0.6, 'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_pos': {'func': 'mjlab.envs.mdp.observations.joint_pos_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.01, 'n_max': 0.01}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_vel': {'func': 'mjlab.envs.mdp.observations.joint_vel_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -1.5, 'n_max': 1.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'actions': {'func': 'mjlab.envs.mdp.observations.last_action', 'params': {}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}}, 'concatenate_terms': True, 'concatenate_dim': -1, 'enable_corruption': True, 'history_length': 1, 'flatten_history_dim': True, 'nan_policy': 'disabled', 'nan_check_per_term': True}, 'critic': {'terms': {'base_ang_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_ang_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.2, 'n_max': 0.2}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'projected_gravity': {'func': 'mjlab.envs.mdp.observations.projected_gravity', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.05, 'n_max': 0.05}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'command': {'func': 'mjlab.envs.mdp.observations.generated_commands', 'params': {'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'phase': {'func': 'src.tasks.velocity.mdp.observations.phase', 'params': {'period': 0.6, 'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_pos': {'func': 'mjlab.envs.mdp.observations.joint_pos_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.01, 'n_max': 0.01}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_vel': {'func': 'mjlab.envs.mdp.observations.joint_vel_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -1.5, 'n_max': 1.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'actions': {'func': 'mjlab.envs.mdp.observations.last_action', 'params': {}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'base_lin_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_lin_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.5, 'n_max': 0.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_height': {'func': 'src.tasks.velocity.mdp.observations.foot_height', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['FR', 'FL', 'RR', 'RL'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_air_time': {'func': 'src.tasks.velocity.mdp.observations.foot_air_time', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_contact': {'func': 'src.tasks.velocity.mdp.observations.foot_contact', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_contact_forces': {'func': 'src.tasks.velocity.mdp.observations.foot_contact_forces', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}}, 'concatenate_terms': True, 'concatenate_dim': -1, 'enable_corruption': False, 'history_length': 1, 'flatten_history_dim': True, 'nan_policy': 'disabled', 'nan_check_per_term': True}}, 'actions': {'joint_pos': {'entity_name': 'robot', 'clip': None, 'transmission_type': 'joint', 'actuator_names': ['.*'], 'scale': 0.25, 'offset': 0.0, 'preserve_order': False, 'use_default_offset': True}}, 'commands': {'twist': {'resampling_time_range': [3.0, 8.0], 'debug_vis': True, 'entity_name': 'robot', 'heading_command': True, 'heading_control_stiffness': 0.5, 'rel_standing_envs': 0.05, 'rel_heading_envs': 1.0, 'init_velocity_prob': 0.0, 'ranges': {'lin_vel_x': [-1.0, 2.0], 'lin_vel_y': [-1.0, 1.0], 'ang_vel_z': [-1.0, 1.0], 'heading': [-3.141592653589793, 3.141592653589793]}, 'viz': {'z_offset': 0.2, 'scale': 0.5}}}, 'rewards': {'track_linear_velocity': {'func': 'src.tasks.velocity.mdp.rewards.track_linear_velocity', 'params': {'command_name': 'twist', 'std': 0.5}, 'weight': 1.0}, 'track_angular_velocity': {'func': 'src.tasks.velocity.mdp.rewards.track_angular_velocity', 'params': {'command_name': 'twist', 'std': 0.7071067811865476}, 'weight': 1.0}, 'body_orientation_l2': {'func': 'src.tasks.velocity.mdp.rewards.body_orientation_l2', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['base_link'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'pose': {'func': 'src.tasks.velocity.mdp.rewards.variable_posture', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': '.*', 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'command_name': 'twist', 'std_standing': {'.*(FR|FL|RR|RL)_hip_joint.*': 0.05, '.*(FR|FL|RR|RL)_thigh_joint.*': 0.1, '.*(FR|FL|RR|RL)_calf_joint.*': 0.15}, 'std_walking': {'.*(FR|FL|RR|RL)_hip_joint.*': 0.15, '.*(FR|FL|RR|RL)_thigh_joint.*': 0.35, '.*(FR|FL|RR|RL)_calf_joint.*': 0.5}, 'std_running': {'.*(FR|FL|RR|RL)_hip_joint.*': 0.15, '.*(FR|FL|RR|RL)_thigh_joint.*': 0.35, '.*(FR|FL|RR|RL)_calf_joint.*': 0.5}, 'walking_threshold': 0.1, 'running_threshold': 1.5}, 'weight': 1.0}, 'body_ang_vel': {'func': 'src.tasks.velocity.mdp.rewards.body_angular_velocity_penalty', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['base_link'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -0.05}, 'angular_momentum': {'func': 'src.tasks.velocity.mdp.rewards.angular_momentum_penalty', 'params': {'sensor_name': 'robot/root_angmom'}, 'weight': -0.025}, 'is_terminated': {'func': 'mjlab.envs.mdp.rewards.is_terminated', 'params': {}, 'weight': -200.0}, 'joint_acc_l2': {'func': 'mjlab.envs.mdp.rewards.joint_acc_l2', 'params': {}, 'weight': -2.5e-07}, 'joint_pos_limits': {'func': 'mjlab.envs.mdp.rewards.joint_pos_limits', 'params': {}, 'weight': -10.0}, 'action_rate_l2': {'func': 'mjlab.envs.mdp.rewards.action_rate_l2', 'params': {}, 'weight': -0.05}, 'foot_gait': {'func': 'src.tasks.velocity.mdp.rewards.feet_gait', 'params': {'period': 0.6, 'offset': [0.0, 0.5, 0.5, 0.0], 'threshold': 0.56, 'command_threshold': 0.1, 'command_name': 'twist', 'sensor_name': 'feet_ground_contact'}, 'weight': 0.5}, 'foot_clearance': {'func': 'src.tasks.velocity.mdp.rewards.feet_clearance', 'params': {'target_height': 0.1, 'command_name': 'twist', 'command_threshold': 0.1, 'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['FR', 'FL', 'RR', 'RL'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'foot_slip': {'func': 'src.tasks.velocity.mdp.rewards.feet_slip', 'params': {'sensor_name': 'feet_ground_contact', 'command_name': 'twist', 'command_threshold': 0.1, 'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['FR', 'FL', 'RR', 'RL'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -0.25}, 'soft_landing': {'func': 'src.tasks.velocity.mdp.rewards.soft_landing', 'params': {'sensor_name': 'feet_ground_contact', 'command_name': 'twist', 'command_threshold': 0.1}, 'weight': -0.001}, 'stand_still': {'func': 'src.tasks.velocity.mdp.rewards.stand_still', 'params': {'command_name': 'twist', 'command_threshold': 0.1, 'asset_cfg': {'name': 'robot', 'joint_names': '.*', 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}}, 'terminations': {'time_out': {'func': 'mjlab.envs.mdp.terminations.time_out', 'params': {}, 'time_out': True}, 'fell_over': {'func': 'mjlab.envs.mdp.terminations.bad_orientation', 'params': {'limit_angle': 1.2217304763960306}, 'time_out': False}, 'illegal_contact': {'func': 'mjlab.tasks.velocity.mdp.terminations.illegal_contact', 'params': {'sensor_name': 'nonfoot_ground_touch', 'force_threshold': 10.0}, 'time_out': False}}, 'events': {'reset_base': {'func': 'mjlab.envs.mdp.events.reset_root_state_uniform', 'params': {'pose_range': {'x': [-0.5, 0.5], 'y': [-0.5, 0.5], 'z': [0.0, 0.0], 'yaw': [-3.14, 3.14]}, 'velocity_range': {}}, 'mode': 'reset', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'reset_robot_joints': {'func': 'mjlab.envs.mdp.events.reset_joints_by_offset', 'params': {'position_range': [-0.0, 0.0], 'velocity_range': [-0.0, 0.0], 'asset_cfg': {'name': 'robot', 'joint_names': ['.*'], 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'mode': 'reset', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'push_robot': {'func': 'mjlab.envs.mdp.events.push_by_setting_velocity', 'params': {'velocity_range': {'x': [-0.5, 0.5], 'y': [-0.5, 0.5], 'z': [-0.4, 0.4], 'roll': [-0.52, 0.52], 'pitch': [-0.52, 0.52], 'yaw': [-0.78, 0.78]}}, 'mode': 'interval', 'interval_range_s': [5.0, 6.0], 'is_global_time': False, 'min_step_count_between_reset': 0}, 'foot_friction': {'func': 'mjlab.envs.mdp.dr.geom.geom_friction', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': ['FR_foot_collision', 'FL_foot_collision', 'RR_foot_collision', 'RL_foot_collision'], 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'operation': 'abs', 'ranges': [0.3, 1.6], 'shared_random': True}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'encoder_bias': {'func': 'mjlab.envs.mdp.dr.joint.encoder_bias', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'bias_range': [-0.015, 0.015]}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'base_com': {'func': 'mjlab.envs.mdp.dr.body.body_com_offset', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['base_link'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'operation': 'add', 'ranges': {'0': [-0.05, 0.05], '1': [-0.05, 0.05], '2': [-0.05, 0.05]}}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}}, 'curriculum': {'command_vel': {'func': 'src.tasks.velocity.mdp.curriculums.commands_vel', 'params': {'command_name': 'twist', 'velocity_stages': [{'step': 0, 'lin_vel_x': [-0.5, 1.0], 'lin_vel_y': [-0.5, 0.5], 'ang_vel_z': [-1.0, 1.0]}, {'step': 120000, 'lin_vel_x': [-1.0, 2.0], 'lin_vel_y': [-1.0, 1.0]}]}}}, 'ppo': {'seed': 42, 'num_steps_per_env': 24, 'max_iterations': 10001, 'obs_groups': {'actor': ['actor'], 'critic': ['critic']}, 'save_interval': 100, 'experiment_name': 'go2_velocity', 'run_name': '', 'logger': 'wandb', 'wandb_project': 'mjlab', 'wandb_tags': [], 'resume': False, 'load_run': '.*', 'load_checkpoint': 'model_.*.pt', 'clip_actions': None, 'upload_model': True, 'class_name': 'OnPolicyRunner', 'actor': {'hidden_dims': [512, 256, 128], 'activation': 'elu', 'obs_normalization': True, 'cnn_cfg': None, 'distribution_cfg': {'class_name': 'GaussianDistribution', 'init_std': 1.0, 'std_type': 'scalar'}, 'class_name': 'MLPModel'}, 'critic': {'hidden_dims': [512, 256, 128], 'activation': 'elu', 'obs_normalization': True, 'cnn_cfg': None, 'distribution_cfg': None, 'class_name': 'MLPModel'}, 'algorithm': {'num_learning_epochs': 5, 'num_mini_batches': 4, 'learning_rate': 0.001, 'schedule': 'adaptive', 'gamma': 0.99, 'lam': 0.95, 'entropy_coef': 0.01, 'desired_kl': 0.01, 'max_grad_norm': 1.0, 'value_loss_coef': 1.0, 'use_clipped_value_loss': True, 'clip_param': 0.2, 'normalize_advantage_per_mini_batch': False, 'optimizer': 'adam', 'share_cnn_encoders': False, 'class_name': 'PPO'}}}, joint_names=('FL_hip_joint', 'FL_thigh_joint', 'FL_calf_joint', 'FR_hip_joint', 'FR_thigh_joint', 'FR_calf_joint', 'RL_hip_joint', 'RL_thigh_joint', 'RL_calf_joint', 'RR_hip_joint', 'RR_thigh_joint', 'RR_calf_joint'), default_joint_position=(-0.1, 0.9, -1.8, 0.1, 0.9, -1.8, -0.1, 0.9, -1.8, 0.1, 0.9, -1.8), action_scale=(0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25), actor_observation_dim=47, critic_observation_dim=74, action_dim=12, phase_period=0.6, physics_dt=0.005, control_dt=0.02, max_episode_steps=1000)#
Unitree H1_2 flat-ground velocity task.
Classes:
Track planar velocity commands with the 27-DOF H1_2 model. |
- class embodichain_tasks.locomotion.velocity.h1_2_flat.UnitreeH12FlatEnv[source]#
Bases:
EmbodiChainVelocityEnvTrack planar velocity commands with the 27-DOF H1_2 model.
Methods:
build_observations_fn(state)Build H1_2 actor and critic observations without random noise.
compute_rewards_fn(state, terminated)Compute the official H1_2 reward terms and dt-scaled total.
compute_termination_fn(state)Compute H1_2 tilt termination and time-limit truncation.
corrupt_actor_fn(actor, generator)Apply the task-defined actor observation noise.
Attributes:
Classes:
alias of
H12State- action_manager: ActionManager | None#
- static build_observations_fn(state)#
Build H1_2 actor and critic observations without random noise.
- Parameters:
config (
H12VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
H12State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and privileged critic tensors, in that order.
- static compute_rewards_fn(state, terminated)#
Compute the official H1_2 reward terms and dt-scaled total.
- Parameters:
config (
H12VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
H12State) – Batched physical state in the task schema and its declared coordinate frames.terminated (
Tensor) – Boolean failure mask for each environment before time-limit truncation.
- Return type:
- Returns:
Raw terms, weighted terms, and the summed reward for each environment.
- static compute_termination_fn(state)#
Compute H1_2 tilt termination and time-limit truncation.
- Parameters:
config (
H12VelocityConfig) – Task dimensions, timing, and robot-specific reward settings.state (
H12State) – Batched physical state in the task schema and its declared coordinate frames.
- Return type:
tuple[Tensor,Tensor]- Returns:
Failure and time-limit masks, respectively, with one value per environment.
- static corrupt_actor_fn(actor, generator)[source]#
Apply the task-defined actor observation noise.
- Parameters:
actor (
Tensor) – Actor observation tensor to corrupt in place.generator (
Generator) – Random generator used to sample the task noise or delays.
- Return type:
Tensor- Returns:
The actor observation tensor after adding the configured noise.
- dataset_manager: DatasetManager | None#
- episode_success_status: torch.Tensor#
- event_manager: EventManager | None#
- foot_link_names: tuple[str, ...] = ('left_ankle_roll_link', 'right_ankle_roll_link')#
- foot_offsets: tuple[tuple[float, float, float], ...] = ((0.04, 0.0, -0.04), (0.04, 0.0, -0.04))#
- imu_offset: tuple[float, float, float] | None = (-0.04452, -0.01891, 0.27756)#
- observation_manager: ObservationManager | None#
- orientation_link_name: str | None = 'torso_link'#
- reward_manager: RewardManager | None#
- rollout_buffer: TensorDict | None#
- velocity_task_config: Any = H12VelocityConfig(data={'schema': 'unitree-velocity-task', 'official_task': 'Unitree-H1_2-Flat', 'physics': {'physics_dt': 0.005, 'control_dt': 0.02, 'decimation': 4, 'episode_length_s': 20.0, 'reference_task': 'Isaac Lab H1 velocity: H1_MINIMAL_CFG -> H1_CFG', 'default_backend_mapping': {'solver_position_iterations': 4, 'solver_velocity_iterations': 4}, 'mujoco': {'timestep': 0.005, 'integrator': 'implicitfast', 'impratio': 1.0, 'cone': 'pyramidal', 'jacobian': 'auto', 'solver': 'newton', 'iterations': 10, 'tolerance': 1e-08, 'ls_iterations': 20, 'ls_tolerance': 0.01, 'ccd_iterations': 50, 'gravity': [0.0, 0.0, -9.81], 'disableflags': [], 'enableflags': []}}, 'robot': {'joint_names': ['left_hip_yaw_joint', 'left_hip_pitch_joint', 'left_hip_roll_joint', 'left_knee_joint', 'left_ankle_pitch_joint', 'left_ankle_roll_joint', 'right_hip_yaw_joint', 'right_hip_pitch_joint', 'right_hip_roll_joint', 'right_knee_joint', 'right_ankle_pitch_joint', 'right_ankle_roll_joint', 'torso_joint', 'left_shoulder_pitch_joint', 'left_shoulder_roll_joint', 'left_shoulder_yaw_joint', 'left_elbow_joint', 'left_wrist_roll_joint', 'left_wrist_pitch_joint', 'left_wrist_yaw_joint', 'right_shoulder_pitch_joint', 'right_shoulder_roll_joint', 'right_shoulder_yaw_joint', 'right_elbow_joint', 'right_wrist_roll_joint', 'right_wrist_pitch_joint', 'right_wrist_yaw_joint'], 'body_names': ['pelvis', 'left_hip_yaw_link', 'left_hip_pitch_link', 'left_hip_roll_link', 'left_knee_link', 'left_ankle_pitch_link', 'left_ankle_roll_link', 'right_hip_yaw_link', 'right_hip_pitch_link', 'right_hip_roll_link', 'right_knee_link', 'right_ankle_pitch_link', 'right_ankle_roll_link', 'torso_link', 'left_shoulder_pitch_link', 'left_shoulder_roll_link', 'left_shoulder_yaw_link', 'left_elbow_link', 'left_wrist_roll_link', 'left_wrist_pitch_link', 'left_wrist_yaw_link', 'right_shoulder_pitch_link', 'right_shoulder_roll_link', 'right_shoulder_yaw_link', 'right_elbow_link', 'right_wrist_roll_link', 'right_wrist_pitch_link', 'right_wrist_yaw_link'], 'root_position': [0.0, 0.0, 1.02], 'root_quaternion_wxyz': [1.0, 0.0, 0.0, 0.0], 'default_joint_position': [0.0, -0.2, 0.0, 0.5, -0.3, 0.0, 0.0, -0.2, 0.0, 0.5, -0.3, 0.0, 0.0, 0.28, 0.0, 0.0, 0.52, 0.0, 0.0, 0.0, 0.28, 0.0, 0.0, 0.52, 0.0, 0.0, 0.0], 'action_scale': [0.5065856129685917, 0.5065856129685917, 0.5065856129685917, 0.4755865567533291, 0.5076142131979695, 0.5076142131979695, 0.5065856129685917, 0.5065856129685917, 0.5065856129685917, 0.4755865567533291, 0.5076142131979695, 0.5076142131979695, 0.5065856129685917, 0.5076142131979695, 0.5076142131979695, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5076142131979695, 0.5076142131979695, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569], 'stiffness': [98.7, 98.7, 98.7, 157.7, 19.7, 19.7, 98.7, 98.7, 98.7, 157.7, 19.7, 19.7, 98.7, 19.7, 19.7, 7.9, 7.9, 7.9, 7.9, 7.9, 19.7, 19.7, 7.9, 7.9, 7.9, 7.9, 7.9], 'damping': [6.3, 6.3, 6.3, 10.1, 1.3, 1.3, 6.3, 6.3, 6.3, 10.1, 1.3, 1.3, 6.3, 1.3, 1.3, 0.5, 0.5, 0.5, 0.5, 0.5, 1.3, 1.3, 0.5, 0.5, 0.5, 0.5, 0.5], 'armature': [0.025, 0.025, 0.025, 0.04, 0.005, 0.005, 0.025, 0.025, 0.025, 0.04, 0.005, 0.005, 0.025, 0.005, 0.005, 0.002, 0.002, 0.002, 0.002, 0.002, 0.005, 0.005, 0.002, 0.002, 0.002, 0.002, 0.002], 'effort_limit': [200.0, 200.0, 200.0, 300.0, 40.0, 40.0, 200.0, 200.0, 200.0, 300.0, 40.0, 40.0, 200.0, 40.0, 40.0, 18.0, 18.0, 18.0, 18.0, 18.0, 40.0, 40.0, 18.0, 18.0, 18.0, 18.0, 18.0], 'velocity_limit': [23.0, 23.0, 23.0, 14.0, 9.0, 9.0, 23.0, 23.0, 23.0, 14.0, 9.0, 9.0, 23.0, 9.0, 9.0, 20.0, 20.0, 31.4, 31.4, 31.4, 9.0, 9.0, 20.0, 20.0, 31.4, 31.4, 31.4], 'soft_joint_position_limit_factor': 0.9, 'collision_configuration': [{'geom_names_expr': ['.*_collision'], 'contype': 1, 'conaffinity': 1, 'condim': {'^(left|right)_foot[1-7]_collision$': 3, '.*_collision': 1}, 'priority': {'^(left|right)_foot[1-7]_collision$': 1}, 'friction': {'^(left|right)_foot[1-7]_collision$': [0.6]}, 'solref': None, 'solimp': None, 'margin': None, 'gap': None, 'solmix': None, 'disable_other_geoms': True}]}, 'observations': {'actor_dimension': 92, 'actor': {'terms': {'base_ang_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_ang_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.2, 'n_max': 0.2}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'projected_gravity': {'func': 'mjlab.envs.mdp.observations.projected_gravity', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.05, 'n_max': 0.05}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'command': {'func': 'mjlab.envs.mdp.observations.generated_commands', 'params': {'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'phase': {'func': 'src.tasks.velocity.mdp.observations.phase', 'params': {'period': 0.6, 'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_pos': {'func': 'mjlab.envs.mdp.observations.joint_pos_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.01, 'n_max': 0.01}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_vel': {'func': 'mjlab.envs.mdp.observations.joint_vel_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -1.5, 'n_max': 1.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'actions': {'func': 'mjlab.envs.mdp.observations.last_action', 'params': {}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}}, 'concatenate_terms': True, 'concatenate_dim': -1, 'enable_corruption': True, 'history_length': 1, 'flatten_history_dim': True, 'nan_policy': 'disabled', 'nan_check_per_term': True}, 'critic': {'terms': {'base_ang_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_ang_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.2, 'n_max': 0.2}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'projected_gravity': {'func': 'mjlab.envs.mdp.observations.projected_gravity', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.05, 'n_max': 0.05}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'command': {'func': 'mjlab.envs.mdp.observations.generated_commands', 'params': {'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'phase': {'func': 'src.tasks.velocity.mdp.observations.phase', 'params': {'period': 0.6, 'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_pos': {'func': 'mjlab.envs.mdp.observations.joint_pos_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.01, 'n_max': 0.01}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_vel': {'func': 'mjlab.envs.mdp.observations.joint_vel_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -1.5, 'n_max': 1.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'actions': {'func': 'mjlab.envs.mdp.observations.last_action', 'params': {}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'base_lin_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_lin_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.5, 'n_max': 0.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_height': {'func': 'src.tasks.velocity.mdp.observations.foot_height', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['left_foot', 'right_foot'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_air_time': {'func': 'src.tasks.velocity.mdp.observations.foot_air_time', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_contact': {'func': 'src.tasks.velocity.mdp.observations.foot_contact', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_contact_forces': {'func': 'src.tasks.velocity.mdp.observations.foot_contact_forces', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}}, 'concatenate_terms': True, 'concatenate_dim': -1, 'enable_corruption': False, 'history_length': 1, 'flatten_history_dim': True, 'nan_policy': 'disabled', 'nan_check_per_term': True}}, 'actions': {'joint_pos': {'entity_name': 'robot', 'clip': None, 'transmission_type': 'joint', 'actuator_names': ['.*'], 'scale': {'.*_hip_yaw.*': 0.5065856129685917, '.*_hip_pitch.*': 0.5065856129685917, '.*_hip_roll.*': 0.5065856129685917, 'torso_joint': 0.5065856129685917, '.*_knee.*': 0.4755865567533291, '.*_ankle_pitch.*': 0.5076142131979695, '.*_ankle_roll.*': 0.5076142131979695, '.*_shoulder_pitch.*': 0.5076142131979695, '.*_shoulder_roll.*': 0.5076142131979695, '.*_shoulder_yaw.*': 0.5696202531645569, '.*_elbow.*': 0.5696202531645569, '.*_wrist_pitch.*': 0.5696202531645569, '.*_wrist_roll.*': 0.5696202531645569, '.*_wrist_yaw.*': 0.5696202531645569}, 'offset': 0.0, 'preserve_order': False, 'use_default_offset': True}}, 'commands': {'twist': {'resampling_time_range': [3.0, 8.0], 'debug_vis': True, 'entity_name': 'robot', 'heading_command': True, 'heading_control_stiffness': 0.5, 'rel_standing_envs': 0.05, 'rel_heading_envs': 1.0, 'rel_world_envs': 0.0, 'rel_forward_envs': 0.0, 'init_velocity_prob': 0.0, 'ranges': {'lin_vel_x': [-1.0, 2.0], 'lin_vel_y': [-1.0, 1.0], 'ang_vel_z': [-1.0, 1.0], 'heading': [-3.141592653589793, 3.141592653589793]}, 'viz': {'z_offset': 1.55, 'scale': 0.5}}}, 'rewards': {'track_linear_velocity': {'func': 'src.tasks.velocity.mdp.rewards.track_linear_velocity', 'params': {'command_name': 'twist', 'std': 0.5}, 'weight': 1.0}, 'track_angular_velocity': {'func': 'src.tasks.velocity.mdp.rewards.track_angular_velocity', 'params': {'command_name': 'twist', 'std': 0.7071067811865476}, 'weight': 1.0}, 'body_orientation_l2': {'func': 'src.tasks.velocity.mdp.rewards.body_orientation_l2', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['torso_link'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'pose': {'func': 'src.tasks.velocity.mdp.rewards.variable_posture', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': '.*', 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'command_name': 'twist', 'std_standing': {'.*': 0.05}, 'std_walking': {'.*hip_yaw.*': 0.15, '.*hip_pitch.*': 0.5, '.*hip_roll.*': 0.15, '.*knee.*': 0.5, '.*ankle_pitch.*': 0.15, '.*ankle_roll.*': 0.1, '.*torso.*': 0.15, '.*shoulder_pitch.*': 0.15, '.*shoulder_roll.*': 0.1, '.*shoulder_yaw.*': 0.1, '.*elbow.*': 0.1, '.*wrist.*': 0.1}, 'std_running': {'.*hip_yaw.*': 0.25, '.*hip_pitch.*': 0.5, '.*hip_roll.*': 0.25, '.*knee.*': 0.5, '.*ankle_pitch.*': 0.25, '.*ankle_roll.*': 0.1, '.*torso.*': 0.25, '.*shoulder_pitch.*': 0.25, '.*shoulder_roll.*': 0.1, '.*shoulder_yaw.*': 0.1, '.*elbow.*': 0.1, '.*wrist.*': 0.1}, 'walking_threshold': 0.1, 'running_threshold': 1.5}, 'weight': 1.0}, 'body_ang_vel': {'func': 'src.tasks.velocity.mdp.rewards.body_angular_velocity_penalty', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['torso_link'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -0.05}, 'angular_momentum': {'func': 'src.tasks.velocity.mdp.rewards.angular_momentum_penalty', 'params': {'sensor_name': 'robot/root_angmom'}, 'weight': -0.025}, 'is_terminated': {'func': 'mjlab.envs.mdp.rewards.is_terminated', 'params': {}, 'weight': -200.0}, 'joint_acc_l2': {'func': 'mjlab.envs.mdp.rewards.joint_acc_l2', 'params': {}, 'weight': -2.5e-07}, 'joint_pos_limits': {'func': 'mjlab.envs.mdp.rewards.joint_pos_limits', 'params': {}, 'weight': -10.0}, 'action_rate_l2': {'func': 'mjlab.envs.mdp.rewards.action_rate_l2', 'params': {}, 'weight': -0.05}, 'foot_gait': {'func': 'src.tasks.velocity.mdp.rewards.feet_gait', 'params': {'period': 0.6, 'offset': [0.0, 0.5], 'threshold': 0.56, 'command_threshold': 0.1, 'command_name': 'twist', 'sensor_name': 'feet_ground_contact'}, 'weight': 0.5}, 'foot_clearance': {'func': 'src.tasks.velocity.mdp.rewards.feet_clearance', 'params': {'target_height': 0.1, 'command_name': 'twist', 'command_threshold': 0.1, 'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['left_foot', 'right_foot'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'foot_slip': {'func': 'src.tasks.velocity.mdp.rewards.feet_slip', 'params': {'sensor_name': 'feet_ground_contact', 'command_name': 'twist', 'command_threshold': 0.1, 'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['left_foot', 'right_foot'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -0.25}, 'soft_landing': {'func': 'src.tasks.velocity.mdp.rewards.soft_landing', 'params': {'sensor_name': 'feet_ground_contact', 'command_name': 'twist', 'command_threshold': 0.1}, 'weight': -0.001}, 'stand_still': {'func': 'src.tasks.velocity.mdp.rewards.stand_still', 'params': {'command_name': 'twist', 'command_threshold': 0.1, 'asset_cfg': {'name': 'robot', 'joint_names': '.*', 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'self_collisions': {'func': 'mjlab.tasks.velocity.mdp.rewards.self_collision_cost', 'params': {'sensor_name': 'self_collision', 'force_threshold': 10.0}, 'weight': -1.0}}, 'terminations': {'time_out': {'func': 'mjlab.envs.mdp.terminations.time_out', 'params': {}, 'time_out': True}, 'fell_over': {'func': 'mjlab.envs.mdp.terminations.bad_orientation', 'params': {'limit_angle': 1.2217304763960306}, 'time_out': False}}, 'events': {'reset_base': {'func': 'mjlab.envs.mdp.events.reset_root_state_uniform', 'params': {'pose_range': {'x': [-0.5, 0.5], 'y': [-0.5, 0.5], 'z': [0.0, 0.0], 'yaw': [-3.14, 3.14]}, 'velocity_range': {}}, 'mode': 'reset', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'reset_robot_joints': {'func': 'mjlab.envs.mdp.events.reset_joints_by_offset', 'params': {'position_range': [-0.0, 0.0], 'velocity_range': [-0.0, 0.0], 'asset_cfg': {'name': 'robot', 'joint_names': ['.*'], 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'mode': 'reset', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'push_robot': {'func': 'mjlab.envs.mdp.events.push_by_setting_velocity', 'params': {'velocity_range': {'x': [-0.5, 0.5], 'y': [-0.5, 0.5], 'z': [-0.4, 0.4], 'roll': [-0.52, 0.52], 'pitch': [-0.52, 0.52], 'yaw': [-0.78, 0.78]}}, 'mode': 'interval', 'interval_range_s': [5.0, 6.0], 'is_global_time': False, 'min_step_count_between_reset': 0}, 'foot_friction': {'func': 'mjlab.envs.mdp.dr.geom.geom_friction', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': ['left_foot1_collision', 'left_foot2_collision', 'left_foot3_collision', 'left_foot4_collision', 'left_foot5_collision', 'left_foot6_collision', 'left_foot7_collision', 'right_foot1_collision', 'right_foot2_collision', 'right_foot3_collision', 'right_foot4_collision', 'right_foot5_collision', 'right_foot6_collision', 'right_foot7_collision'], 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'operation': 'abs', 'ranges': [0.3, 1.6], 'shared_random': True}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'encoder_bias': {'func': 'mjlab.envs.mdp.dr.joint.encoder_bias', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'bias_range': [-0.015, 0.015]}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'base_com': {'func': 'mjlab.envs.mdp.dr.body.body_com_offset', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['torso_link'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'texture_names': None, 'texture_ids': {'start': None, 'stop': None, 'step': None}, 'pair_names': None, 'pair_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'operation': 'add', 'ranges': {'0': [-0.05, 0.05], '1': [-0.05, 0.05], '2': [-0.05, 0.05]}}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}}, 'curriculum': {'command_vel': {'func': 'src.tasks.velocity.mdp.curriculums.commands_vel', 'params': {'command_name': 'twist', 'velocity_stages': [{'step': 0, 'lin_vel_x': [-0.5, 1.0], 'lin_vel_y': [-0.5, 0.5], 'ang_vel_z': [-1.0, 1.0]}, {'step': 120000, 'lin_vel_x': [-1.0, 2.0], 'lin_vel_y': [-1.0, 1.0]}]}}}, 'ppo': {'seed': 42, 'num_steps_per_env': 24, 'max_iterations': 10001, 'obs_groups': {'actor': ['actor'], 'critic': ['critic']}, 'save_interval': 100, 'experiment_name': 'h1_2_velocity', 'run_name': '', 'logger': 'wandb', 'wandb_project': 'mjlab', 'wandb_tags': [], 'resume': False, 'load_run': '.*', 'load_checkpoint': 'model_.*.pt', 'clip_actions': None, 'upload_model': True, 'class_name': 'OnPolicyRunner', 'actor': {'hidden_dims': [512, 256, 128], 'activation': 'elu', 'obs_normalization': True, 'cnn_cfg': None, 'distribution_cfg': {'class_name': 'GaussianDistribution', 'init_std': 1.0, 'std_type': 'scalar'}, 'rnn_type': None, 'rnn_hidden_dim': 256, 'rnn_num_layers': 1, 'class_name': 'MLPModel'}, 'critic': {'hidden_dims': [512, 256, 128], 'activation': 'elu', 'obs_normalization': True, 'cnn_cfg': None, 'distribution_cfg': None, 'rnn_type': None, 'rnn_hidden_dim': 256, 'rnn_num_layers': 1, 'class_name': 'MLPModel'}, 'algorithm': {'num_learning_epochs': 5, 'num_mini_batches': 4, 'learning_rate': 0.001, 'schedule': 'adaptive', 'gamma': 0.99, 'lam': 0.95, 'entropy_coef': 0.01, 'desired_kl': 0.01, 'max_grad_norm': 1.0, 'value_loss_coef': 1.0, 'use_clipped_value_loss': True, 'clip_param': 0.2, 'normalize_advantage_per_mini_batch': False, 'optimizer': 'adam', 'share_cnn_encoders': False, 'class_name': 'PPO'}}}, joint_names=('left_hip_yaw_joint', 'left_hip_pitch_joint', 'left_hip_roll_joint', 'left_knee_joint', 'left_ankle_pitch_joint', 'left_ankle_roll_joint', 'right_hip_yaw_joint', 'right_hip_pitch_joint', 'right_hip_roll_joint', 'right_knee_joint', 'right_ankle_pitch_joint', 'right_ankle_roll_joint', 'torso_joint', 'left_shoulder_pitch_joint', 'left_shoulder_roll_joint', 'left_shoulder_yaw_joint', 'left_elbow_joint', 'left_wrist_roll_joint', 'left_wrist_pitch_joint', 'left_wrist_yaw_joint', 'right_shoulder_pitch_joint', 'right_shoulder_roll_joint', 'right_shoulder_yaw_joint', 'right_elbow_joint', 'right_wrist_roll_joint', 'right_wrist_pitch_joint', 'right_wrist_yaw_joint'), default_joint_position=(0.0, -0.2, 0.0, 0.5, -0.3, 0.0, 0.0, -0.2, 0.0, 0.5, -0.3, 0.0, 0.0, 0.28, 0.0, 0.0, 0.52, 0.0, 0.0, 0.0, 0.28, 0.0, 0.0, 0.52, 0.0, 0.0, 0.0), action_scale=(0.5065856129685917, 0.5065856129685917, 0.5065856129685917, 0.4755865567533291, 0.5076142131979695, 0.5076142131979695, 0.5065856129685917, 0.5065856129685917, 0.5065856129685917, 0.4755865567533291, 0.5076142131979695, 0.5076142131979695, 0.5065856129685917, 0.5076142131979695, 0.5076142131979695, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5076142131979695, 0.5076142131979695, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569, 0.5696202531645569), actor_observation_dim=92, critic_observation_dim=107, action_dim=27, phase_period=0.6, physics_dt=0.005, control_dt=0.02, max_episode_steps=1000)#
Pollen Robotics MicroDuck flat-ground velocity task.
Classes:
Track planar velocity commands with the 14-DOF MicroDuck model. |
- class embodichain_tasks.locomotion.velocity.microduck_flat.MicroDuckFlatEnv[source]#
Bases:
EmbodiChainVelocityEnvTrack planar velocity commands with the 14-DOF MicroDuck model.
Methods:
build_observations_fn(state)Build MicroDuck actor and critic observations without random noise.
compute_rewards_fn(state, terminated)Compute the official MicroDuck reward terms and dt-scaled total.
compute_termination_fn(state)Compute MicroDuck tilt/contact/height termination and truncation.
corrupt_actor_fn(actor, generator)Attributes:
Classes:
alias of
MicroDuckState- action_manager: ActionManager | None#
- static build_observations_fn(state)#
Build MicroDuck actor and critic observations without random noise.
- Parameters:
config (
MicroDuckVelocityConfig) – Task joint, observation, reward and timing settings.state (
MicroDuckState) – Batched task state in the configured joint and body order.
- Return type:
tuple[Tensor,Tensor]- Returns:
Actor and critic observation tensors, each with one row per environment.
- static compute_rewards_fn(state, terminated)#
Compute the official MicroDuck reward terms and dt-scaled total.
- Parameters:
config (
MicroDuckVelocityConfig) – Task joint, observation, reward and timing settings.state (
MicroDuckState) – Batched task state in the configured joint and body order.terminated (
Tensor) – Failure mask used by configured reward terms.
- Return type:
- Returns:
Raw terms, weighted terms scaled by control timestep, and their total.
- static compute_termination_fn(state)#
Compute MicroDuck tilt/contact/height termination and truncation.
- Parameters:
config (
MicroDuckVelocityConfig) – Task joint, observation, reward and timing settings.state (
MicroDuckState) – Batched task state in the configured joint and body order.
- Return type:
tuple[Tensor,Tensor]- Returns:
Per-environment failure and episode-timeout masks.
- dataset_manager: DatasetManager | None#
- episode_success_status: torch.Tensor#
- event_manager: EventManager | None#
- foot_link_names: tuple[str, ...] = ('ankle_left', 'ankle_right')#
- foot_offsets: tuple[tuple[float, float, float], ...] = ((0.0, -0.0238146, -0.0140852), (0.0, -0.0238146, -0.0140852))#
- illegal_contact_link_names: tuple[str, ...] = ('trunk_base', 'yaw2roll', 'hip_l', 'upper_leg_left', 'leg', 'neck', 'neck_pitch', 'yaw_roll_motion', 'jaw_soft', 'bearing_roll', 'hip_l_2', 'upper_leg_right', 'leg_2')#
- observation_manager: ObservationManager | None#
- orientation_link_name: str | None = 'trunk_base'#
- reward_manager: RewardManager | None#
- rollout_buffer: TensorDict | None#
- state_type#
alias of
MicroDuckState
- velocity_task_config: Any = MicroDuckVelocityConfig(data={'schema': 'microduck-velocity-task', 'official_task': 'Mjlab-Velocity-Flat-MicroDuck', 'source_repository': 'https://github.com/pollen-robotics/microduck_rl', 'physics': {'physics_dt': 0.002, 'control_dt': 0.02, 'decimation': 10, 'episode_length_s': 20.0, 'default_backend_mapping': {'solver_position_iterations': 4, 'solver_velocity_iterations': 1}}, 'robot': {'joint_names': ['left_hip_yaw', 'left_hip_roll', 'left_hip_pitch', 'left_knee', 'left_ankle', 'neck_pitch', 'head_pitch', 'head_yaw', 'head_roll', 'right_hip_yaw', 'right_hip_roll', 'right_hip_pitch', 'right_knee', 'right_ankle'], 'body_names': ['trunk_base', 'yaw2roll', 'hip_l', 'upper_leg_left', 'leg', 'ankle_left', 'neck', 'neck_pitch', 'yaw_roll_motion', 'jaw_soft', 'bearing_roll', 'hip_l_2', 'upper_leg_right', 'leg_2', 'ankle_right'], 'root_position': [0.0, 0.0, 0.12], 'root_quaternion_wxyz': [1.0, 0.0, 0.0, 0.0], 'default_joint_position': [0.0, -0.0873, -0.4579, -0.0049, 0.453, 0.3491, 0.3491, 0.0, 0.0, 0.0, 0.0873, 0.4579, 0.0049, -0.453], 'action_scale': [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 'stiffness': [0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55, 0.55], 'damping': [0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053, 0.053], 'armature': [0.0018, 0.0018, 0.0018, 0.0018, 0.0018, 0.0018, 0.0018, 0.0018, 0.0018, 0.0018, 0.0018, 0.0018, 0.0018, 0.0018], 'effort_limit': [0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96], 'velocity_limit': [10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2], 'soft_joint_position_limit_factor': 0.9}, 'observations': {'actor_dimension': 53, 'actor': {'terms': {'base_ang_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_ang_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.03, 'n_max': 0.03}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'projected_gravity': {'func': 'mjlab.envs.mdp.observations.projected_gravity', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.01, 'n_max': 0.01}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'command': {'func': 'mjlab.envs.mdp.observations.generated_commands', 'params': {'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'phase': {'func': 'src.tasks.velocity.mdp.observations.phase', 'params': {'period': 0.5, 'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_pos': {'func': 'mjlab.envs.mdp.observations.joint_pos_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.001, 'n_max': 0.001}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_vel': {'func': 'mjlab.envs.mdp.observations.joint_vel_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.25, 'n_max': 0.25}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'actions': {'func': 'mjlab.envs.mdp.observations.last_action', 'params': {}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}}, 'concatenate_terms': True, 'concatenate_dim': -1, 'enable_corruption': True, 'history_length': 1, 'flatten_history_dim': True, 'nan_policy': 'disabled', 'nan_check_per_term': True}, 'critic': {'terms': {'base_ang_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_ang_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.03, 'n_max': 0.03}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'projected_gravity': {'func': 'mjlab.envs.mdp.observations.projected_gravity', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.01, 'n_max': 0.01}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'command': {'func': 'mjlab.envs.mdp.observations.generated_commands', 'params': {'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'phase': {'func': 'src.tasks.velocity.mdp.observations.phase', 'params': {'period': 0.5, 'command_name': 'twist'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_pos': {'func': 'mjlab.envs.mdp.observations.joint_pos_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.001, 'n_max': 0.001}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'joint_vel': {'func': 'mjlab.envs.mdp.observations.joint_vel_rel', 'params': {}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.25, 'n_max': 0.25}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'actions': {'func': 'mjlab.envs.mdp.observations.last_action', 'params': {}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'base_lin_vel': {'func': 'mjlab.envs.mdp.observations.builtin_sensor', 'params': {'sensor_name': 'robot/imu_lin_vel'}, 'noise': {'operation': 'add', '_tensor_cache': {}, 'n_min': -0.5, 'n_max': 0.5}, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_height': {'func': 'src.tasks.velocity.mdp.observations.foot_height', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['left_foot', 'right_foot'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_air_time': {'func': 'src.tasks.velocity.mdp.observations.foot_air_time', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_contact': {'func': 'src.tasks.velocity.mdp.observations.foot_contact', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}, 'foot_contact_forces': {'func': 'src.tasks.velocity.mdp.observations.foot_contact_forces', 'params': {'sensor_name': 'feet_ground_contact'}, 'noise': None, 'clip': None, 'scale': None, 'delay_min_lag': 0, 'delay_max_lag': 0, 'delay_per_env': True, 'delay_hold_prob': 0.0, 'delay_update_period': 0, 'delay_per_env_phase': True, 'history_length': 0, 'flatten_history_dim': True}}, 'concatenate_terms': True, 'concatenate_dim': -1, 'enable_corruption': False, 'history_length': 1, 'flatten_history_dim': True, 'nan_policy': 'disabled', 'nan_check_per_term': True}}, 'actions': {'joint_pos': {'entity_name': 'robot', 'clip': None, 'transmission_type': 'joint', 'actuator_names': ['.*'], 'scale': {'.*': 1.0}, 'offset': 0.0, 'preserve_order': False, 'use_default_offset': True}}, 'commands': {'twist': {'resampling_time_range': [3.0, 8.0], 'debug_vis': True, 'entity_name': 'robot', 'heading_command': False, 'heading_control_stiffness': 0.5, 'rel_standing_envs': 0.1, 'rel_heading_envs': 0.0, 'init_velocity_prob': 0.0, 'ranges': {'lin_vel_x': [-0.4, 0.4], 'lin_vel_y': [-0.3, 0.3], 'ang_vel_z': [-1.0, 1.0], 'heading': [-3.141592653589793, 3.141592653589793]}, 'viz': {'z_offset': 0.5, 'scale': 0.5}}}, 'rewards': {'track_linear_velocity': {'func': 'src.tasks.velocity.mdp.rewards.track_linear_velocity', 'params': {'command_name': 'twist', 'std': 0.31622777}, 'weight': 2.0}, 'track_angular_velocity': {'func': 'src.tasks.velocity.mdp.rewards.track_angular_velocity', 'params': {'command_name': 'twist', 'std': 0.70710678}, 'weight': 2.0}, 'body_orientation_l2': {'func': 'src.tasks.velocity.mdp.rewards.body_orientation_l2', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['trunk_base'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -0.5}, 'pose': {'func': 'src.tasks.velocity.mdp.rewards.variable_posture', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': '.*', 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'command_name': 'twist', 'std_standing': {'.*hip_yaw.*': 0.1, '.*hip_roll.*': 0.05, '.*hip_pitch.*': 0.15, '.*knee.*': 0.15, '.*ankle.*': 0.1, '.*neck.*': 0.15, '.*head.*': 0.15}, 'std_walking': {'.*hip_yaw.*': 0.3, '.*hip_roll.*': 0.05, '.*hip_pitch.*': 0.4, '.*knee.*': 0.4, '.*ankle.*': 0.25, '.*neck.*': 0.3, '.*head.*': 0.3}, 'std_running': {'.*hip_yaw.*': 0.3, '.*hip_roll.*': 0.05, '.*hip_pitch.*': 0.4, '.*knee.*': 0.4, '.*ankle.*': 0.25, '.*neck.*': 0.3, '.*head.*': 0.3}, 'walking_threshold': 0.01, 'running_threshold': 1.0}, 'weight': 1.0}, 'body_ang_vel': {'func': 'src.tasks.velocity.mdp.rewards.body_angular_velocity_penalty', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['trunk_base'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -0.05}, 'angular_momentum': {'func': 'src.tasks.velocity.mdp.rewards.angular_momentum_penalty', 'params': {'sensor_name': 'robot/root_angmom'}, 'weight': -0.02}, 'is_terminated': {'func': 'mjlab.envs.mdp.rewards.is_terminated', 'params': {}, 'weight': -200.0}, 'joint_acc_l2': {'func': 'mjlab.envs.mdp.rewards.joint_acc_l2', 'params': {}, 'weight': -2.5e-07}, 'joint_pos_limits': {'func': 'mjlab.envs.mdp.rewards.joint_pos_limits', 'params': {}, 'weight': -10.0}, 'action_rate_l2': {'func': 'mjlab.envs.mdp.rewards.action_rate_l2', 'params': {}, 'weight': -0.1}, 'foot_gait': {'func': 'src.tasks.velocity.mdp.rewards.feet_gait', 'params': {'period': 0.5, 'offset': [0.0, 0.5], 'threshold': 0.56, 'command_threshold': 0.01, 'command_name': 'twist', 'sensor_name': 'feet_ground_contact'}, 'weight': 0.5}, 'foot_clearance': {'func': 'src.tasks.velocity.mdp.rewards.feet_clearance', 'params': {'target_height': 0.02, 'command_name': 'twist', 'command_threshold': 0.01, 'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['left_foot', 'right_foot'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'foot_slip': {'func': 'src.tasks.velocity.mdp.rewards.feet_slip', 'params': {'sensor_name': 'feet_ground_contact', 'command_name': 'twist', 'command_threshold': 0.01, 'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': ['left_foot', 'right_foot'], 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -0.1}, 'soft_landing': {'func': 'src.tasks.velocity.mdp.rewards.soft_landing', 'params': {'sensor_name': 'feet_ground_contact', 'command_name': 'twist', 'command_threshold': 0.01}, 'weight': 0.0}, 'stand_still': {'func': 'src.tasks.velocity.mdp.rewards.stand_still', 'params': {'command_name': 'twist', 'command_threshold': 0.01, 'asset_cfg': {'name': 'robot', 'joint_names': '.*', 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'weight': -1.0}, 'self_collisions': {'func': 'mjlab.tasks.velocity.mdp.rewards.self_collision_cost', 'params': {'sensor_name': 'self_collision', 'force_threshold': 10.0}, 'weight': -1.0}}, 'terminations': {'time_out': {'func': 'mjlab.envs.mdp.terminations.time_out', 'params': {}, 'time_out': True}, 'fell_over': {'func': 'mjlab.envs.mdp.terminations.bad_orientation', 'params': {'limit_angle': 1.2217304763960306}, 'time_out': False}}, 'events': {'reset_base': {'func': 'mjlab.envs.mdp.events.reset_root_state_uniform', 'params': {'pose_range': {'x': [-0.5, 0.5], 'y': [-0.5, 0.5], 'z': [0.0, 0.0], 'yaw': [-3.14, 3.14]}, 'velocity_range': {}}, 'mode': 'reset', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'reset_robot_joints': {'func': 'mjlab.envs.mdp.events.reset_joints_by_offset', 'params': {'position_range': [-0.0, 0.0], 'velocity_range': [-0.0, 0.0], 'asset_cfg': {'name': 'robot', 'joint_names': ['.*'], 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}}, 'mode': 'reset', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'push_robot': {'func': 'mjlab.envs.mdp.events.push_by_setting_velocity', 'params': {'velocity_range': {'x': [-0.3, 0.3], 'y': [-0.3, 0.3], 'z': [0.0, 0.0], 'roll': [0.0, 0.0], 'pitch': [0.0, 0.0], 'yaw': [0.0, 0.0]}}, 'mode': 'interval', 'interval_range_s': [3.0, 6.0], 'is_global_time': False, 'min_step_count_between_reset': 0}, 'foot_friction': {'func': 'mjlab.envs.mdp.dr.geom.geom_friction', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': ['left_foot_collision', 'right_foot_collision'], 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'operation': 'abs', 'ranges': [0.3, 1.6], 'shared_random': True}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'encoder_bias': {'func': 'mjlab.envs.mdp.dr.joint.encoder_bias', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': None, 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'bias_range': [-0.015, 0.015]}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}, 'base_com': {'func': 'mjlab.envs.mdp.dr.body.body_com_offset', 'params': {'asset_cfg': {'name': 'robot', 'joint_names': None, 'joint_ids': {'start': None, 'stop': None, 'step': None}, 'body_names': ['trunk_base'], 'body_ids': {'start': None, 'stop': None, 'step': None}, 'geom_names': None, 'geom_ids': {'start': None, 'stop': None, 'step': None}, 'site_names': None, 'site_ids': {'start': None, 'stop': None, 'step': None}, 'actuator_names': None, 'actuator_ids': {'start': None, 'stop': None, 'step': None}, 'tendon_names': None, 'tendon_ids': {'start': None, 'stop': None, 'step': None}, 'camera_names': None, 'camera_ids': {'start': None, 'stop': None, 'step': None}, 'light_names': None, 'light_ids': {'start': None, 'stop': None, 'step': None}, 'material_names': None, 'material_ids': {'start': None, 'stop': None, 'step': None}, 'preserve_order': False}, 'operation': 'add', 'ranges': {'0': [-0.05, 0.05], '1': [-0.05, 0.05], '2': [-0.05, 0.05]}}, 'mode': 'startup', 'interval_range_s': None, 'is_global_time': False, 'min_step_count_between_reset': 0}}, 'curriculum': {'command_vel': {'func': 'src.tasks.velocity.mdp.curriculums.commands_vel', 'params': {'command_name': 'twist', 'velocity_stages': [{'step': 0, 'lin_vel_x': [-0.2, 0.2], 'lin_vel_y': [-0.15, 0.15], 'ang_vel_z': [-0.5, 0.5]}, {'step': 120000, 'lin_vel_x': [-0.4, 0.4], 'lin_vel_y': [-0.3, 0.3], 'ang_vel_z': [-1.0, 1.0]}]}}}, 'ppo': {'seed': 42, 'num_steps_per_env': 24, 'max_iterations': 10001, 'obs_groups': {'actor': ['actor'], 'critic': ['critic']}, 'save_interval': 100, 'experiment_name': 'microduck_velocity', 'run_name': '', 'logger': 'wandb', 'wandb_project': 'mjlab', 'wandb_tags': [], 'resume': False, 'load_run': '.*', 'load_checkpoint': 'model_.*.pt', 'clip_actions': None, 'upload_model': True, 'class_name': 'OnPolicyRunner', 'actor': {'hidden_dims': [512, 256, 128], 'activation': 'elu', 'obs_normalization': True, 'cnn_cfg': None, 'distribution_cfg': {'class_name': 'GaussianDistribution', 'init_std': 1.0, 'std_type': 'scalar'}, 'class_name': 'MLPModel'}, 'critic': {'hidden_dims': [512, 256, 128], 'activation': 'elu', 'obs_normalization': True, 'cnn_cfg': None, 'distribution_cfg': None, 'class_name': 'MLPModel'}, 'algorithm': {'num_learning_epochs': 5, 'num_mini_batches': 4, 'learning_rate': 0.001, 'schedule': 'adaptive', 'gamma': 0.99, 'lam': 0.95, 'entropy_coef': 0.01, 'desired_kl': 0.01, 'max_grad_norm': 1.0, 'value_loss_coef': 1.0, 'use_clipped_value_loss': True, 'clip_param': 0.2, 'normalize_advantage_per_mini_batch': False, 'optimizer': 'adam', 'share_cnn_encoders': False, 'class_name': 'PPO'}}}, joint_names=('left_hip_yaw', 'left_hip_roll', 'left_hip_pitch', 'left_knee', 'left_ankle', 'neck_pitch', 'head_pitch', 'head_yaw', 'head_roll', 'right_hip_yaw', 'right_hip_roll', 'right_hip_pitch', 'right_knee', 'right_ankle'), default_joint_position=(0.0, -0.0873, -0.4579, -0.0049, 0.453, 0.3491, 0.3491, 0.0, 0.0, 0.0, 0.0873, 0.4579, 0.0049, -0.453), action_scale=(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0), actor_observation_dim=53, critic_observation_dim=68, action_dim=14, phase_period=0.5, physics_dt=0.002, control_dt=0.02, max_episode_steps=1000)#
Run forward with a 17-joint Humanoid using effort control.
Classes:
Preserve the benchmark's 63 observations and clipped motor effort action. |
- class embodichain_tasks.classic_control.humanoid.humanoid_run.HumanoidRunEnv[source]#
Bases:
EmbodiedEnvPreserve the benchmark’s 63 observations and clipped motor effort action.
Methods:
compute_task_state(**kwargs)Terminate fallen or nonfinite states; running has no success terminal.
get_reward(obs, action, info)Return progress, posture and motor-cost rewards from the benchmark.
Backend-independent Humanoid observation and reward functions.
Functions:
|
Build the 63-element observation for the 17-DoF Humanoid asset. |
|
Compute the 17-DoF Humanoid reward with a penalty near either joint limit. |
- embodichain_tasks.classic_control.humanoid.mdp.humanoid_observation(torso_height, linear_velocity_local, angular_velocity_local, yaw, roll, angle_to_target, up_projection, heading_projection, scaled_joint_position, joint_velocity, action, *, angular_velocity_scale, joint_velocity_scale)[source]#
Build the 63-element observation for the 17-DoF Humanoid asset.
- Parameters:
torso_height (
Tensor) – Root height for each environment.linear_velocity_local (
Tensor) – Root linear velocity in the torso frame.angular_velocity_local (
Tensor) – Root angular velocity in the torso frame.yaw (
Tensor) – Root yaw angles in radians.roll (
Tensor) – Root roll angles in radians.angle_to_target (
Tensor) – Heading error to the target, in radians.up_projection (
Tensor) – Torso up-axis projection on world up.heading_projection (
Tensor) – Heading-axis projection toward the target.scaled_joint_position (
Tensor) – Joint positions normalized by their limits.joint_velocity (
Tensor) – Joint velocities in policy joint order.action (
Tensor) – Current clipped effort actions in policy joint order.angular_velocity_scale (
float) – Multiplier for angular velocity observations.joint_velocity_scale (
float) – Multiplier for joint velocity observations.
- Return type:
Tensor- Returns:
A tensor of shape
(num_envs, 63)in the policy observation order.
- embodichain_tasks.classic_control.humanoid.mdp.humanoid_reward(*, action, terminated, heading_projection, up_projection, joint_velocity, scaled_joint_position, progress, motor_effort_ratio, heading_weight, up_weight, actions_cost_scale, energy_cost_scale, joint_velocity_scale, death_cost, alive_reward_scale)[source]#
Compute the 17-DoF Humanoid reward with a penalty near either joint limit.
- Parameters:
action (
Tensor) – Current clipped effort actions.terminated (
Tensor) – Per-environment failure mask.heading_projection (
Tensor) – Heading-axis projection toward the target.up_projection (
Tensor) – Torso up-axis projection on world up.joint_velocity (
Tensor) – Measured joint velocities.scaled_joint_position (
Tensor) – Joint positions normalized by their limits.progress (
Tensor) – Change in the task’s progress potential.motor_effort_ratio (
Tensor) – Per-joint relative motor effort weights.heading_weight (
float) – Maximum heading reward.up_weight (
float) – Reward for the upright threshold.actions_cost_scale (
float) – Weight of squared action cost.energy_cost_scale (
float) – Weight of action-velocity effort cost.joint_velocity_scale (
float) – Joint velocity multiplier in effort cost.death_cost (
float) – Reward assigned to terminated environments.alive_reward_scale (
float) – Additive survival reward.
- Return type:
Tensor- Returns:
One reward per environment, with death cost replacing failed-row totals.
Download the robot assets used by the locomotion tasks.
Classes:
Robot descriptions and dependencies for ANYmalCLocomotion. |
|
Robot descriptions and dependencies for HumanoidRun. |
|
Robot descriptions and dependencies for MicroDuckLocomotion. |
|
Robot descriptions and dependencies for UnitreeG1Locomotion. |
|
Robot descriptions and dependencies for UnitreeGo1Locomotion. |
|
Robot descriptions and dependencies for UnitreeGo2Locomotion. |
|
Robot descriptions and dependencies for UnitreeH1_2Locomotion. |
- class embodichain.data.assets.locomotion_assets.ANYmalCLocomotion[source]#
Bases:
_LocomotionAssetRobot descriptions and dependencies for ANYmalCLocomotion.
Attributes:
-
archive_md5:
str= '6634d4b3c4b83e264e58e295ab3b5656'#
-
archive_md5:
- class embodichain.data.assets.locomotion_assets.HumanoidRun[source]#
Bases:
_LocomotionAssetRobot descriptions and dependencies for HumanoidRun.
Attributes:
-
archive_md5:
str= '846cb8db9d069d0eae41c8b799ad1872'#
-
archive_md5:
- class embodichain.data.assets.locomotion_assets.MicroDuckLocomotion[source]#
Bases:
_LocomotionAssetRobot descriptions and dependencies for MicroDuckLocomotion.
Attributes:
-
archive_md5:
str= '65c294dddfc8b0b21ccc4b8829c4d13c'#
-
archive_md5:
- class embodichain.data.assets.locomotion_assets.UnitreeG1Locomotion[source]#
Bases:
_LocomotionAssetRobot descriptions and dependencies for UnitreeG1Locomotion.
Attributes:
-
archive_md5:
str= '617102145c54e678bc46f6f9421ee497'#
-
archive_md5:
- class embodichain.data.assets.locomotion_assets.UnitreeGo1Locomotion[source]#
Bases:
_LocomotionAssetRobot descriptions and dependencies for UnitreeGo1Locomotion.
Attributes:
-
archive_md5:
str= '95e923163f4137b1dd10ac0e4a1f8238'#
-
archive_md5: