Skip to content

feat(isaacsim):通过 EnvCfg 后端接线暴露 UniSim 的 PhysX solver 旋钮 - #1620

Merged
TATP-233 merged 2 commits into
mainfrom
feat/isaacsim-solver-kwargs
Sep 22, 2026
Merged

TATP-233 merged 2 commits into
mainfrom
feat/isaacsim-solver-kwargs

Conversation

@lemon-star608

Copy link
Copy Markdown
Collaborator

Closes #1617

背景

UniSim 1.7.x 为 IsaacSim 后端交付了有界、带读回验证的 PhysX solver 配置(unilabsim/unisim#251、#259),但在 UniLab 标准路径(registry.make → make_manager_based_rl_env → create_backend)上这些旋钮没有任何通道能到达后端:任务 owner 无法经 Hydra YAML 声明求解器表,后端只能静默使用 PhysX 默认值。

改动

  • src/unilab/base/base.py:EnvCfg 新增六个 solver 字段,沿用现有按后端命名的旋钮惯例(Optional,None 保持 PhysX 场景默认值):

    • isaacsim_solver_position_iteration_count(int ≥ 1)
    • isaacsim_solver_velocity_iteration_count(int ≥ 0,PhysX 允许 0 velocity iterations)
    • isaacsim_bounce_threshold_velocity / isaacsim_contact_offset / isaacsim_rest_offset / isaacsim_max_depenetration_velocity(非负 float)

    EnvCfg.validate 镜像 unisim PhysxSolverConfig 的边界(position ≥ 1、velocity ≥ 0、浮点项非负),owner 配置快速失败。

  • src/unilab/base/backend_factory.py:env_backend_kwargs 将六个字段按同名机械转发到 UniSim factory(unisim 侧 create_backend 本就接受这些 isaacsim_ 前缀 kwargs,pop 后装配 PhysxSolverConfig 并做引擎读回比对)。

  • tests/base/test_isaacsim_backend.py:新增转发层测试(字段→kwargs 逐值映射断言 + 默认值保持 None)与 EnvCfg 校验拒绝用例(0/负数/bool/错误类型共 8 组 parametrize)。

  • docs/sphinx/source/changelog.md:Unreleased / Added 中英条目。

与 unisim 侧的对接

字段全集逐一读自 unisim factory 的 kwargs pop 处(unisim/factory.py:isaacsim_solver_position_iteration_count、isaacsim_solver_velocity_iteration_count、isaacsim_bounce_threshold_velocity、isaacsim_contact_offset、isaacsim_rest_offset、isaacsim_max_depenetration_velocity)与 PhysxSolverConfig 字段(unisim/backend/isaacsim/physx_solver.py),一一对应、无遗漏、无杜撰。unisim 侧负责有界校验 + 引擎读回比对,本 PR 只做配置通道。

测试证据

  • make check:format + mypy(128 files)+ pyright + ruff 全绿。
  • make test:1508 passed + 28 skipped(含本 PR 新增 10 个测试点)。
  • 依赖事实:main 已要求 unisim-core>=1.7.4,solver kwargs 必然可用,无 legacy 兼容分支。

说明

issue 中登记的独立项(reset_state.py 在 mapped 场景拒绝 DR 写,使 unisim#248 的 reset-time 模型 DR 从事件项不可达)不在本 PR 范围,建议单独跟踪。

Closes #1617.

UniSim 1.7.x accepts a bounded, readback-validated PhysX solver override
set on the IsaacSim backend (unilabsim/unisim#251, #259), but the standard
UniLab path (registry.make -> make_manager_based_rl_env -> create_backend)
had no channel for those knobs: task owners could not declare the solver
table and the backend silently ran PhysX defaults.

- EnvCfg gains the six solver fields, following the per-backend knob
  convention (Optional, None keeps the PhysX scene defaults):
  isaacsim_solver_position_iteration_count (int >= 1),
  isaacsim_solver_velocity_iteration_count (int >= 0),
  isaacsim_bounce_threshold_velocity / isaacsim_contact_offset /
  isaacsim_rest_offset / isaacsim_max_depenetration_velocity
  (non-negative floats).  EnvCfg.validate mirrors the PhysxSolverConfig
  bounds so owner configs fail fast.
- env_backend_kwargs forwards all six to the UniSim factory under the
  same names.
- Tests: field->kwargs mapping assertions (values forwarded verbatim,
  defaults stay None) and validation rejection coverage.
- Changelog entry (shared page, Added).
…dshake

test_isaacsim_worker_timeout_has_backend_diagnostic set
worker_timeout_s=0.2 to probe the hanging STEP diagnostic, but the same
budget also constrains the INIT handshake, which includes the mock
worker's cold Python spawn; on loaded CI runners (ubuntu-slim) INIT
exceeded 0.2 s and the test flaked before reaching the step under test
(PR #1620 CI, job 106416975382).  Materialize with the default timeout
and shrink the budget only for the STEP probe.
@TATP-233
TATP-233 merged commit e4029ab into main Sep 22, 2026
8 checks passed
@TATP-233
TATP-233 deleted the feat/isaacsim-solver-kwargs branch September 22, 2026 05:05
lemon-star608 added a commit to lemon-star608/Uni-simtoolreal that referenced this pull request Sep 23, 2026
unisim-core 1.7.5 (carries our merged adapter fixes through #294) and
mjbatch-uni 0.2.4 (streaming VariantPackBuilder, PR #38) shipped today;
only unilab stays on the upstream git pin until a release contains
Motphys/UniLab#1620/#1636. The mujoco variant-executor floor is now
explicit (mjbatch-uni>=0.2.4).
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.

feat(isaacsim):通过 EnvCfg 后端接线暴露 UniSim 的 PhysX solver 旋钮

2 participants