From 6de46613e2595a7b8f7e12d43e6a357bdf49d26e Mon Sep 17 00:00:00 2001 From: tatp-yf Date: Sun, 4 Oct 2026 21:01:16 +0800 Subject: [PATCH] refactor(tasks): remove g1_flip_tracking task Remove the G1FlipTracking and G1FlipTrackingSAC registry identities, their ppo/appo/sac owner YAMLs, the associated profile, partial-reset, owner contract, and smoke test coverage, support-matrix entries, and the motion-tracking and sim2sim docs references. x2_wall_flip_tracking and the generic flip CSV motion tooling are unaffected. --- .../2-user_guide/4-tasks/2-motion_tracking.md | 6 +- .../source/en/5-reference/5-support_matrix.md | 3 - .../2-user_guide/4-tasks/2-motion_tracking.md | 6 +- .../9-sim2sim_contract_status.md | 2 - .../zh_CN/5-reference/5-support_matrix.md | 3 - scripts/tools/support_matrix.py | 2 - .../appo/task/g1_flip_tracking/mujoco.yaml | 117 ------------------ .../ppo/task/g1_flip_tracking/mujoco.yaml | 110 ---------------- .../task/g1_flip_tracking/mjwarp_tensor.yaml | 15 --- .../sac/task/g1_flip_tracking/mujoco.yaml | 112 ----------------- src/unilab/tasks/migration_matrix.py | 2 - .../tasks/motion_tracking/g1/__init__.py | 8 -- .../config/test_g1_motion_tracking_owners.py | 5 - tests/config/test_locomotion_params.py | 62 ---------- .../envs/test_motion_command_partial_reset.py | 5 +- tests/envs/test_motion_profiles.py | 91 ++------------ tests/scripts/test_train_script_configs.py | 2 - tests/tasks/test_flashsac_owner_contract.py | 7 -- 18 files changed, 13 insertions(+), 545 deletions(-) delete mode 100644 src/unilab/conf/appo/task/g1_flip_tracking/mujoco.yaml delete mode 100644 src/unilab/conf/ppo/task/g1_flip_tracking/mujoco.yaml delete mode 100644 src/unilab/conf/sac/task/g1_flip_tracking/mjwarp_tensor.yaml delete mode 100644 src/unilab/conf/sac/task/g1_flip_tracking/mujoco.yaml diff --git a/docs/sphinx/source/en/2-user_guide/4-tasks/2-motion_tracking.md b/docs/sphinx/source/en/2-user_guide/4-tasks/2-motion_tracking.md index aad8e4a32..9028238ff 100644 --- a/docs/sphinx/source/en/2-user_guide/4-tasks/2-motion_tracking.md +++ b/docs/sphinx/source/en/2-user_guide/4-tasks/2-motion_tracking.md @@ -20,7 +20,6 @@ configuration entry point; the selected owner is materialized into the shared | CLI Task | Registered Env | Default Motion | Owner Evidence | | --- | --- | --- | --- | | `g1_motion_tracking` | `G1MotionTracking` | `dance1_subject2_part.npz` | `src/unilab/conf/ppo/task/g1_motion_tracking/`, `src/unilab/conf/appo/task/g1_motion_tracking/` | -| `g1_flip_tracking` | `G1FlipTracking` | `flip_360_001__A304.npz` | `src/unilab/conf/ppo/task/g1_flip_tracking/`, `src/unilab/conf/appo/task/g1_flip_tracking/` | | `x2_wall_flip_tracking` | `X2WallFlipTracking` | `tictacflip_6-3_g1format.npz` | `src/unilab/conf/ppo/task/x2_wall_flip_tracking/` | | `g1_box_tracking` | `G1BoxTracking` | `sub3_largebox_003_boxconverted.npz` | `src/unilab/conf/ppo/task/g1_box_tracking/` | | `g1_wbt_obs` | `G1WBTObs` | `dance1_subject2_part.npz` | `src/unilab/conf/sac/task/g1_wbt_obs/mujoco.yaml` | @@ -33,13 +32,10 @@ profiles now live in `unitree_rl_unilab`. ## PPO And APPO PPO owner iteration budgets (the `--sim mujoco` owner YAMLs): `g1_motion_tracking` -runs `algo.max_iterations=15000`; `g1_flip_tracking` runs `20000`; and -`x2_wall_flip_tracking` runs `9500`. (The Motrix owner YAML for -`g1_flip_tracking` raises this to `30000`.) +runs `algo.max_iterations=15000` and `x2_wall_flip_tracking` runs `9500`. ```bash uv run train --algo ppo --task g1_motion_tracking --sim mujoco -uv run train --algo ppo --task g1_flip_tracking --sim mujoco uv run train --algo ppo --task x2_wall_flip_tracking --sim mujoco uv run train --algo ppo --task g1_motion_tracking --sim mujoco uv run train --algo appo --task g1_motion_tracking --sim mujoco training.no_play=true diff --git a/docs/sphinx/source/en/5-reference/5-support_matrix.md b/docs/sphinx/source/en/5-reference/5-support_matrix.md index 9c2221eba..10f0b11c6 100644 --- a/docs/sphinx/source/en/5-reference/5-support_matrix.md +++ b/docs/sphinx/source/en/5-reference/5-support_matrix.md @@ -85,7 +85,6 @@ This table is derived from UniSim's SDK-free public static inventory. It describ | PPO (torch) | `go2_joystick_flat` (Go2 joystick) | Tested | - | - | - | - | | PPO (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Registered | Tested | Registered | Configured | | PPO (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | - | - | - | - | -| PPO (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | - | - | - | | PPO (torch) | `x2_wall_flip_tracking` (X2 wall flip tracking) | Tested | - | - | - | - | | PPO (torch) | `allegro_inhand` (Allegro in-hand) | Tested | - | - | - | - | | PPO (torch) | `allegro_inhand_grasp` (allegro inhand grasp) | Tested | - | - | - | - | @@ -94,11 +93,9 @@ This table is derived from UniSim's SDK-free public static inventory. It describ | APPO (torch) | `go2_joystick_flat` (Go2 joystick) | Tested | - | - | - | - | | APPO (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Registered | Registered | Registered | Registered | | APPO (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | - | - | - | - | -| APPO (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | - | - | - | | APPO (torch) | `allegro_inhand` (Allegro in-hand) | Tested | - | - | - | - | | SAC (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Tested | Tested | Tested | Tested | | SAC (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | Registered | Configured | Registered | Configured | -| SAC (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | Configured | - | - | | SAC (torch) | `g1_wbt_obs` (g1 wbt obs) | Tested | - | - | - | - | | FlashSAC (torch) | `go2_joystick_flat` (Go2 joystick) | Tested | - | - | - | - | | FlashSAC (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Registered | Configured | Registered | Registered | diff --git a/docs/sphinx/source/zh_CN/2-user_guide/4-tasks/2-motion_tracking.md b/docs/sphinx/source/zh_CN/2-user_guide/4-tasks/2-motion_tracking.md index 39cbf89d0..bf4715977 100644 --- a/docs/sphinx/source/zh_CN/2-user_guide/4-tasks/2-motion_tracking.md +++ b/docs/sphinx/source/zh_CN/2-user_guide/4-tasks/2-motion_tracking.md @@ -18,7 +18,6 @@ runtime 执行。 | CLI Task | Registered Env | 默认 motion | Owner Evidence | | --- | --- | --- | --- | | `g1_motion_tracking` | `G1MotionTracking` | `dance1_subject2_part.npz` | `src/unilab/conf/ppo/task/g1_motion_tracking/`, `src/unilab/conf/appo/task/g1_motion_tracking/` | -| `g1_flip_tracking` | `G1FlipTracking` | `flip_360_001__A304.npz` | `src/unilab/conf/ppo/task/g1_flip_tracking/`, `src/unilab/conf/appo/task/g1_flip_tracking/` | | `x2_wall_flip_tracking` | `X2WallFlipTracking` | `tictacflip_6-3_g1format.npz` | `src/unilab/conf/ppo/task/x2_wall_flip_tracking/` | | `g1_box_tracking` | `G1BoxTracking` | `sub3_largebox_003_boxconverted.npz` | `src/unilab/conf/ppo/task/g1_box_tracking/` | | `g1_wbt_obs` | `G1WBTObs` | `dance1_subject2_part.npz` | `src/unilab/conf/sac/task/g1_wbt_obs/mujoco.yaml` | @@ -30,13 +29,10 @@ deploy 与 23-DoF motion production profile 现在位于 `unitree_rl_unilab`。 ## PPO 与 APPO PPO owner 迭代预算(`--sim mujoco` owner YAML):`g1_motion_tracking` 为 -`algo.max_iterations=15000`;`g1_flip_tracking` 为 `20000`; -`x2_wall_flip_tracking` 为 `9500`。(`g1_flip_tracking` 的 Motrix owner -YAML 将其提到 `30000`。) +`algo.max_iterations=15000`,`x2_wall_flip_tracking` 为 `9500`。 ```bash uv run train --algo ppo --task g1_motion_tracking --sim mujoco -uv run train --algo ppo --task g1_flip_tracking --sim mujoco uv run train --algo ppo --task x2_wall_flip_tracking --sim mujoco uv run train --algo ppo --task g1_motion_tracking --sim mujoco uv run train --algo appo --task g1_motion_tracking --sim mujoco training.no_play=true diff --git a/docs/sphinx/source/zh_CN/4-developer_guide/9-sim2sim_contract_status.md b/docs/sphinx/source/zh_CN/4-developer_guide/9-sim2sim_contract_status.md index f2379ffb5..6b017bb69 100644 --- a/docs/sphinx/source/zh_CN/4-developer_guide/9-sim2sim_contract_status.md +++ b/docs/sphinx/source/zh_CN/4-developer_guide/9-sim2sim_contract_status.md @@ -30,7 +30,6 @@ uv run scripts/audit_sim2sim_contracts.py |---|---|---| | allegro_inhand · allegro_inhand_grasp · g1_motion_tracking · go2_handstand · go2_joystick_flat | ✅ | 无 | | g1_box_tracking | ❌ | `obs_normalization` false↔true;`obs_groups` critic 组差异 | -| g1_flip_tracking | ❌ | `obs_normalization` true↔false;`action_scale` 29 维↔默认 0.25;`sampling_mode` 两后端运行时同为 `start`(无害) | | g1_walk_flat | ❌ | `env.actions.joint_pos.scale` 0.25↔0.5;`obs_normalization` false↔true;`obs_groups` | ## `src/unilab/conf/appo/task/` @@ -38,7 +37,6 @@ uv run scripts/audit_sim2sim_contracts.py | Task | 判定 | 分歧 | |---|---|---| | allegro_inhand · g1_motion_tracking · go2_joystick_flat | ✅ | 无 | -| g1_flip_tracking | ❌ | `action_scale` 29 维↔默认 0.25;`sampling_mode` 同为 `start`(无害) | | g1_walk_flat | ⚪ | 仅 mujoco | 已迁移的 Unitree owner 由 `unitree_rl_unilab` 自行维护 contract audit;核心状态表不再声称覆盖它们。 diff --git a/docs/sphinx/source/zh_CN/5-reference/5-support_matrix.md b/docs/sphinx/source/zh_CN/5-reference/5-support_matrix.md index c78a85617..f677157a0 100644 --- a/docs/sphinx/source/zh_CN/5-reference/5-support_matrix.md +++ b/docs/sphinx/source/zh_CN/5-reference/5-support_matrix.md @@ -74,7 +74,6 @@ uv run scripts/generate_support_matrix.py --write | PPO (torch) | `go2_joystick_flat` (Go2 joystick) | Tested | - | - | - | - | | PPO (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Registered | Tested | Registered | Configured | | PPO (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | - | - | - | - | -| PPO (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | - | - | - | | PPO (torch) | `x2_wall_flip_tracking` (X2 wall flip tracking) | Tested | - | - | - | - | | PPO (torch) | `allegro_inhand` (Allegro in-hand) | Tested | - | - | - | - | | PPO (torch) | `allegro_inhand_grasp` (allegro inhand grasp) | Tested | - | - | - | - | @@ -83,11 +82,9 @@ uv run scripts/generate_support_matrix.py --write | APPO (torch) | `go2_joystick_flat` (Go2 joystick) | Tested | - | - | - | - | | APPO (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Registered | Registered | Registered | Registered | | APPO (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | - | - | - | - | -| APPO (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | - | - | - | | APPO (torch) | `allegro_inhand` (Allegro in-hand) | Tested | - | - | - | - | | SAC (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Tested | Tested | Tested | Tested | | SAC (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | Registered | Configured | Registered | Configured | -| SAC (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | Configured | - | - | | SAC (torch) | `g1_wbt_obs` (g1 wbt obs) | Tested | - | - | - | - | | FlashSAC (torch) | `go2_joystick_flat` (Go2 joystick) | Tested | - | - | - | - | | FlashSAC (torch) | `g1_walk_flat` (G1 walk flat) | Tested | Registered | Configured | Registered | Registered | diff --git a/scripts/tools/support_matrix.py b/scripts/tools/support_matrix.py index 3b8b5e850..b469f443e 100644 --- a/scripts/tools/support_matrix.py +++ b/scripts/tools/support_matrix.py @@ -98,7 +98,6 @@ "go2_joystick_flat": 0, "g1_walk_flat": 1, "g1_motion_tracking": 2, - "g1_flip_tracking": 3, "x2_wall_flip_tracking": 4, "allegro_inhand": 5, "allegro_sac": 6, @@ -107,7 +106,6 @@ "go2_joystick_flat": "Go2 joystick", "g1_walk_flat": "G1 walk flat", "g1_motion_tracking": "G1 motion tracking", - "g1_flip_tracking": "G1 flip tracking", "x2_wall_flip_tracking": "X2 wall flip tracking", "allegro_inhand": "Allegro in-hand", "allegro_sac": "Allegro SAC in-hand", diff --git a/src/unilab/conf/appo/task/g1_flip_tracking/mujoco.yaml b/src/unilab/conf/appo/task/g1_flip_tracking/mujoco.yaml deleted file mode 100644 index b8f05ad61..000000000 --- a/src/unilab/conf/appo/task/g1_flip_tracking/mujoco.yaml +++ /dev/null @@ -1,117 +0,0 @@ -# @package _global_ -defaults: - - /task/g1_motion_tracking/mujoco - - _self_ - -training: - task_name: G1FlipTracking - sim_backend: mujoco - play_steps: 1000 - -algo: - num_envs: 1024 - steps_per_env: 24 - max_iterations: 3500 - save_interval: 500 - algorithm: - num_learning_epochs: 10 - num_mini_batches: 8 - clip_param: 0.2 - gamma: 0.99 - lam: 0.95 - value_loss_coef: 1.0 - entropy_coef: 0.005 - learning_rate: 1.0e-3 - max_grad_norm: 1.0 - use_clipped_value_loss: true - schedule: adaptive - desired_kl: 0.01 - adaptive_kl_factor: 2.0 - adaptive_lr_factor: 1.5 - optimizer: adam - tau: 1.0 - target_update_freq: 1 - vtrace_clip_rho: 1.0 - vtrace_clip_c: 1.0 - enable_compile: true - -env: - scene: - model_file: src/unilab/assets/robots/g1/scene_flat.xml - sim_dt: 0.005 - actions: - joint_pos: - scale: - ".*_(hip_pitch|hip_yaw)_joint": 0.5475464629911068 - ".*_(hip_roll|knee)_joint": 0.35066146637882434 - ".*_ankle_(pitch|roll)_joint": 0.43857731392336724 - "waist_yaw_joint": 0.5475464629911068 - "waist_(roll|pitch)_joint": 0.43857731392336724 - ".*_(shoulder_(pitch|roll|yaw)|elbow|wrist_roll)_joint": 0.43857731392336724 - ".*_wrist_(pitch|yaw)_joint": 0.07450087032950714 - commands: - motion: - params: - motion_file: motions/g1/flip_360_001__A304.npz - sampling_mode: start - truncate_on_clip_end: true - pose_range: &zero_pose - x: [0.0, 0.0] - y: [0.0, 0.0] - z: [0.0, 0.0] - roll: [0.0, 0.0] - pitch: [0.0, 0.0] - yaw: [0.0, 0.0] - velocity_range: *zero_pose - joint_position_range: [0.0, 0.0] - terminations: - motion_clip_end: - func: unilab.tasks.motion_tracking.common.manager_terms.motion_clip_end - time_out: true - params: {command_name: motion} - anchor_pos: - params: {command_name: motion, threshold: 0.5} - anchor_ori: - params: - command_name: motion - threshold: 1.0e9 - asset_cfg: - _target_: unilab.managers.SceneEntityCfg - name: robot - ee_body_pos: - params: - command_name: motion - threshold: 0.5 - body_names: &ee_bodies - - left_ankle_roll_link - - right_ankle_roll_link - - left_wrist_yaw_link - - right_wrist_yaw_link - undesired_contacts: - func: unilab.tasks.motion_tracking.common.manager_terms.bad_undesired_body_contacts - 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 - -reward: - motion_body_pos: - weight: 2.0 - motion_body_ori: - weight: 1.5 - motion_ee_body_pos_z: - func: unilab.tasks.motion_tracking.common.manager_terms.motion_relative_body_position_z_error_exp - weight: 2.0 - params: {command_name: motion, std: 0.3, body_names: *ee_bodies} - action_rate_l2: - weight: -0.005 diff --git a/src/unilab/conf/ppo/task/g1_flip_tracking/mujoco.yaml b/src/unilab/conf/ppo/task/g1_flip_tracking/mujoco.yaml deleted file mode 100644 index d27b60c40..000000000 --- a/src/unilab/conf/ppo/task/g1_flip_tracking/mujoco.yaml +++ /dev/null @@ -1,110 +0,0 @@ -# @package _global_ -defaults: - - /task/g1_motion_tracking/mujoco - - _self_ - -training: - task_name: G1FlipTracking - sim_backend: mujoco - play_steps: 1000 - -algo: - num_envs: 1024 - max_iterations: 20000 - save_interval: 500 - obs_groups: - actor: [actor] - critic: [critic] - actor: - obs_normalization: true - critic: - obs_normalization: true - algorithm: - entropy_coef: 0.005 - desired_kl: 0.01 - -env: - scene: - model_file: src/unilab/assets/robots/g1/scene_flat.xml - sim_dt: 0.005 - actions: - joint_pos: - scale: - ".*_(hip_pitch|hip_yaw)_joint": 0.5475464629911068 - ".*_(hip_roll|knee)_joint": 0.35066146637882434 - ".*_ankle_(pitch|roll)_joint": 0.43857731392336724 - "waist_yaw_joint": 0.5475464629911068 - "waist_(roll|pitch)_joint": 0.43857731392336724 - ".*_(shoulder_(pitch|roll|yaw)|elbow|wrist_roll)_joint": 0.43857731392336724 - ".*_wrist_(pitch|yaw)_joint": 0.07450087032950714 - commands: - motion: - params: - motion_file: motions/g1/flip_360_001__A304.npz - sampling_mode: start - truncate_on_clip_end: false - pose_range: &zero_pose - x: [0.0, 0.0] - y: [0.0, 0.0] - z: [0.0, 0.0] - roll: [0.0, 0.0] - pitch: [0.0, 0.0] - yaw: [0.0, 0.0] - velocity_range: *zero_pose - joint_position_range: [0.0, 0.0] - terminations: - anchor_pos: - params: {command_name: motion, threshold: 0.5} - anchor_ori: - params: - command_name: motion - threshold: 1.0e9 - asset_cfg: - _target_: unilab.managers.SceneEntityCfg - name: robot - ee_body_pos: - params: - command_name: motion - threshold: 0.5 - body_names: &ee_bodies - - left_ankle_roll_link - - right_ankle_roll_link - - left_wrist_yaw_link - - right_wrist_yaw_link - undesired_contacts: - func: unilab.tasks.motion_tracking.common.manager_terms.bad_undesired_body_contacts - params: - command_name: motion - threshold: 0.05 - body_names: &undesired_bodies - - 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 - -reward: - motion_body_pos: - weight: 2.0 - motion_body_ori: - weight: 1.5 - motion_ee_body_pos_z: - func: unilab.tasks.motion_tracking.common.manager_terms.motion_relative_body_position_z_error_exp - weight: 2.0 - params: {command_name: motion, std: 0.3, body_names: *ee_bodies} - action_rate_l2: - weight: -0.005 - 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: *undesired_bodies} - -play_profile: - enabled: true - env: - render_spacing: 2.0 diff --git a/src/unilab/conf/sac/task/g1_flip_tracking/mjwarp_tensor.yaml b/src/unilab/conf/sac/task/g1_flip_tracking/mjwarp_tensor.yaml deleted file mode 100644 index 96e1a0abc..000000000 --- a/src/unilab/conf/sac/task/g1_flip_tracking/mjwarp_tensor.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# @package _global_ -# DR-free G1 flip-tracking owner for the reusable tensor runtime. This is the -# second Manager-Based task identity; NumPy owners remain the defaults. -defaults: - - /task/g1_flip_tracking/mujoco - - _self_ - -training: - task_name: G1FlipTrackingSAC - sim_backend: mjwarp - play_render_mode: record -env: - commands: - motion: - _target_: unilab.tasks.motion_tracking.common.manager_terms.TensorMotionCommandCfg diff --git a/src/unilab/conf/sac/task/g1_flip_tracking/mujoco.yaml b/src/unilab/conf/sac/task/g1_flip_tracking/mujoco.yaml deleted file mode 100644 index 67982b61e..000000000 --- a/src/unilab/conf/sac/task/g1_flip_tracking/mujoco.yaml +++ /dev/null @@ -1,112 +0,0 @@ -# @package _global_ -defaults: - - /task/g1_motion_tracking/mujoco - - _self_ - -training: - task_name: G1FlipTrackingSAC - sim_backend: mujoco - play_steps: 1000 - -algo: - num_envs: 4096 - max_iterations: 25000 - save_interval: 1000 - gamma: 0.99 - tau: 0.05 - num_atoms: 501 - updates_per_step: 4 - policy_frequency: 2 - algo_params: - alpha_init: 0.005 - target_entropy_ratio: 0.05 - max_grad_norm: 10.0 - -env: - events: - base_com: null - encoder_bias: null - foot_friction: null - push_robot: null - scene: - model_file: src/unilab/assets/robots/g1/scene_flat.xml - sim_dt: 0.005 - actions: - joint_pos: - scale: - ".*_(hip_pitch|hip_yaw)_joint": 0.5475464629911068 - ".*_(hip_roll|knee)_joint": 0.35066146637882434 - ".*_ankle_(pitch|roll)_joint": 0.43857731392336724 - "waist_yaw_joint": 0.5475464629911068 - "waist_(roll|pitch)_joint": 0.43857731392336724 - ".*_(shoulder_(pitch|roll|yaw)|elbow|wrist_roll)_joint": 0.43857731392336724 - ".*_wrist_(pitch|yaw)_joint": 0.07450087032950714 - commands: - motion: - params: - motion_file: motions/g1/flip_360_001__A304.npz - sampling_mode: mixed - sampling_start_ratio: 0.1 - truncate_on_clip_end: true - pose_range: &zero_pose - x: [0.0, 0.0] - y: [0.0, 0.0] - z: [0.0, 0.0] - roll: [0.0, 0.0] - pitch: [0.0, 0.0] - yaw: [0.0, 0.0] - velocity_range: *zero_pose - joint_position_range: [0.0, 0.0] - terminations: - anchor_pos: - params: {command_name: motion, threshold: 0.5} - anchor_ori: - params: - command_name: motion - threshold: 1.0e9 - asset_cfg: - _target_: unilab.managers.SceneEntityCfg - name: robot - ee_body_pos: - params: - command_name: motion - threshold: 0.5 - body_names: &ee_bodies - - left_ankle_roll_link - - right_ankle_roll_link - - left_wrist_yaw_link - - right_wrist_yaw_link - undesired_contacts: - func: unilab.tasks.motion_tracking.common.manager_terms.bad_undesired_body_contacts - params: - command_name: motion - threshold: 0.05 - body_names: &undesired_bodies - - 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 - -reward: - motion_global_root_pos: - weight: 0.5 - motion_body_ori: - weight: 1.5 - motion_ee_body_pos_z: - func: unilab.tasks.motion_tracking.common.manager_terms.motion_relative_body_position_z_error_exp - weight: 2.0 - params: {command_name: motion, std: 0.3, body_names: *ee_bodies} - action_rate_l2: - weight: -0.005 - joint_limit: - weight: -10.0 - 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: *undesired_bodies} diff --git a/src/unilab/tasks/migration_matrix.py b/src/unilab/tasks/migration_matrix.py index 477949848..53555aeaa 100644 --- a/src/unilab/tasks/migration_matrix.py +++ b/src/unilab/tasks/migration_matrix.py @@ -49,8 +49,6 @@ class TaskMigrationRecord: _MOTION_TASKS = frozenset( { "G1BoxTracking", - "G1FlipTracking", - "G1FlipTrackingSAC", "G1WBTObs", "X2WallFlipTracking", } diff --git a/src/unilab/tasks/motion_tracking/g1/__init__.py b/src/unilab/tasks/motion_tracking/g1/__init__.py index 477fc7ae0..ebe63cdf8 100644 --- a/src/unilab/tasks/motion_tracking/g1/__init__.py +++ b/src/unilab/tasks/motion_tracking/g1/__init__.py @@ -9,8 +9,6 @@ "G1MotionTracking", "G1MotionTrackingSAC", "G1BoxTracking", - "G1FlipTracking", - "G1FlipTrackingSAC", "G1WBTObs", ) @@ -45,10 +43,4 @@ make_manager_based_rl_env, sim_backend="motrix", ) -# G1 flip tracking is the second scoped Manager tensor task owner. -registry.register_env( - "G1FlipTrackingSAC", - make_manager_based_rl_env, - sim_backend="mjwarp", -) __all__ = ["BoxMotionData", "BoxMotionLoader", "G1_MOTION_TASKS"] diff --git a/tests/config/test_g1_motion_tracking_owners.py b/tests/config/test_g1_motion_tracking_owners.py index e604ad103..78d5aaf5c 100644 --- a/tests/config/test_g1_motion_tracking_owners.py +++ b/tests/config/test_g1_motion_tracking_owners.py @@ -225,11 +225,6 @@ def test_sac_g1_motion_tracking_genesis_inherits_mujoco_parity() -> None: assert cfg.algo.updates_per_step == mujoco_cfg.algo.updates_per_step -def test_sac_g1_flip_tracking_stays_dr_free() -> None: - cfg = _compose_sac("g1_flip_tracking/mujoco") - assert all(term is None for term in cfg.env.events.values()) - - def test_warpsac_g1_motion_tracking_owners_share_policy_contract() -> None: mujoco_cfg = _compose_warpsac("g1_motion_tracking/mujoco") mjwarp_cfg = _compose_warpsac("g1_motion_tracking/mjwarp") diff --git a/tests/config/test_locomotion_params.py b/tests/config/test_locomotion_params.py index 9ae610ab1..0329c97a5 100644 --- a/tests/config/test_locomotion_params.py +++ b/tests/config/test_locomotion_params.py @@ -11,37 +11,6 @@ CONF_DIR = Path(__file__).parent.parent.parent / "src" / "unilab" / "conf" -G1_BEYONDMIMIC_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, -] X2_ACTION_SCALE = [0.25] * 29 @@ -348,37 +317,6 @@ def test_ppo_g1_box_tracking(): assert cfg.reward.object_global_ref_orientation_error_exp.params.std == pytest.approx(0.3) -def test_ppo_g1_flip_tracking(): - from hydra import compose, initialize_config_dir - from hydra.core.global_hydra import GlobalHydra - - GlobalHydra.instance().clear() - with initialize_config_dir(config_dir=str(CONF_DIR / "ppo"), version_base="1.3"): - cfg = compose("config", overrides=["task=g1_flip_tracking/mujoco"]) - assert cfg.training.task_name == "G1FlipTracking" - assert cfg.algo.num_envs == 1024 - assert cfg.algo.max_iterations == 20000 - assert cfg.algo.actor.obs_normalization is True - assert cfg.algo.critic.obs_normalization is True - assert cfg.algo.obs_groups.critic == ["critic"] - assert cfg.algo.algorithm.entropy_coef == pytest.approx(0.005) - assert cfg.algo.algorithm.desired_kl == pytest.approx(0.01) - assert cfg.env.commands.motion.params.sampling_mode == "start" - assert cfg.env.commands.motion.params.truncate_on_clip_end is False - assert cfg.env.sim_dt == pytest.approx(0.005) - assert cfg.env.actions.joint_pos.scale[".*_(hip_pitch|hip_yaw)_joint"] == pytest.approx( - G1_BEYONDMIMIC_ACTION_SCALE[0] - ) - assert cfg.env.terminations.anchor_pos.params.threshold == pytest.approx(0.5) - assert cfg.env.terminations.ee_body_pos.params.threshold == pytest.approx(0.5) - assert cfg.env.terminations.undesired_contacts is not None - assert cfg.reward.motion_body_pos.weight == pytest.approx(2.0) - assert cfg.reward.motion_body_ori.weight == pytest.approx(1.5) - assert cfg.reward.motion_ee_body_pos_z.weight == pytest.approx(2.0) - assert cfg.reward.action_rate_l2.weight == pytest.approx(-0.005) - assert cfg.reward.undesired_contacts.weight == pytest.approx(-0.1) - - def test_ppo_x2_wall_flip_tracking(): from hydra import compose, initialize_config_dir from hydra.core.global_hydra import GlobalHydra diff --git a/tests/envs/test_motion_command_partial_reset.py b/tests/envs/test_motion_command_partial_reset.py index 9216c1629..f86176e3e 100644 --- a/tests/envs/test_motion_command_partial_reset.py +++ b/tests/envs/test_motion_command_partial_reset.py @@ -31,10 +31,7 @@ _ROOT = Path(__file__).parents[2] -_CASES = ( - ("ppo", "g1_flip_tracking", "G1FlipTracking"), - ("ppo", "g1_box_tracking", "G1BoxTracking"), -) +_CASES = (("ppo", "g1_box_tracking", "G1BoxTracking"),) _SAMPLER_STAT_METRICS = ("sampling_entropy", "sampling_top1_prob", "sampling_top1_bin") diff --git a/tests/envs/test_motion_profiles.py b/tests/envs/test_motion_profiles.py index 1ef48def5..9b79c9fd6 100644 --- a/tests/envs/test_motion_profiles.py +++ b/tests/envs/test_motion_profiles.py @@ -24,8 +24,6 @@ _PROFILE_IDENTITIES = ( "G1BoxTracking", - "G1FlipTracking", - "G1FlipTrackingSAC", "G1WBTObs", "X2WallFlipTracking", ) @@ -37,7 +35,6 @@ "scene_flat_with_largebox.xml", "sub3_largebox_003_boxconverted.npz", ), - ("g1_flip_tracking", "G1FlipTracking", "scene_flat.xml", "flip_360_001__A304.npz"), ( "x2_wall_flip_tracking", "X2WallFlipTracking", @@ -46,32 +43,15 @@ ), ) -_APPO_PROFILES = tuple( - profile - for profile in _PPO_PROFILES - if "box" not in profile[0] and not profile[0].startswith("x2") -) - -_SAC_PROFILES = ( - ("g1_flip_tracking", "G1FlipTrackingSAC", "scene_flat.xml", "flip_360_001__A304.npz"), - ("g1_wbt_obs", "G1WBTObs", "scene_flat.xml", "dance1_subject2_part.npz"), -) +_SAC_PROFILES = (("g1_wbt_obs", "G1WBTObs", "scene_flat.xml", "dance1_subject2_part.npz"),) -_OWNER_CASES = ( - tuple( - ("ppo", task, backend, identity, scene, motion) - for task, identity, scene, motion in _PPO_PROFILES - for backend in ("mujoco", "motrix") - ) - + tuple( - ("appo", task, backend, identity, scene, motion) - for task, identity, scene, motion in _APPO_PROFILES - for backend in ("mujoco", "motrix") - ) - + tuple( - ("sac", task, "mujoco", identity, scene, motion) - for task, identity, scene, motion in _SAC_PROFILES - ) +_OWNER_CASES = tuple( + ("ppo", task, backend, identity, scene, motion) + for task, identity, scene, motion in _PPO_PROFILES + for backend in ("mujoco", "motrix") +) + tuple( + ("sac", task, "mujoco", identity, scene, motion) + for task, identity, scene, motion in _SAC_PROFILES ) _LEGACY_G1_ACTION_SCALE = ( @@ -84,10 +64,6 @@ (r".*_wrist_(pitch|yaw)_joint", 0.07450087032950714), ) -_LEGACY_SCALAR_ACTION_SCALE = { - ("ppo", "g1_flip_tracking", "motrix"): 0.25, -} - def _compose_owner(config_root: str, task: str, backend: str) -> Any: GlobalHydra.instance().clear() @@ -194,7 +170,7 @@ def test_motion_profile_action_scale_matches_legacy_runtime( _, cfg, _ = _materialize_profile(config_root, task, backend, identity) joint_names, actual = _resolved_action_scale(cfg) - scalar = _LEGACY_SCALAR_ACTION_SCALE.get((config_root, task, backend)) + scalar: float | None = None if "box_tracking" in task or task == "x2_wall_flip_tracking": scalar = 0.25 elif "wbt_obs" in task: @@ -208,49 +184,6 @@ def test_motion_profile_action_scale_matches_legacy_runtime( np.testing.assert_allclose(actual, expected) -@pytest.mark.parametrize( - ( - "task", - "backend", - "adaptive_kl_factor", - "adaptive_lr_factor", - "enable_compile", - "steps_per_env", - "replay_queue_size", - ), - ( - ("g1_flip_tracking", "mujoco", 2.0, 1.5, True, 24, None), - ("g1_flip_tracking", "motrix", 2.0, 1.5, True, 24, None), - ), -) -def test_appo_profiles_preserve_training_owner_contract( - task: str, - backend: str, - adaptive_kl_factor: float, - adaptive_lr_factor: float, - enable_compile: bool, - steps_per_env: int, - replay_queue_size: int | None, -) -> None: - owner = _compose_owner("appo", task, backend) - - assert owner.algo.algorithm.adaptive_kl_factor == pytest.approx(adaptive_kl_factor) - assert owner.algo.algorithm.adaptive_lr_factor == pytest.approx(adaptive_lr_factor) - assert owner.algo.algorithm.enable_compile is enable_compile - assert owner.algo.steps_per_env == steps_per_env - assert owner.training.replay_queue_size == replay_queue_size - - -@pytest.mark.parametrize("task", ("g1_flip_tracking",)) -def test_ppo_motrix_flip_profiles_keep_actor_normalization_disabled(task: str) -> None: - owner = _compose_owner("ppo", task, "motrix") - - assert owner.algo.actor.obs_normalization is False - assert owner.algo.critic.obs_normalization is False - assert owner.algo.obs_groups.actor == ["actor"] - assert owner.algo.obs_groups.critic == ["critic"] - - @pytest.mark.parametrize( "task", ("x2_wall_flip_tracking",), @@ -278,11 +211,10 @@ def test_all_motion_profiles_have_one_manager_factory_and_both_backends() -> Non assert set(metadata[identity]["available_backends"]) >= {"mujoco", "motrix"} -def test_box_flip_wbt_and_x2_profiles_keep_only_owner_differences() -> None: +def test_box_wbt_and_x2_profiles_keep_only_owner_differences() -> None: from unilab.tasks.motion_tracking.g1.manager_terms import BoxMotionCommandCfg _, box, _ = _materialize_profile("ppo", "g1_box_tracking", "mujoco", "G1BoxTracking") - _, flip, _ = _materialize_profile("sac", "g1_flip_tracking", "mujoco", "G1FlipTrackingSAC") _, wbt, _ = _materialize_profile("sac", "g1_wbt_obs", "mujoco", "G1WBTObs") _, x2, _ = _materialize_profile("ppo", "x2_wall_flip_tracking", "mujoco", "X2WallFlipTracking") @@ -293,9 +225,6 @@ def test_box_flip_wbt_and_x2_profiles_keep_only_owner_differences() -> None: assert box.observations["critic"].terms["base_ang_vel"].params == {"sensor_name": "pelvis_gyro"} assert box.observations["critic"].terms["object_state"] is not None - assert flip.commands["motion"].params.sampling_mode == "mixed" - assert flip.commands["motion"].params.sampling_start_ratio == pytest.approx(0.1) - actor_terms = wbt.observations["actor"].terms critic_terms = wbt.observations["critic"].terms assert actor_terms["motion_anchor_pos_b"] is None diff --git a/tests/scripts/test_train_script_configs.py b/tests/scripts/test_train_script_configs.py index f3f70af51..782db8dbd 100644 --- a/tests/scripts/test_train_script_configs.py +++ b/tests/scripts/test_train_script_configs.py @@ -27,12 +27,10 @@ "go2_joystick_flat/mujoco", "g1_walk_flat/mujoco", "g1_motion_tracking/mujoco", - "g1_flip_tracking/mujoco", ] APPO_MOTION_SMOKE_TASKS = { "g1_motion_tracking/mujoco", - "g1_flip_tracking/mujoco", "g1_box_tracking/mujoco", } diff --git a/tests/tasks/test_flashsac_owner_contract.py b/tests/tasks/test_flashsac_owner_contract.py index 7d2e4ac68..2af01f5e1 100644 --- a/tests/tasks/test_flashsac_owner_contract.py +++ b/tests/tasks/test_flashsac_owner_contract.py @@ -11,7 +11,6 @@ from unilab.base.config_materialization import apply_cfg_overrides from unilab.base.variants import FixedModelVariantCatalogCfg, FixedModelVariantCfg from unilab.envs import ManagerBasedRlEnvCfg -from unilab.tasks.motion_tracking.common.manager_terms import TensorMotionCommandCfg from unilab.tasks.motion_tracking.g1 import flashsac_owner_contract as module ROOT_DIR = Path(__file__).parents[2] @@ -52,12 +51,6 @@ def test_reusable_tensor_runtime_accepts_second_g1_manager_owner() -> None: assert module._torch_g1_flashsac_owner_identity(cfg) == module._TORCH_G1_SAC_OWNER_IDENTITY_V2 -def test_reusable_tensor_runtime_accepts_second_manager_based_task() -> None: - cfg = _materialize_task("g1_flip_tracking/mjwarp_tensor", algo="sac") - assert cfg.commands["motion"].sampling_mode == "mixed" - assert isinstance(cfg.commands["motion"], TensorMotionCommandCfg) - - @pytest.mark.parametrize( "mutate", [