Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/sphinx/source/zh_CN/5-reference/5-support_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@ uv run scripts/generate_support_matrix.py --write
| APPO (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | Tested | - | - | - | - | - |
| APPO (torch) | `allegro_inhand` (Allegro in-hand) | Tested | - | Tested | - | - | - | - | - |
| SAC (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Tested | Tested | Tested | Tested | Configured | Tested | - |
| SAC (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | Configured | Tested | - | - | - | - | - |
| SAC (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | Configured | Tested | - | Registered | - | Registered | - |
| SAC (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | Registered | - | - | - | - | - |
| SAC (torch) | `g1_wbt_obs` (g1 wbt obs) | Tested | - | Registered | - | - | - | - | - |
| TD3 (torch) | `go2_joystick_flat` (Go2 joystick) | Registered | - | Tested | - | - | - | - | Registered |
| TD3 (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Registered | Registered | Registered | Registered | Registered | Registered | - |
| FlashSAC (torch) | `go2_joystick_flat` (Go2 joystick) | Tested | - | Registered | - | - | - | - | Registered |
| FlashSAC (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Configured | Tested | Registered | Registered | Registered | Registered | - |
| FlashSAC (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | Configured | Tested | - | Configured | - | Configured | - |

### Source Index

Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ dependencies = [
"numpy",
# Physics implementations are provided by the independently released
# unisim-core package. Version 1.5.0 provides the M2 physical entity,
# immutable variant, layout and selected-reset contracts.
"unisim-core>=1.5.0",
# immutable variant, layout and selected-reset contracts; 1.5.1 adds
# get_motion_body_ids on the newton/genesis adapters and fixes the
# subprocess motion-id offset (unilabsim/unisim#137).
"unisim-core>=1.5.1",
# RL algorithms and async runtimes (PPO/APPO/SAC/TD3 runners,
# collectors, IPC, logging) live in the independently released uni-rl
# package (distribution name ``unilab-rl``), consumed via the injected
Expand Down Expand Up @@ -169,7 +171,7 @@ viser = ["viser>=1.0.26", "trimesh>=3.21.7"]
# required-environments; elsewhere the extra is empty and the CLI reports a
# targeted runtime diagnostic.
superdex = [
"unisim-core[superdex]>=1.5.0 ; python_version >= '3.12' and sys_platform == 'linux' and platform_machine == 'x86_64'",
"unisim-core[superdex]>=1.5.1 ; python_version >= '3.12' and sys_platform == 'linux' and platform_machine == 'x86_64'",
]

[dependency-groups]
Expand Down
4 changes: 4 additions & 0 deletions src/unilab/conf/flashsac/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ training:
log_root: null
log_dir: null
env_steps_per_sync: 1
# Seconds the learner waits for each collector inference tick before
# failing. Tick 0 includes collector env construction, whose cost is
# backend-owned; slow-start backends raise this in their task owner YAML.
inference_request_timeout_sec: 30.0
trace_enabled: false
trace_output_dir: null
trace_thread_time: false
Expand Down
253 changes: 253 additions & 0 deletions src/unilab/conf/flashsac/task/g1_motion_tracking/base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
# @package _global_
# Canonical G1 Whole-Body Tracking (WBT) Manager-Based task declaration for
# FlashSAC owners. Env/reward identity matches
# conf/sac/task/g1_motion_tracking/mujoco.yaml verbatim so the sim2sim
# DENYLIST contract keeps parity across algos and backends; backend owner
# leaves inherit this file and only override backend/algo tuning.
env:
seed: null
scene:
model_file: src/unilab/assets/robots/g1/scene_flat.xml
default_keyframe_name: stand
entities:
robot:
root_body_name: pelvis
joint_names: &g1_joints
- 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
actuator_names: *g1_joints
body_names: &tracked_bodies
- pelvis
- left_hip_roll_link
- left_knee_link
- left_ankle_roll_link
- right_hip_roll_link
- right_knee_link
- right_ankle_roll_link
- torso_link
- left_shoulder_roll_link
- left_elbow_link
- left_wrist_yaw_link
- right_shoulder_roll_link
- right_elbow_link
- right_wrist_yaw_link
sim_dt: 0.006666666666666667
ctrl_dt: 0.02
max_episode_seconds: 10.0
observations:
actor:
enable_corruption: true
terms:
command: &command_obs
func: unilab.envs.mdp.generated_commands
params: {command_name: motion}
motion_anchor_pos_b: &anchor_pos_obs
func: unilab.tasks.motion_tracking.common.manager_terms.motion_anchor_pos_b
params: {command_name: motion}
motion_anchor_ori_b: &anchor_ori_obs
func: unilab.tasks.motion_tracking.common.manager_terms.motion_anchor_ori_b
params: {command_name: motion}
base_lin_vel: &base_lin_vel_obs
func: unilab.envs.mdp.builtin_sensor
params: {sensor_name: pelvis_local_linvel}
noise:
_target_: unilab.managers._noise.UniformNoiseCfg
n_min: -0.1
n_max: 0.1
base_ang_vel: &base_ang_vel_obs
func: unilab.envs.mdp.builtin_sensor
params: {sensor_name: torso_gyro}
noise:
_target_: unilab.managers._noise.UniformNoiseCfg
n_min: -0.2
n_max: 0.2
joint_pos: &joint_pos_obs
func: unilab.tasks.motion_tracking.common.manager_terms.motion_joint_pos_rel
params: {command_name: motion}
noise:
_target_: unilab.managers._noise.UniformNoiseCfg
n_min: -0.01
n_max: 0.01
joint_vel: &joint_vel_obs
func: unilab.envs.mdp.joint_vel_rel
noise:
_target_: unilab.managers._noise.UniformNoiseCfg
n_min: -1.5
n_max: 1.5
actions: &actions_obs
func: unilab.envs.mdp.last_action
critic:
terms:
command: *command_obs
motion_anchor_pos_b: *anchor_pos_obs
motion_anchor_ori_b: *anchor_ori_obs
base_lin_vel: *base_lin_vel_obs
base_ang_vel: *base_ang_vel_obs
joint_pos: *joint_pos_obs
joint_vel: *joint_vel_obs
actions: *actions_obs
body_pos:
func: unilab.tasks.motion_tracking.common.manager_terms.robot_body_pos_b
params: {command_name: motion}
body_ori:
func: unilab.tasks.motion_tracking.common.manager_terms.robot_body_ori_b
params: {command_name: motion}
sac_base_lin_vel:
func: unilab.envs.mdp.builtin_sensor
params: {sensor_name: pelvis_local_linvel}
actions:
joint_pos:
_target_: unilab.tasks.motion_tracking.common.manager_terms.MotionJointPositionActionCfg
entity_name: robot
actuator_names: [".*"]
scale: 2.0
use_default_offset: true
command_name: motion
commands:
motion:
_target_: unilab.tasks.motion_tracking.common.manager_terms.MotionCommandCfg
entity_name: robot
resampling_time_range: [1.0e9, 1.0e9]
params:
motion_file: motions/g1/dance1_subject2_part.npz
anchor_body_name: torso_link
body_names: *tracked_bodies
sampling_mode: adaptive
sampling_start_ratio: 0.0
truncate_on_clip_end: true
pose_range:
x: [-0.05, 0.05]
y: [-0.05, 0.05]
z: [-0.01, 0.01]
roll: [-0.1, 0.1]
pitch: [-0.1, 0.1]
yaw: [-0.2, 0.2]
velocity_range:
x: [-0.5, 0.5]
y: [-0.5, 0.5]
z: [-0.2, 0.2]
roll: [-0.52, 0.52]
pitch: [-0.52, 0.52]
yaw: [-0.78, 0.78]
joint_position_range: [-0.1, 0.1]
joint_default_position_range: [0.0, 0.0]
terminations:
time_out:
func: unilab.envs.mdp.time_out
time_out: true
motion_clip_end:
func: unilab.tasks.motion_tracking.common.manager_terms.motion_clip_end
time_out: true
params: {command_name: motion}
anchor_pos:
func: unilab.tasks.motion_tracking.common.manager_terms.bad_anchor_pos_z_only
params: {command_name: motion, threshold: 0.5}
anchor_ori:
func: unilab.tasks.motion_tracking.common.manager_terms.bad_anchor_ori
params:
command_name: motion
threshold: 0.8
asset_cfg:
_target_: unilab.managers.SceneEntityCfg
name: robot
ee_body_pos:
func: unilab.tasks.motion_tracking.common.manager_terms.bad_motion_body_pos_z_only
params:
command_name: motion
threshold: 0.5
body_names:
- left_ankle_roll_link
- right_ankle_roll_link
- left_wrist_yaw_link
- right_wrist_yaw_link
policy_observation_group: actor
critic_observation_group: critic

reward:
motion_global_root_pos:
func: unilab.tasks.motion_tracking.common.manager_terms.motion_global_anchor_position_error_exp
weight: 1.0
params: {command_name: motion, std: 0.3}
motion_global_root_ori:
func: unilab.tasks.motion_tracking.common.manager_terms.motion_global_anchor_orientation_error_exp
weight: 0.5
params: {command_name: motion, std: 0.4}
motion_body_pos:
func: unilab.tasks.motion_tracking.common.manager_terms.motion_relative_body_position_error_exp
weight: 2.0
params: {command_name: motion, std: 0.3}
motion_body_ori:
func: unilab.tasks.motion_tracking.common.manager_terms.motion_relative_body_orientation_error_exp
weight: 1.0
params: {command_name: motion, std: 0.4}
motion_body_lin_vel:
func: unilab.tasks.motion_tracking.common.manager_terms.motion_global_body_linear_velocity_error_exp
weight: 1.0
params: {command_name: motion, std: 1.0}
motion_body_ang_vel:
func: unilab.tasks.motion_tracking.common.manager_terms.motion_global_body_angular_velocity_error_exp
weight: 1.0
params: {command_name: motion, std: 3.14}
motion_joint_pos:
func: unilab.tasks.motion_tracking.common.manager_terms.motion_joint_position_error_exp
weight: 0.0
params: {command_name: motion, std: 0.2}
motion_joint_vel:
func: unilab.tasks.motion_tracking.common.manager_terms.motion_joint_velocity_error_exp
weight: 0.0
params: {command_name: motion, std: 1.0}
action_rate_l2:
func: unilab.envs.mdp.action_rate_l2
weight: -0.1
joint_limit:
func: unilab.tasks.motion_tracking.common.manager_terms.joint_pos_limits
weight: -2.0
params:
asset_cfg:
_target_: unilab.managers.SceneEntityCfg
name: robot
joint_names: ".*"
undesired_contacts:
func: unilab.tasks.motion_tracking.common.manager_terms.undesired_body_contacts
weight: -0.1
params:
command_name: motion
threshold: 0.05
body_names:
- pelvis
- left_hip_roll_link
- left_knee_link
- right_hip_roll_link
- right_knee_link
- torso_link
- left_shoulder_roll_link
- left_elbow_link
- right_shoulder_roll_link
- right_elbow_link
29 changes: 29 additions & 0 deletions src/unilab/conf/flashsac/task/g1_motion_tracking/genesis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# @package _global_
# FlashSAC Genesis owner for G1 WBT (in-process backend, genesis-world==1.3.3).
# Keeps DENYLIST parity with the MuJoCo owner so cross-backend play transfers
# 1:1. Genesis drops the MJCF global <option> block at import (REPORT #1372
# §3.3), so the integrator g1.xml declares is re-declared here: the timestep
# flows through the existing base.yaml sim_dt -> ctrl_dt chain, and the
# integrator through the env field below. Requires unisim-core>=1.5.1 for the
# motion body id capability (unilabsim/unisim#137). Playback uses Genesis
# native rendering: with a display, play_render_mode=auto opens the
# interactive viewer; headless hosts fall back to offscreen camera recording.
defaults:
- /task/g1_motion_tracking/mujoco
- _self_

training:
task_name: G1MotionTrackingSAC
sim_backend: genesis
play_render_mode: auto
# First tick includes collector env construction; genesis JIT startup exceeds
# the 30s default (same override as sac g1_walk_flat/genesis).
inference_request_timeout_sec: 180.0
env:
# GPU device id for the process-wide Genesis session. Multi-GPU training
# overrides this cold-path field from the rank topology; zero preserves the
# single-device owner default.
genesis_device_id: 0
# Re-declares the MJCF <option integrator="implicitfast"> that Genesis drops
# at import; the remaining global options keep the Genesis defaults.
genesis_integrator: implicitfast
15 changes: 15 additions & 0 deletions src/unilab/conf/flashsac/task/g1_motion_tracking/mjwarp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# @package _global_
# FlashSAC mjwarp (GPU) owner for G1 WBT. Inherits the MuJoCo owner verbatim
# so sim2sim DENYLIST fields keep parity and run metrics stay directly
# comparable with logs/fast_sac/G1MotionTrackingSAC; offline record reuses
# MuJoCo rendering.
# NOTE: mjwarp rejects reset/interval domain randomization and push terms;
# this owner inherits the DR-free base, so no extra disables are needed.
defaults:
- /task/g1_motion_tracking/mujoco
- _self_

training:
task_name: G1MotionTrackingSAC
sim_backend: mjwarp
play_render_mode: record
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @package _global_
# Motrix is the sim2sim eval owner for MuJoCo-trained FlashSAC WBT checkpoints.
defaults:
- /task/g1_motion_tracking/mujoco
- _self_

training:
task_name: G1MotionTrackingSAC
sim_backend: motrix
21 changes: 21 additions & 0 deletions src/unilab/conf/flashsac/task/g1_motion_tracking/mujoco.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @package _global_
# FlashSAC MuJoCo owner for G1 WBT. Carries the FlashSAC training budget
# aligned with the FastSAC owner (2048 envs x 25000 iterations, gamma 0.99)
# so run metrics are directly comparable across algos; FlashSAC algo-specific
# knobs (batch_size, num_atoms, temp/n_step params) stay at the
# conf/flashsac/config.yaml defaults.
defaults:
- /task/g1_motion_tracking/base
- _self_

training:
task_name: G1MotionTrackingSAC
sim_backend: mujoco
algo:
num_envs: 2048
max_iterations: 25000
save_interval: 1000
gamma: 0.99
tau: 0.05
updates_per_step: 4
policy_frequency: 2
Loading
Loading