Skip to content

feat: manager-based humanoid velocity-tracking environment - #52

Merged
wlgys8 merged 2 commits into
mainfrom
42-humanoid-walk-manager-env
Sep 16, 2026
Merged

wlgys8 merged 2 commits into
mainfrom
42-humanoid-walk-manager-env

Conversation

@wlgys8

@wlgys8 wlgys8 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 新增 Manager 工作流的 humanoid velocity-tracking 环境(walk_manager_mdp:command / observations / reset / rewards / terrain builder)
  • HeightFieldGrid 补充完整字段文档与采样高度计算公式(与 heightfield_lookup 双线性插值实现一一对应)
  • colliding_terminationbool(colliding.any()) 替代手写短路循环(Numba 编译验证通过,行为等价)

Closes #42

Test plan

  • python -m pytest motrix_env_core/tests -k term:12 passed
  • Numba @njitbool(arr.any()) 编译与行为验证通过

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There is at least one confirmed joint-name resolution/alignment bug in the new humanoid manager reward term, and the newly added SciPy dependency appears unused and should be justified or removed.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR migrates the humanoid velocity-tracking “walk” task from a direct NumPy environment to a Manager-based workflow, enabling in-kernel terrain height lookup and consolidating task logic into manager terms/config while extending the manager compiler to support richer term arguments and query collection.

Changes:

  • Added a new manager-based humanoid velocity-tracking task family (walk_manager_mdp) and updated humanoid presets (g1/k1/microduck/dex_evt) to register ManagerEnv with the new HumanoidVelocityTrackingManagerEnvCfg.
  • Introduced in-kernel heightfield support via HeightFieldDataQuery + HeightFieldGrid/heightfield_lookup, and wired MotrixSim runtime compilation for heightfield grid export.
  • Refactored manager term plumbing to canonicalize/compile ndarray + SimDataQuery term args, and adjusted tests plus WBT/ball_balance terms to the new build-context calling convention.
File summaries
File Description
uv.lock Locks added SciPy + updated motrixsim wheel set.
motrix_envs/tests/test_wbt_numba.py Updates WBT Numba tests for renamed obs/command fields.
motrix_envs/tests/test_mdp_obs.py Refactors observation-term tests to use BuildContext and new obs terms.
motrix_envs/tests/test_humanoid_walk.py Updates humanoid walk preset contract tests for ManagerEnv configs.
motrix_envs/src/motrix_envs/locomotion/wbt/mdp/terminations.py Adapts termination cfgs to build-context calling surface.
motrix_envs/src/motrix_envs/locomotion/wbt/mdp/rewards.py Vectorizes reward math and switches cfgs to build-context calls.
motrix_envs/src/motrix_envs/locomotion/wbt/mdp/reset.py Updates reset cfgs to use build context and vector math helpers.
motrix_envs/src/motrix_envs/locomotion/wbt/mdp/observations.py Removes WBT-local ActionsObs (now core) + build-context changes.
motrix_envs/src/motrix_envs/locomotion/wbt/mdp/command.py Aligns command buffer with CommandTerm.command contract.
motrix_envs/src/motrix_envs/locomotion/wbt/mdp/action.py Adjusts expected joint shapes away from sim_data-derived shapes.
motrix_envs/src/motrix_envs/locomotion/wbt/k1.py Imports shared ActionRate reward from core MDP rewards.
motrix_envs/src/motrix_envs/locomotion/wbt/g1.py Imports shared ActionRate reward from core MDP rewards.
motrix_envs/src/motrix_envs/locomotion/wbt/dex_evt.py Imports shared ActionRate reward from core MDP rewards.
motrix_envs/src/motrix_envs/locomotion/wbt/cfg.py Switches to new body-based obs terms + shared ActionRate reward cfg.
motrix_envs/src/motrix_envs/locomotion/humanoid/walk_np.py Removes legacy direct NumPy humanoid walk environment.
motrix_envs/src/motrix_envs/locomotion/humanoid/walk_manager_mdp/terrain.py Adds builder for per-task in-kernel terrain grid.
motrix_envs/src/motrix_envs/locomotion/humanoid/walk_manager_mdp/rewards.py Adds manager reward terms for humanoid walk (incl. terrain lookups).
motrix_envs/src/motrix_envs/locomotion/humanoid/walk_manager_mdp/reset.py Adds manager reset term for spawn sampling + terrain-aware base pose.
motrix_envs/src/motrix_envs/locomotion/humanoid/walk_manager_mdp/observations.py Adds gait-phase observation term.
motrix_envs/src/motrix_envs/locomotion/humanoid/walk_manager_mdp/command.py Adds velocity command + gait clock + curriculum command term.
motrix_envs/src/motrix_envs/locomotion/humanoid/walk_manager_mdp/init.py Declares package for manager walk terms.
motrix_envs/src/motrix_envs/locomotion/humanoid/microduck.py Converts microduck walk presets to manager-based cfg + terms.
motrix_envs/src/motrix_envs/locomotion/humanoid/k1.py Converts k1 walk presets to manager-based cfg + terms.
motrix_envs/src/motrix_envs/locomotion/humanoid/g1.py Converts g1 walk presets to manager-based cfg + terms.
motrix_envs/src/motrix_envs/locomotion/humanoid/dex_evt.py Converts dex-evt walk presets to manager-based cfg + terms.
motrix_envs/src/motrix_envs/locomotion/humanoid/cfg.py Replaces direct-env cfg schema with manager-based walk schema + query assembly.
motrix_envs/src/motrix_envs/locomotion/humanoid/init.py Stops importing removed walk_np registration module.
motrix_envs/src/motrix_envs/locomotion/ball_balance/microduck.py Updates ball-balance manager cfg to new body-based obs + ActionRate reward.
motrix_envs/src/motrix_envs/locomotion/ball_balance/mdp/terminations.py Moves termination cfgs to build-context calling convention.
motrix_envs/src/motrix_envs/locomotion/ball_balance/mdp/rewards.py Moves reward cfgs to build-context calling convention + joint ordering checks.
motrix_envs/src/motrix_envs/locomotion/ball_balance/mdp/reset.py Moves reset cfgs to build-context calling convention.
motrix_envs/src/motrix_envs/locomotion/ball_balance/mdp/observations.py Moves observation cfgs to build-context calling convention.
motrix_env_motrixsim/src/motrix_env_motrixsim/runtime.py Implements compile_height_field_data model query compilation.
motrix_env_core/tests/test_required_queries.py Removes tests for the deprecated required_sim_queries merge path.
motrix_env_core/tests/test_numba_manager.py Updates tests for new metric/command-term behavior.
motrix_env_core/tests/test_model_query_dispatch.py Adds HeightFieldDataQuery dispatch coverage.
motrix_env_core/src/motrix_env_core/sim/model.py Adds HeightFieldDataQuery and compiler interface hook.
motrix_env_core/src/motrix_env_core/sim/init.py Re-exports HeightFieldDataQuery.
motrix_env_core/src/motrix_env_core/numba/math/quaternion.py Adds rotate_inverse_components helper for allocation-free kernels.
motrix_env_core/src/motrix_env_core/numba/manager/terms.py Introduces shared term arg canonicalization + BaseTerm.
motrix_env_core/src/motrix_env_core/numba/manager/terminations.py Uses BuildContext + shared term arg canonicalization.
motrix_env_core/src/motrix_env_core/numba/manager/sim_reset.py Converts ResetTerm to BaseTerm + shared arg canonicalization.
motrix_env_core/src/motrix_env_core/numba/manager/rewards.py Converts RewardTerm to BaseTerm + BuildContext + shared arg canonicalization.
motrix_env_core/src/motrix_env_core/numba/manager/rand.py Adds uniform_range primitive + lowered method overload.
motrix_env_core/src/motrix_env_core/numba/manager/observations.py Switches observation term building to BuildContext + shared arg canonicalization.
motrix_env_core/src/motrix_env_core/numba/manager/env.py Collects SimDataQuery args from terms and compiles merged read program.
motrix_env_core/src/motrix_env_core/numba/manager/context.py Adds BuildContext surface for term construction.
motrix_env_core/src/motrix_env_core/numba/manager/compiler/program.py Handles ForceLiteralArg for numba.literally string args during warmup.
motrix_env_core/src/motrix_env_core/numba/manager/compiler/compiler.py Lowers ndarray + string + SimDataQuery term args; tracks sim slots by key.
motrix_env_core/src/motrix_env_core/numba/manager/commands.py Makes CommandTerm kernel_data and standardizes command field contract.
motrix_env_core/src/motrix_env_core/numba/kernel_data/canonical.py Formatting-only import restructuring.
motrix_env_core/src/motrix_env_core/mdp/terrain.py Adds HeightFieldGrid + bilinear lookup used by manager tasks.
motrix_env_core/src/motrix_env_core/mdp/terminations.py Adds reusable CollidingTermination term/cfg.
motrix_env_core/src/motrix_env_core/mdp/rewards.py Adds reusable Alive/ActionRate/Tracking reward term cfgs.
motrix_env_core/src/motrix_env_core/mdp/observations.py Adds reusable body-based observations + command/actions obs terms.
motrix_env_core/src/motrix_env_core/manager/init.py Re-exports BaseTerm from new shared terms module.
motrix_env_core/src/motrix_env_core/config/sim_reset.py Updates reset cfg signature to accept build context.
motrix_env_core/pyproject.toml Adds SciPy as a pinned runtime dependency.
Review details
  • Files reviewed: 57/58 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread motrix_env_core/pyproject.toml
Comment thread motrix_env_core/src/motrix_env_core/numba/manager/terms.py
@wlgys8 wlgys8 self-assigned this Sep 16, 2026
@wlgys8
wlgys8 merged commit d093f94 into main Sep 16, 2026
5 checks passed
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: read program 支持派生采样 query(TerrainHeightUnderQuery,地形高度 under frame 点)

2 participants