Skip to content

Feat: 迁移 NumPy JointPositionAction 与 entity target 映射 #1054

Description

@TATP-233

普通说明

只做一件事:从 pinned mjlab action source 迁移最小可生产的 NumPy JointPositionActionCfg / JointPositionAction,并把 joint selector 到 backend control column 的映射收口到 base-owned entity facade。

不迁移 Go2 或其他 task,不迁移 velocity/effort/tendon/site/IK action,不改 lifecycle、runner、IPC、Hydra owner YAML 或 backend step。预计 8–14 个文件、≤1,000 行净手写/机械改动、1 个 PR。永久维护成本是一种社区 joint-position action、entity 的冷路径 joint↔actuator 映射和 focused tests。

最小交付结果

  • 保留 upstream BaseActionCfg / BaseActionJointPositionActionCfg / JointPositionAction 的公开命名、build、scale、offset、clip、preserve_order、raw/processed buffer 和 reset 语义。
  • Torch 全部机械替换为 NumPy;action buffer 在构造期分配,step 只做批量 affine/clip 和 control-buffer 写入。
  • entity facade 通过 Backend: 补齐 Manager-Based action 的 actuation metadata contract #1052 的正式 metadata 在冷路径构建 joint→actuator 映射,提供 find_joints_by_actuator_names、默认 joint 位姿、encoder bias buffer 和 set_joint_position_target
  • selector 仍按社区 joint target 名/regex 语义工作;control 写入按 backend actuator/control 顺序,不依赖 qpos 尾部或 task 私有顺序。
  • 缺失 actuator target、被动 joint、重复 target、shape/finite/selector 错误均在构造或调用最近边界 raise。

In scope

  • src/unilab/envs/mdp/actions 最小 source-aligned port 与 exports。
  • base entity facade 的最小 joint-position target 写入能力。
  • upstream-derived NumPy tests,以及 MuJoCo/Motrix Go2 非对称 action 映射 fixture。

Non-goals

  • 不提供未实现 action 类型的占位类、no-op 或 fallback。
  • 不把 action 规则放进 manager core、scripts 或 backend。
  • 不迁移 production task、event/DR、command、observation 或 reward term。
  • 不新增 backend public method。

Owner 与预算

Action/entity adapter child;≤15 个非删除文件、≤1,000 行 source-derived/机械/UniLab glue、1 PR;base 为 dev/issue-1042-manager-based-api

Acceptance criteria

  • public import、cfg/build、scale/offset/clip、history/reset 和 target 写入有 focused tests。
  • regex/metadata 仅冷路径解析;step 热路径无 XML/asset/name 解析,无逐环境 Python loop。
  • MuJoCo/Motrix 相同 joint-name action 写入相同语义目标,顺序不靠猜测。
  • package 无 Torch、IPC、runner、learner 或 backend-private import。
  • make test-all 通过。

Stop conditions

若 joint-position target 需要新的 backend method、backend 私有对象、热路径名称解析,或无法在 entity 层证明 joint/control 一一映射,则停止并拆新的 owner child。

Umbrella: #1042
Depends on: #1052

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions