Skip to content

Feat/a2arm pos force - #1050

Open
lemon-star608 wants to merge 13 commits into
mainfrom
feat/a2arm-pos-force
Open

Feat/a2arm pos force#1050
lemon-star608 wants to merge 13 commits into
mainfrom
feat/a2arm-pos-force

Conversation

@lemon-star608

Copy link
Copy Markdown
Collaborator

功能概述

  • 新增 A2Arm 位置-力控制 locomotion 环境。
  • 集成 A2 四足底盘、P7v3 机械臂和 UMI 夹爪的 MuJoCo 仿真模型。
  • 新增 CSE-PPO 算法、Runner、Estimator、Storage 和训练入口。
  • 新增 CSE-PPO 与 A2Arm 位置-力任务的 Hydra 配置。
  • 新增 A2Arm 位置-力控制的交互式 MuJoCo 播放脚本。
  • 扩展 backend 接口,支持底座线速度状态写入。
  • 新增模型结构、FK 初始姿态、观测布局、力矩限制、环境步进和 backend 状态写入等 contract 测试。

主要改动

A2Arm 位置-力控制环境

  • 新增 A2ArmPosForce 环境及对应配置。
  • 新增 A2Arm、P7v3 和 UMI 夹爪的 MJCF 模型与网格资源。
  • 支持位置-力指令生成、力跟踪、末端轨迹控制和域随机化。
  • 通过现有 locomotion registry 注册环境。

CSE-PPO 训练流程

  • 新增 CSE-PPO actor-critic、estimator、storage、algorithm 和 runner。
  • 新增 scripts/train_cse_ppo.py 训练入口。
  • 新增 conf/ppo_cse/ 下的算法和任务配置。
  • 在 RSL-RL 训练封装中传递环境步进时间参数。

MuJoCo 交互控制

  • 新增 scripts/play_a2arm_pos_force_interactive.py
  • 支持 A2Arm 任务的交互式指令、轨迹、力控制和可视化。
  • 新增 MuJoCo backend 底座线速度写入能力。

验证

  • make test-all
  • A2Arm fast contract tests:6 个通过
  • A2Arm slow runtime tests:3 个通过

@TATP-233

Copy link
Copy Markdown
Collaborator

#1222 (comment)

lemon-star608 and others added 13 commits August 21, 2026 09:24
Port the A2 quadruped + P7v3 5-DOF arm (joint3/5 frozen) + UMI gripper MJCF
from the fork, consolidated into a self-contained robots/a2arm/ (meshdir points
at its own meshes/, zero cross-dir dependency). Keyframe lives at scene level
per the asset contract. 42 referenced meshes (dog legs + p7_v3 + umi_gripper_v3).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Concurrent state-estimator PPO (actor_critic/algorithm/estimator/runner/
storage) plus scripts/train_cse_ppo.py. Task-independent; runner imported
directly (no central algo registry). Estimator targets: base_lin_vel(3) +
ee_pos_sphere(3) + force_ee(3) + force_base(3), weights [0.2,0.2,1.0,1.0].

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New envs/locomotion/a2arm/ (base.py + pos_force.py), zero go2_arm dependency,
imports via unilab.utils.rotation/geometry. The fork's 4-layer Go2Arm->A2->V2->J3
config chain is flattened to one A2ArmPosForceCfg with MRO-resolved defaults;
training semantics preserved byte-for-byte. Registered as A2ArmPosForce (mujoco).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
conf/ppo_cse/config.yaml + task/a2arm_pos_force/mujoco.yaml. Task YAML is
byte-identical to the fork's committed stable baseline (only task_name renamed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
RslRlVecEnvWrapper.step forwarded state.info['log'] but not state.info['timing'],
so rsl_rl-family runners (incl. CSE-PPO) saw no per-phase step timings and
collapsed the whole collect into the 'wrapper_glue' catch-all. Forward 'timing'
too (additive, backward-compatible) so the iteration waterfall attributes
physics/update_state/slow_path/reset again.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
_maybe_apply_velocity_push wrote through get_base_lin_vel()'s return value,
relying on the getter returning a mutable qvel view -- a MuJoCo implementation
detail the SimBackend contract never promised. A backend returning a copy
(including MuJoCo's own fixed-base path, which returns np.zeros) would drop the
push silently, disabling that domain randomization with no error.

- base.py: add fail-closed SimBackend.set_base_lin_vel (raises
  NotImplementedError by default, matching apply_body_linear_velocity_delta).
- mujoco/backend.py: implement it for the free-floating base (writes the qvel
  view); raise for a non-free base instead of dropping the write.
- pos_force.py: route the push through the setter (copy -> patch x/y -> set).
- test: assert the setter's write reaches get_base_lin_vel, and that a shape
  mismatch raises. Also fix a stale assertion pinning the pre-retune arm_kd.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Strip UniFP references, migration framings (faithful port / byte-identical /
inheritance chain), and dated tuning history (2026-07-* / was X -> Y / zeta
retune logs) from comments across the a2arm pos-force task, cse_ppo algorithm,
and config files. Preserve the technical rationale (why a value exists, what
mechanism it controls) while removing the provenance noise.

- pos_force.py: neutralize 60+ UniFP/migration comments to describe behavior
  without referencing the origin; delete DEPLOYMENT CONTRACT tuning block.
- estimator.py: keep Ji et al. 2022 citation (academic origin), remove UniFP.
- YAMLs: strip tuning dates/run IDs, keep parameter semantics.
- test: remove DEPLOYMENT CONTRACT label from arm_kd assertion.

No code changes; comment-only cleanup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TATP-233

Copy link
Copy Markdown
Collaborator

修改merge base 为 dev/issue-1042-manager-based-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants