feat: manager-based humanoid velocity-tracking environment - #52
Merged
Merged
Conversation
wlgys8
force-pushed
the
42-humanoid-walk-manager-env
branch
from
September 16, 2026 03:17
499347d to
3e1ae37
Compare
There was a problem hiding this comment.
🟡 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 registerManagerEnvwith the newHumanoidVelocityTrackingManagerEnvCfg. - 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 +
SimDataQueryterm 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.
…s error text, scipy rationale
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HeightFieldGrid补充完整字段文档与采样高度计算公式(与heightfield_lookup双线性插值实现一一对应)colliding_termination用bool(colliding.any())替代手写短路循环(Numba 编译验证通过,行为等价)Closes #42
Test plan
python -m pytest motrix_env_core/tests -k term:12 passed@njit下bool(arr.any())编译与行为验证通过