Repository navigation
refactor(robots): extract reusable model configurations and assets - #101
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Although no concrete defects were found, the change is very large (200+ relocated assets, a new core discovery subsystem, and a behavioral ANYmal scene-composition change) and warrants final human review.
0 open findings
What changed in this PR
This PR is step 2 of a robot/deployment refactor (following merged PR #100). It extracts the seven built-in simulation robot configurations and their MJCF/URDF, mesh, and texture assets out of motrix_envs into a new core-only motrix-robots workspace package, and switches robot registration from import-time side effects to lazy entry-point discovery in motrix_env_core.registry (group motrix_env_core.robots). Public registry IDs, key poses, actuator parameters, and motrix_envs.robot import paths are preserved (the latter as thin forwarding facades), so the change is primarily ownership/packaging rather than behavior.
Changes:
- Add
motrix-robotspackage (config classes,builtins/*robot definitions, relocated LFS assets, entry-pointregistration.register) and wire it into workspace/lock metadata. - Add lazy robot discovery to the core registry and migrate internal consumers (scripts, tests, ANYmal task scene composition) to import robot classes from
motrix_robots.builtins.*. - Update bilingual READMEs/docs and package counts (twelve → thirteen).
| File | Description |
|---|---|
motrix_robots/pyproject.toml |
New package metadata, core-only dep, motrix_env_core.robots entry point. |
motrix_robots/src/.../registration.py |
Entry-point callback registering the seven preserved robot IDs. |
motrix_robots/src/.../builtins/{quadruped,humanoid}.py |
Relocated model-config base classes with validation. |
motrix_robots/src/.../builtins/assets/**, common/*.png |
Relocated LFS MJCF/URDF/mesh/texture assets (incl. texture-path fixes). |
motrix_robots/tests/test_assets.py |
Asserts bundled XML/URDF mesh/texture references form a package-local closure. |
pyproject.toml, uv.lock |
Register motrix_robots as workspace member/source. |
scripts/motion/replay.py, scripts/private/* |
Import robot classes from motrix_robots.builtins.*. |
tests/test_view_script.py |
Import UnitreeGo2Robot from the new package. |
README.md, README.zh-CN.md |
Document the new package and update the package count. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3518cf7 to
c6aa573
Compare
Summary
PR 2 of the robot/deployment refactor, independently based on
mainafter PR #100.motrix-robotsworkspace package.anymal_c,dex-evt,g1-29dof,go1,go2,k1,microduck).motrix_env_core.registrythrough themotrix_env_core.robotsentry-point group.motrix-robotsdeclaresbuiltin = "motrix_robots.registration:register"; applications need no explicit registration imports. Direct builtin model imports still do not discover plugins, import training/simulators or read assets.motrix_robotspublic API (from motrix_robots import Microduck, UnitreeGo2Robot). Model modules and model assets are flat at package root; internal consumers import definition modules directly. Remove the oldmotrix_envs.robotforwarding modules, without compatibility aliases.motphys-ground.pnginmotrix_envs, not in the robot package. Motion conversion uses the G1 model-only XML rather than a ground-scene wrapper.Scope
This is ownership and packaging work only. It does not include deployment runtime/task/artifact changes, Unitree hardware configuration extraction, new sensor declarations,
SimCfgchanges, robot-ID renaming or robot tuning. PR #100 actuator code is unchanged. The source big branch is preserved.Most changed files are asset renames. The model package depends only on
motrix-env-core;motrix-envsdepends onmotrix-robots.Review and preservation
An independent read-only subagent reviewed the settled implementation and approved it with no material findings.
lie_downpose additions from the source big branch.Validation
--checkpassed.go2from core alone and lists all seven IDs without importing training or simulators.