diff --git a/docs/sphinx/source/en/2-user_guide/2-algorithms/3-sac.md b/docs/sphinx/source/en/2-user_guide/2-algorithms/3-sac.md index 1d945c93f..6f3f2ff3b 100644 --- a/docs/sphinx/source/en/2-user_guide/2-algorithms/3-sac.md +++ b/docs/sphinx/source/en/2-user_guide/2-algorithms/3-sac.md @@ -20,7 +20,6 @@ CPU and XPU training are unsupported; there is no alternate replay pipeline. ```bash uv run train --algo sac --task g1_walk_flat --sim mujoco -uv run train --algo sac --task g1_walk_rough --sim motrix training.no_play=true ``` ## Key Fields diff --git a/docs/sphinx/source/en/2-user_guide/4-tasks/1-locomotion.md b/docs/sphinx/source/en/2-user_guide/4-tasks/1-locomotion.md index e76ab2c67..633bc1ce2 100644 --- a/docs/sphinx/source/en/2-user_guide/4-tasks/1-locomotion.md +++ b/docs/sphinx/source/en/2-user_guide/4-tasks/1-locomotion.md @@ -7,7 +7,7 @@ Manager-Based runtime. Unitree production variants live in the downstream ## Core reference tasks - Go2 joystick: `go2_joystick_flat` -- G1 walking: `g1_walk_flat`, `g1_walk_rough` +- G1 walking: `g1_walk_flat` - G1 motion tracking reference profiles: see {doc}`2-motion_tracking` ```bash diff --git a/docs/sphinx/source/en/2-user_guide/5-domain_randomization/0-index.md b/docs/sphinx/source/en/2-user_guide/5-domain_randomization/0-index.md index c4f674973..15522dd4a 100644 --- a/docs/sphinx/source/en/2-user_guide/5-domain_randomization/0-index.md +++ b/docs/sphinx/source/en/2-user_guide/5-domain_randomization/0-index.md @@ -33,7 +33,6 @@ These three paths correspond to three lifecycle classes: | --- | --- | --- | --- | --- | --- | | `Go2JoystickFlat` | Hydra `events:` terms | Yes: owner YAML declares reset events | root-state reset + `pd_gains` kp/kd | none | `src/unilab/conf/ppo/task/go2_joystick_flat/base.yaml` | | `G1WalkFlat` | Hydra `events:` terms | Yes: Hydra `EventTermCfg` + Manager-Based reset terms | root-state reset + kp/kd via `pd_gains` | none | `g1/manager_terms.py` | -| `G1WalkRough` | Hydra `events:` terms | Yes: same Manager-Based event terms as `G1WalkFlat` | root-state reset + kp/kd via `pd_gains` | none | `g1/manager_terms.py` | | `G1MotionTracking` | Hydra command term | Yes: Hydra `MotionCommandCfg` + Manager-Based command reset | motion frame, root pose/velocity, and joint-position sampling | none | `motion_tracking/common/manager_terms.py` | | `G1WBTObs` | Hydra `events:` terms | Yes: same motion command + Hydra `EventTermCfg` | motion reset plus mass/COM/PD/friction/encoder-bias events | interval velocity kick | `motion_tracking/g1/manager_terms.py` | | `AllegroInhandRotation` | Hydra `events:` terms | Yes: Hydra `EventTermCfg` + Manager-Based reset term | entity-scoped hand/ball reset | none | `allegro_inhand/manager_terms.py` | @@ -45,7 +44,6 @@ These three paths correspond to three lifecycle classes: | --- | --- | --- | --- | | `Go2JoystickFlat` | base xy/yaw and base qvel via `reset_root_state_uniform`; command sampling; kp/kd via `pd_gains` | none | event terms declared and enabled by default in `src/unilab/conf/ppo/task/go2_joystick_flat/base.yaml` | | `G1WalkFlat` | base xy/yaw and base qvel via `reset_root_state_uniform`; command sampling with a planar dead zone; `gait_phase` sampling; kp/kd randomization via `pd_gains` | none | kp/kd enabled on mujoco owners by default; disabled on motrix/mjwarp owners | -| `G1WalkRough` | Same as `G1WalkFlat` (shared owner bases, rough scene) | none | Same defaults as `G1WalkFlat` | | `G1MotionTracking` | Motion-command frame sampling; root pose perturbation `x/y/z/roll/pitch/yaw`; root velocity perturbation `x/y/z/roll/pitch/yaw`; joint-position noise clipped through the public entity soft limits; action-manager state reset | none | `pose_range`, `velocity_range`, and `joint_position_range` have non-zero perturbations in the base owner | | `G1WBTObs` | Same motion reset plus base mass, base COM, PD gain, foot friction, and encoder-bias event terms | `push_by_setting_velocity` | The WBT owner explicitly enables all listed event terms; unsupported capabilities raise rather than fall back | | `AllegroInhandRotation` | Entity-scoped hand/ball reset; an explicitly configured grasp cache is sampled, otherwise `null` explicitly selects the model home pose; optional `joint_noise`, `ball_velocity_noise`, and `ball_z_offset` | none | owner YAML explicitly selects the home pose and zero reset noise; a configured missing or malformed cache fails closed | @@ -132,7 +130,6 @@ The ownership boundary and MJWarp/CPU executor split are recorded in ## Related Tasks - {doc}`G1 Motion Tracking <../4-tasks/2-motion_tracking>`: confirm motion assets and replay first before enabling DR. -- {doc}`Go2 Rough Terrain <../4-tasks/1-locomotion>`: common items are mass, COM, friction, and push. For the backend capability boundary, see {doc}`Domain Randomization Contract `. diff --git a/docs/sphinx/source/en/2-user_guide/6-terrain/1-procedural.md b/docs/sphinx/source/en/2-user_guide/6-terrain/1-procedural.md index ec3b2bf79..5c8bc8b12 100644 --- a/docs/sphinx/source/en/2-user_guide/6-terrain/1-procedural.md +++ b/docs/sphinx/source/en/2-user_guide/6-terrain/1-procedural.md @@ -28,10 +28,10 @@ env: seed: 42 ``` -UniLab does not retain a procedural-terrain production owner. The retained -`g1_walk_rough` task uses the static-heightfield form of the same cold-path -scene contract, while generator composition itself is covered by core terrain -and backend materialization tests. +UniLab does not retain a procedural-terrain production owner. Generator +composition and backend materialization are covered by core terrain and +materialization tests; task owners that enable the capability carry their own +training evidence. ## Materialization boundary @@ -47,15 +47,10 @@ During `registry.make(...)`: Step and reset never parse robot XML or inspect asset metadata. They consume cached IDs and public backend capabilities. -## Example +## Owner integration -Use the retained rough-scene reference task: - -```bash -uv run train --algo sac --task g1_walk_rough --sim mujoco training.no_play=true -``` - -Custom owners can tune the terrain grid and seed through Hydra: +Select a task owner that declares `env.scene.terrain`, then tune the terrain +grid and seed through Hydra: ```text env.scene.terrain.generator.num_rows=4 diff --git a/docs/sphinx/source/en/2-user_guide/6-terrain/2-heightfield_import.md b/docs/sphinx/source/en/2-user_guide/6-terrain/2-heightfield_import.md index 4514f4546..b5c3fd06c 100644 --- a/docs/sphinx/source/en/2-user_guide/6-terrain/2-heightfield_import.md +++ b/docs/sphinx/source/en/2-user_guide/6-terrain/2-heightfield_import.md @@ -1,25 +1,23 @@ # Heightfield Import Heightfield terrain is configured through `SceneCfg` and the terrain generator, -then materialized by the backend on the init path. The committed user-facing -example is the retained `g1_walk_rough` scene. +then materialized by the backend on the init path. Core tests exercise the +contract with a generated heightfield scene. ## Files To Read - `src/unilab/terrains/heightfield_terrains.py` - `unisim.terrain.generator` -- `src/unilab/assets/robots/g1/scene_rough.xml` - `src/unilab/tasks/locomotion/common/height_scan.py` +- `tests/utils/test_xml_utils.py` - `unisim.backend.mujoco.xml` - `unisim.backend.motrix.scene` ## Smoke Commands ```bash -uv run train --algo sac --task g1_walk_rough --sim mujoco \ - algo.max_iterations=2 \ - algo.num_envs=64 \ - training.no_play=true +uv run pytest tests/utils/test_xml_utils.py \ + -k materialize_mujoco_hfield_attached_scene ``` Height scan IDs and offsets are cached during env initialization; hot paths call diff --git a/docs/sphinx/source/en/4-developer_guide/1-architecture/4-scene_composition.md b/docs/sphinx/source/en/4-developer_guide/1-architecture/4-scene_composition.md index b76e9fe2f..bd0fc12af 100644 --- a/docs/sphinx/source/en/4-developer_guide/1-architecture/4-scene_composition.md +++ b/docs/sphinx/source/en/4-developer_guide/1-architecture/4-scene_composition.md @@ -101,14 +101,14 @@ Disallowed on hot paths: - Probing backend-private scene methods instead of using explicit contracts. - Regenerating terrain after env construction. -## Go2 Rough Terrain Evidence +## Terrain Contract Evidence -The current procedural terrain user-facing path is Go2 rough terrain: +The core repository keeps the terrain contract and its materialization tests, +but it does not own a production rough-terrain task: -- Task owner: `src/unilab/tasks/locomotion/g1/manager_terms.py` - Terrain generator: `unisim.terrain.generator` - MuJoCo materializer: `unisim.backend.mujoco.xml` - Motrix materializer: `unisim.backend.motrix.scene` -- Owner YAMLs: `src/unilab/conf/sac/task/g1_walk_rough/{mujoco,motrix}.yaml` +- Contract coverage: `tests/utils/test_xml_utils.py` User instructions are in {doc}`../../2-user_guide/6-terrain/1-procedural`. 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 790990207..2131d83bd 100644 --- a/docs/sphinx/source/en/5-reference/5-support_matrix.md +++ b/docs/sphinx/source/en/5-reference/5-support_matrix.md @@ -94,7 +94,6 @@ rendering/playback paths remain unsupported. | 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_walk_rough` (G1 walk rough) | Tested | - | Tested | - | - | - | - | - | | SAC (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | Configured | Tested | - | - | - | - | - | | SAC (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | Registered | - | - | - | - | - | | SAC (torch) | `g1_wbt_obs` (g1 wbt obs) | Tested | - | Registered | - | - | - | - | - | diff --git a/docs/sphinx/source/zh_CN/2-user_guide/2-algorithms/3-sac.md b/docs/sphinx/source/zh_CN/2-user_guide/2-algorithms/3-sac.md index 734044002..a03876dca 100644 --- a/docs/sphinx/source/zh_CN/2-user_guide/2-algorithms/3-sac.md +++ b/docs/sphinx/source/zh_CN/2-user_guide/2-algorithms/3-sac.md @@ -17,7 +17,6 @@ submission。CPU 与 XPU training 不受支持,也不存在第二套 replay pi ```bash uv run train --algo sac --task g1_walk_flat --sim mujoco -uv run train --algo sac --task g1_walk_rough --sim motrix training.no_play=true ``` ## 关键字段 diff --git a/docs/sphinx/source/zh_CN/2-user_guide/4-tasks/1-locomotion.md b/docs/sphinx/source/zh_CN/2-user_guide/4-tasks/1-locomotion.md index 39fdd518f..02a82561e 100644 --- a/docs/sphinx/source/zh_CN/2-user_guide/4-tasks/1-locomotion.md +++ b/docs/sphinx/source/zh_CN/2-user_guide/4-tasks/1-locomotion.md @@ -6,7 +6,7 @@ runtime。Unitree production 变体由下游 `unitree_rl_unilab` 包维护。 ## 核心参考任务 - Go2 joystick: `go2_joystick_flat` -- G1 walking: `g1_walk_flat`, `g1_walk_rough` +- G1 walking: `g1_walk_flat` - G1 motion tracking 参考配置:见 {doc}`2-motion_tracking` ```bash diff --git a/docs/sphinx/source/zh_CN/2-user_guide/5-domain_randomization/0-index.md b/docs/sphinx/source/zh_CN/2-user_guide/5-domain_randomization/0-index.md index fa8b5eda5..a44e8d707 100644 --- a/docs/sphinx/source/zh_CN/2-user_guide/5-domain_randomization/0-index.md +++ b/docs/sphinx/source/zh_CN/2-user_guide/5-domain_randomization/0-index.md @@ -29,7 +29,6 @@ Manager-Based event term 是唯一 DR 声明路径: | --- | --- | --- | --- | --- | --- | | `Go2JoystickFlat` | Hydra `events:` term | 是:owner YAML 声明 reset event | root-state reset + `pd_gains` kp/kd | 无 | `src/unilab/conf/ppo/task/go2_joystick_flat/base.yaml` | | `G1WalkFlat` | Hydra `events:` term | 是:Hydra `EventTermCfg` + Manager-Based reset term | root-state reset + 经 `pd_gains` 的 kp/kd | 无 | `g1/manager_terms.py` | -| `G1WalkRough` | Hydra `events:` term | 是:与 `G1WalkFlat` 相同的 Manager-Based event term | root-state reset + 经 `pd_gains` 的 kp/kd | 无 | `g1/manager_terms.py` | | `G1MotionTracking` | Hydra command term | 是:Hydra `MotionCommandCfg` + Manager-Based command reset | motion frame、root pose/velocity 与 joint-position 采样 | 无 | `motion_tracking/common/manager_terms.py` | | `G1WBTObs` | Hydra `events:` term | 是:同一 motion command + Hydra `EventTermCfg` | motion reset 加 mass/COM/PD/friction/encoder-bias event | interval velocity kick | `motion_tracking/g1/manager_terms.py` | | `AllegroInhandRotation` | Hydra `events:` term | 是:Hydra `EventTermCfg` + Manager-Based reset term | entity 范围的手/球 reset | 无 | `allegro_inhand/manager_terms.py` | @@ -41,7 +40,6 @@ Manager-Based event term 是唯一 DR 声明路径: | --- | --- | --- | --- | | `Go2JoystickFlat` | 经 `reset_root_state_uniform` 的 base xy/yaw 与 base qvel;command 采样;经 `pd_gains` 的 kp/kd | 无 | event term 在 `src/unilab/conf/ppo/task/go2_joystick_flat/base.yaml` 中默认声明并启用 | | `G1WalkFlat` | 经 `reset_root_state_uniform` 的 base xy/yaw 与 base qvel;带平面死区的 command 采样;`gait_phase` 采样;经 `pd_gains` 的 kp/kd 随机化 | 无 | mujoco owner 默认启用 kp/kd;motrix/mjwarp owner 默认禁用 | -| `G1WalkRough` | 与 `G1WalkFlat` 相同(共享 owner base,rough 场景) | 无 | 与 `G1WalkFlat` 相同的默认值 | | `G1MotionTracking` | Motion-command frame 采样;root 位姿扰动 `x/y/z/roll/pitch/yaw`;root 速度扰动 `x/y/z/roll/pitch/yaw`;通过 public entity soft limit clip 的关节位置噪声;action-manager 状态 reset | 无 | base owner 中 `pose_range`、`velocity_range` 与 `joint_position_range` 默认有非零扰动 | | `G1WBTObs` | 同一 motion reset 加 base mass、base COM、PD gain、足端摩擦和 encoder-bias event term | `push_by_setting_velocity` | WBT owner 显式启用上述全部 event term;能力不支持时直接报错,不回退 | | `AllegroInhandRotation` | entity 范围的手/球 reset;显式配置 grasp cache 时进行采样,否则以 `null` 显式选择模型 home pose;可选 `joint_noise`、`ball_velocity_noise` 与 `ball_z_offset` | 无 | owner YAML 显式选择 home pose 与零 reset 噪声;配置的 cache 缺失或格式错误时 fail-closed | @@ -119,7 +117,6 @@ Reset-time model-field DR 保持在已选 identity 内。其 canonical 或 per-e ## 相关任务 - {doc}`G1 Motion Tracking <../4-tasks/2-motion_tracking>`:开启 DR 前先确认 motion 资产和 replay。 -- {doc}`Go2 Rough Terrain <../4-tasks/1-locomotion>`:常见的是 mass、COM、friction、push。 有关后端能力边界,请参阅 {doc}`Domain Randomization Contract `。 diff --git a/docs/sphinx/source/zh_CN/2-user_guide/6-terrain/1-procedural.md b/docs/sphinx/source/zh_CN/2-user_guide/6-terrain/1-procedural.md index b41fb1e6d..0d89145e5 100644 --- a/docs/sphinx/source/zh_CN/2-user_guide/6-terrain/1-procedural.md +++ b/docs/sphinx/source/zh_CN/2-user_guide/6-terrain/1-procedural.md @@ -26,9 +26,9 @@ env: seed: 42 ``` -UniLab 不保留 procedural-terrain production owner。保留的 `g1_walk_rough` -任务使用同一冷路径 scene contract 的静态 heightfield 形式;generator 组合 -本身由核心 terrain 与 backend materialization 测试覆盖。 +UniLab 不保留 procedural-terrain production owner。generator 组合与 backend +materialization 由核心 terrain 和 materialization 测试覆盖;启用该能力的 +task owner 需要自行持有训练证据。 ## 物化边界 @@ -44,15 +44,10 @@ UniLab 不保留 procedural-terrain production owner。保留的 `g1_walk_rough` step 和 reset 不解析机器人 XML,也不检查 asset metadata;它们只消费缓存 ID 和公开 backend capability。 -## 示例 +## Owner 集成 -使用保留的 rough-scene reference task: - -```bash -uv run train --algo sac --task g1_walk_rough --sim mujoco training.no_play=true -``` - -自定义 owner 可以通过 Hydra 调整 terrain 网格与 seed: +选择声明了 `env.scene.terrain` 的 task owner,然后通过 Hydra 调整 terrain +网格与 seed: ```text env.scene.terrain.generator.num_rows=4 diff --git a/docs/sphinx/source/zh_CN/2-user_guide/6-terrain/2-heightfield_import.md b/docs/sphinx/source/zh_CN/2-user_guide/6-terrain/2-heightfield_import.md index 58971c1c0..c920df7f9 100644 --- a/docs/sphinx/source/zh_CN/2-user_guide/6-terrain/2-heightfield_import.md +++ b/docs/sphinx/source/zh_CN/2-user_guide/6-terrain/2-heightfield_import.md @@ -1,23 +1,21 @@ # 高度场导入 -高度场地形通过 `SceneCfg` 和地形生成器进行配置,然后在 init 路径上由后端实例化。已提交的面向用户示例是保留的 `g1_walk_rough` 场景。 +高度场地形通过 `SceneCfg` 和地形生成器进行配置,然后在 init 路径上由后端实例化。核心测试使用生成式 heightfield 场景覆盖该契约。 ## 需要阅读的文件 - `src/unilab/terrains/heightfield_terrains.py` - `unisim.terrain.generator` -- `src/unilab/assets/robots/g1/scene_rough.xml` - `src/unilab/tasks/locomotion/common/height_scan.py` +- `tests/utils/test_xml_utils.py` - `unisim.backend.mujoco.xml` - `unisim.backend.motrix.scene` ## 冒烟命令 ```bash -uv run train --algo sac --task g1_walk_rough --sim mujoco \ - algo.max_iterations=2 \ - algo.num_envs=64 \ - training.no_play=true +uv run pytest tests/utils/test_xml_utils.py \ + -k materialize_mujoco_hfield_attached_scene ``` 高度扫描的 ID 和偏移在 env 初始化期间缓存;热路径调用后端高度 scanner contract,而不是解析 XML 或 asset 元数据。 diff --git a/docs/sphinx/source/zh_CN/4-developer_guide/1-architecture/4-scene_composition.md b/docs/sphinx/source/zh_CN/4-developer_guide/1-architecture/4-scene_composition.md index 76f0b5abd..7b4aa03aa 100644 --- a/docs/sphinx/source/zh_CN/4-developer_guide/1-architecture/4-scene_composition.md +++ b/docs/sphinx/source/zh_CN/4-developer_guide/1-architecture/4-scene_composition.md @@ -94,14 +94,14 @@ materializer。 - 探测 backend 私有的场景方法,而不使用明确的契约。 - 在 env 构造完成后重新生成地形。 -## Go2 崎岖地形证据 +## 地形契约证据 -当前面向用户的程序化地形路径是 Go2 崎岖地形: +核心仓库保留 terrain contract 与 materialization 测试,但不再持有 +production rough-terrain 任务: -- Task owner:`src/unilab/tasks/locomotion/g1/manager_terms.py` - 地形生成器:`unisim.terrain.generator` - MuJoCo materializer:`unisim.backend.mujoco.xml` - Motrix materializer:`unisim.backend.motrix.scene` -- Owner YAML:`src/unilab/conf/sac/task/g1_walk_rough/{mujoco,motrix}.yaml` +- 契约覆盖:`tests/utils/test_xml_utils.py` 用户使用说明见 {doc}`../../2-user_guide/6-terrain/1-procedural`。 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 35722ba4b..60f8c83a7 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 @@ -77,7 +77,6 @@ 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_walk_rough` (G1 walk rough) | Tested | - | Tested | - | - | - | - | - | | SAC (torch) | `g1_motion_tracking` (G1 motion tracking) | Tested | Configured | Tested | - | - | - | - | - | | SAC (torch) | `g1_flip_tracking` (G1 flip tracking) | Tested | - | Registered | - | - | - | - | - | | SAC (torch) | `g1_wbt_obs` (g1 wbt obs) | Tested | - | Registered | - | - | - | - | - | diff --git a/scripts/benchmark/env/benchmark_env_step.py b/scripts/benchmark/env/benchmark_env_step.py index 51700ced4..e24a93473 100644 --- a/scripts/benchmark/env/benchmark_env_step.py +++ b/scripts/benchmark/env/benchmark_env_step.py @@ -6,7 +6,6 @@ # Single task + backend: uv run scripts/benchmark/env/benchmark_env_step.py task=g1_walk_flat/motrix - uv run scripts/benchmark/env/benchmark_env_step.py task=g1_walk_rough/mujoco # mjwarp backend (Phase 1: g1_walk_flat only) requires extra deps: uv run --with mujoco-warp --with warp-lang \\ @@ -185,44 +184,6 @@ def _ppo_owner_yaml_cfg( ) -def _sac_owner_yaml_cfg( - task_id: str, - backend: str, - env_cfg_cls: Callable[[], Any], - config_overrides: list[str], -) -> Any: - yaml_backend = _hydra_yaml_backend(backend) - return _owner_yaml_cfg( - config_root="sac", - algo_name="sac", - overrides=[f"task={task_id}/{yaml_backend}"], - config_overrides=config_overrides, - env_cfg_cls=env_cfg_cls, - ) - - -def _materialize_g1_rough_benchmark_scene() -> str: - import shutil - import xml.etree.ElementTree as ET - - source_dir = ROOT_DIR / "src" / "unilab" / "assets" / "robots" / "g1" - output_dir = Path("/tmp/unilab_benchmark_g1_rough_scene") - output_dir.mkdir(parents=True, exist_ok=True) - - for name in ("g1.xml",): - shutil.copy2(source_dir / name, output_dir / name) - for name in ("assets", "textures", "hfields"): - shutil.copytree(source_dir / name, output_dir / name, dirs_exist_ok=True) - - tree = ET.parse(source_dir / "scene_rough.xml") - hfield = tree.getroot().find("./asset/hfield[@name='hfield']") - if hfield is not None: - hfield.set("file", "hfields/hfield.png") - output_path = output_dir / "scene_rough.xml" - tree.write(output_path) - return str(output_path) - - def _manager_env_cls() -> Callable[..., Any]: from unilab.envs import make_manager_based_rl_env @@ -241,12 +202,6 @@ def _g1_flat_cfg(backend: str, config_overrides: list[str]) -> Any: return _ppo_owner_yaml_cfg("g1_walk_flat", backend, ManagerBasedRlEnvCfg, config_overrides) -def _g1_rough_cfg(backend: str, config_overrides: list[str]) -> Any: - from unilab.envs import ManagerBasedRlEnvCfg - - return _sac_owner_yaml_cfg("g1_walk_rough", backend, ManagerBasedRlEnvCfg, config_overrides) - - def _g1_motion_tracking_cfg(backend: str, config_overrides: list[str]) -> Any: from unilab.envs import ManagerBasedRlEnvCfg @@ -279,14 +234,6 @@ def _g1_walk_env_cls() -> type: env_cls_factory=_g1_walk_env_cls, backends=("mujoco", "motrix", "mjwarp"), ), - "g1_rough": TaskConfig( - task_id="g1_walk_rough", - env_name="G1WalkRough", - cfg_factory=_g1_rough_cfg, - env_cls_factory=_g1_walk_env_cls, - aliases=("sac/g1_walk_rough",), - backends=("mujoco", "motrix", "mjwarp"), - ), "g1_mt": TaskConfig( task_id="g1_motion_tracking", env_name="G1MotionTracking", @@ -305,7 +252,6 @@ def _g1_walk_env_cls() -> type: "go2": "#54A24B", "g1": "#F58518", "g1_mt": "#B279A2", - "g1_rough": "#E45756", } BACKEND_STYLES = { "mujoco": {"marker": "o", "linestyle": "-", "hatch": "//"}, @@ -653,8 +599,6 @@ def _short_task_label(task_name: str) -> str: name = task_name.lower() if "motiontracking" in name: return "g1_mt" - if "rough" in name and name.startswith("g1"): - return "g1_rough" for prefix in ("go2", "g1"): if name.startswith(prefix): return prefix diff --git a/scripts/tools/support_matrix.py b/scripts/tools/support_matrix.py index 80201d02d..0e9263d65 100644 --- a/scripts/tools/support_matrix.py +++ b/scripts/tools/support_matrix.py @@ -81,17 +81,15 @@ _TASK_ORDER = { "go2_joystick_flat": 0, "g1_walk_flat": 1, - "g1_walk_rough": 2, - "g1_motion_tracking": 3, - "g1_flip_tracking": 4, - "x2_wall_flip_tracking": 5, - "allegro_inhand": 6, - "allegro_sac": 7, + "g1_motion_tracking": 2, + "g1_flip_tracking": 3, + "x2_wall_flip_tracking": 4, + "allegro_inhand": 5, + "allegro_sac": 6, } _TASK_LABELS = { "go2_joystick_flat": "Go2 joystick", "g1_walk_flat": "G1 walk flat", - "g1_walk_rough": "G1 walk rough", "g1_motion_tracking": "G1 motion tracking", "g1_flip_tracking": "G1 flip tracking", "x2_wall_flip_tracking": "X2 wall flip tracking", diff --git a/src/unilab/assets/robots/g1/hfields/hfield.png b/src/unilab/assets/robots/g1/hfields/hfield.png deleted file mode 100644 index 62af27a2b..000000000 Binary files a/src/unilab/assets/robots/g1/hfields/hfield.png and /dev/null differ diff --git a/src/unilab/assets/robots/g1/scene_rough.xml b/src/unilab/assets/robots/g1/scene_rough.xml deleted file mode 100644 index 6020238c0..000000000 --- a/src/unilab/assets/robots/g1/scene_rough.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/unilab/conf/sac/task/g1_walk_rough/motrix.yaml b/src/unilab/conf/sac/task/g1_walk_rough/motrix.yaml deleted file mode 100644 index e73c5b962..000000000 --- a/src/unilab/conf/sac/task/g1_walk_rough/motrix.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# @package _global_ -# SAC Motrix rough owner: static-hfield rough scene, Motrix sim_dt=0.01, and -# the Motrix-direction reward retuning; kp/kd randomization stays disabled. -defaults: - - /task/g1_walk_flat/base - - _self_ - -training: - task_name: G1WalkRough - sim_backend: motrix -algo: - num_envs: 2048 - learning_starts: 1 - max_iterations: 5000 - save_interval: 1000 - updates_per_step: 8 - algo_params: - alpha_init: 0.001 - target_entropy_ratio: 0.0 -env: - sim_dt: 0.01 - scene: - model_file: src/unilab/assets/robots/g1/scene_rough.xml - events: - # Legacy Motrix owners disable kp/kd randomization. - pd_gains: null -reward: - tracking_lin_vel: - weight: 2.2 - tracking_ang_vel: - weight: 1.8 - penalty_ang_vel_xy: - weight: -1.2 - penalty_orientation: - weight: -12.0 - penalty_action_rate: - weight: -2.5 - pose: - weight: -0.6 - penalty_feet_ori: - weight: -5.0 - feet_phase: - weight: 6.0 - params: - tracking_sigma: 0.008 - alive: - weight: 12.0 diff --git a/src/unilab/conf/sac/task/g1_walk_rough/mujoco.yaml b/src/unilab/conf/sac/task/g1_walk_rough/mujoco.yaml deleted file mode 100644 index cce086903..000000000 --- a/src/unilab/conf/sac/task/g1_walk_rough/mujoco.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# @package _global_ -# SAC MuJoCo rough owner: inherits the 29-DoF off-policy Manager-Based contract -# and swaps the scene to the static-hfield rough XML (no height-scan -# observation and no terrain curriculum, matching the legacy rough task). -defaults: - - /task/g1_walk_flat/base - - _self_ - -training: - task_name: G1WalkRough - sim_backend: mujoco -algo: - num_envs: 2048 - learning_starts: 10 - max_iterations: 5000 - save_interval: 1000 - updates_per_step: 8 - algo_params: - alpha_init: 0.001 - target_entropy_ratio: 0.0 -env: - scene: - model_file: src/unilab/assets/robots/g1/scene_rough.xml diff --git a/src/unilab/tasks/locomotion/g1/__init__.py b/src/unilab/tasks/locomotion/g1/__init__.py index 362637e16..2c9231788 100644 --- a/src/unilab/tasks/locomotion/g1/__init__.py +++ b/src/unilab/tasks/locomotion/g1/__init__.py @@ -14,10 +14,6 @@ registry.register_env("G1WalkFlat", make_g1_walk_env, sim_backend="isaacsim") registry.register_env("G1WalkFlat", make_g1_walk_env, sim_backend="newton") -registry.register_env_config("G1WalkRough", ManagerBasedRlEnvCfg) -registry.register_env("G1WalkRough", make_g1_walk_env, sim_backend="mujoco") -registry.register_env("G1WalkRough", make_g1_walk_env, sim_backend="motrix") - __all__ = [ "G1WalkManagerBasedEnv", "make_g1_walk_env", diff --git a/src/unilab/tasks/migration_matrix.py b/src/unilab/tasks/migration_matrix.py index b2ec4f844..80c63edf2 100644 --- a/src/unilab/tasks/migration_matrix.py +++ b/src/unilab/tasks/migration_matrix.py @@ -38,7 +38,6 @@ class TaskMigrationRecord: _G1_LOCOMOTION_TASKS = frozenset( { "G1WalkFlat", - "G1WalkRough", } ) diff --git a/tests/benchmark/test_replay_buffer_placement_benchmark.py b/tests/benchmark/test_replay_buffer_placement_benchmark.py index 4a704a699..4b2ce02c7 100644 --- a/tests/benchmark/test_replay_buffer_placement_benchmark.py +++ b/tests/benchmark/test_replay_buffer_placement_benchmark.py @@ -65,7 +65,6 @@ def test_default_discovery_includes_existing_offpolicy_mujoco_tasks() -> None: assert skipped == [] assert ("sac", "g1_walk_flat") in targets - assert ("sac", "g1_walk_rough") in targets assert ("sac", "g1_motion_tracking") in targets assert ("flashsac", "g1_walk_flat") in targets assert ("flashsac", "go2_joystick_flat") in targets diff --git a/tests/config/test_locomotion_params.py b/tests/config/test_locomotion_params.py index ecb564858..08f79ce7f 100644 --- a/tests/config/test_locomotion_params.py +++ b/tests/config/test_locomotion_params.py @@ -212,22 +212,6 @@ def test_offpolicy_flashsac_go2_task_overrides(): assert cfg.env.actions.joint_pos.scale == pytest.approx(0.4) -def test_offpolicy_g1_rough_terrain_task_overrides(): - 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 / "sac"), version_base="1.3"): - cfg = compose( - "config", - overrides=["task=g1_walk_rough/mujoco"], - ) - assert cfg.algo.algo == "sac" - assert cfg.training.task_name == "G1WalkRough" - assert cfg.training.sim_backend == "mujoco" - assert cfg.env.scene.model_file.endswith("scene_rough.xml") - - def test_g1_task_owner_yamls_preserve_legacy_and_walk_observation_profiles(): from hydra import compose, initialize_config_dir from hydra.core.global_hydra import GlobalHydra @@ -248,7 +232,6 @@ def uses_walk_profile(config_group: str, overrides: list[str]) -> bool: assert uses_walk_profile("appo", ["task=g1_walk_flat/mujoco"]) is False assert uses_walk_profile("sac", ["task=g1_walk_flat/mujoco"]) is True assert uses_walk_profile("sac", ["task=g1_walk_flat/motrix"]) is True - assert uses_walk_profile("sac", ["task=g1_walk_rough/mujoco"]) is True assert uses_walk_profile("td3", ["task=g1_walk_flat/mujoco"]) is True assert uses_walk_profile("flashsac", ["task=g1_walk_flat/mujoco"]) is True diff --git a/tests/envs/locomotion/g1/test_g1_owner_contract.py b/tests/envs/locomotion/g1/test_g1_owner_contract.py index 23899196b..2f99a643a 100644 --- a/tests/envs/locomotion/g1/test_g1_owner_contract.py +++ b/tests/envs/locomotion/g1/test_g1_owner_contract.py @@ -275,32 +275,6 @@ True, id="sac-isaacsim", ), - pytest.param( - "sac", - ("task=g1_walk_rough/mujoco",), - "G1WalkRough", - "mujoco", - 29, - 1.0, - "scene_rough.xml", - _OFFPOLICY_REWARDS, - (*_RESET_EVENTS, "pd_gains"), - True, - id="sac-rough-mujoco", - ), - pytest.param( - "sac", - ("task=g1_walk_rough/motrix",), - "G1WalkRough", - "motrix", - 29, - 1.0, - "scene_rough.xml", - _OFFPOLICY_REWARDS, - _RESET_EVENTS, - True, - id="sac-rough-motrix", - ), pytest.param( "td3", ("task=g1_walk_flat/mujoco",), @@ -588,10 +562,6 @@ def test_g1_walk_registries_are_manager_only() -> None: "newton", ], } - assert metadata["G1WalkRough"] == { - "config_factory": "ManagerBasedRlEnvCfg", - "available_backends": ["mujoco", "motrix"], - } @pytest.mark.parametrize( @@ -799,12 +769,6 @@ def test_g1_penalty_curriculum_scales_negative_weights_from_start() -> None: "G1WalkFlat", id="sac-walk-flat", ), - pytest.param( - "sac", - ("task=g1_walk_rough/mujoco",), - "G1WalkRough", - id="sac-walk-rough", - ), pytest.param( "td3", ("task=g1_walk_flat/mujoco",), diff --git a/tests/envs/test_env_configs.py b/tests/envs/test_env_configs.py index ce2fed8f9..2c8a2adf3 100644 --- a/tests/envs/test_env_configs.py +++ b/tests/envs/test_env_configs.py @@ -59,15 +59,6 @@ def _g1_manager_override( from unilab.base.config_adapter import BackendAdapter repo_root = Path(__file__).parents[2] - if task == "g1_walk_rough": - # There is no ppo g1_walk_rough owner; use the SAC owner instead. - with initialize_config_dir( - config_dir=str(repo_root / "src" / "unilab" / "conf" / "sac"), version_base="1.3" - ): - cfg = compose("config", overrides=[f"task={task}/mujoco"]) - return BackendAdapter( - cfg, root_dir=repo_root, algo_name="sac" - ).build_task_env_cfg_override() with initialize_config_dir( config_dir=str(repo_root / "src" / "unilab" / "conf" / config_group), version_base="1.3" ): @@ -538,7 +529,6 @@ def test_allegro_grasp_recorder_close_autosaves_and_io_failure_is_fail_closed( # Environments that don't need special config overrides _STANDARD_ENVS = [ "G1WalkFlat", - "G1WalkRough", "AllegroInhandRotation", "AllegroInhandRotationGrasp", ] @@ -561,8 +551,6 @@ def test_env_reset_and_step(env_name: str): env_cfg_override = None if env_name == "G1WalkFlat": env_cfg_override = _g1_manager_override("g1_walk_flat") - elif env_name == "G1WalkRough": - env_cfg_override = _g1_manager_override("g1_walk_rough") elif env_name == "AllegroInhandRotation": env_cfg_override = _allegro_manager_override() elif env_name == "AllegroInhandRotationGrasp": diff --git a/tests/scripts/test_train_script_configs.py b/tests/scripts/test_train_script_configs.py index 76bc53903..3b95695c8 100644 --- a/tests/scripts/test_train_script_configs.py +++ b/tests/scripts/test_train_script_configs.py @@ -105,7 +105,6 @@ def test_appo_task_configs_load(task, tmp_path): ("algo", "task"), [ ("sac", "g1_walk_flat/mujoco"), - ("sac", "g1_walk_rough/mujoco"), ("td3", "g1_walk_flat/mujoco"), ], ) diff --git a/tests/scripts/test_train_scripts.py b/tests/scripts/test_train_scripts.py index 5d6300c90..6b6770d13 100644 --- a/tests/scripts/test_train_scripts.py +++ b/tests/scripts/test_train_scripts.py @@ -2210,13 +2210,6 @@ def test_offpolicy_flashsac_g1_walk_flat_task_composes() -> None: assert cfg.training.sim_backend == "mujoco" -def test_offpolicy_g1_rough_terrain_task_composes() -> None: - cfg = _offpolicy_cfg(["task=g1_walk_rough/mujoco"]) - - assert cfg.training.task_name == "G1WalkRough" - assert cfg.training.sim_backend == "mujoco" - - def test_offpolicy_rejects_algo_argument_mismatch(): """build_runner must reject an algo argument inconsistent with cfg.algo.algo.""" cfg = _offpolicy_cfg(["task=g1_walk_flat/mujoco"])