Add experimental NeuralPlanner for learned waypoint pass through#321
Add experimental NeuralPlanner for learned waypoint pass through#321yangchen73 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an experimental learning-based NeuralPlanner that rolls out an APG transformer policy to follow EEF waypoints via the existing MotionGenerator planning interface, along with supporting assets download utilities, documentation, an example, and unit tests.
Changes:
- Added
NeuralPlanner/NeuralPlannerCfg/NeuralPlanOptionsand registered the new planner type inMotionGenerator. - Added HuggingFace checkpoint download helper for neural planner checkpoints.
- Added Franka waypoint example, tests, and documentation pages for NeuralPlanner.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
embodichain/lab/sim/planners/neural_planner.py |
New NeuralPlanner implementation + APG transformer inference actor and checkpoint loading. |
embodichain/lab/sim/planners/motion_generator.py |
Registers "neural" planner type; updates plan option defaulting logic inside generate(). |
embodichain/lab/sim/planners/__init__.py |
Exposes NeuralPlanner symbols via package imports. |
embodichain/data/assets/planner_assets.py |
Adds download_neural_planner_checkpoint() helper for gated HF checkpoint download. |
embodichain/data/assets/__init__.py |
Re-exports planner assets module. |
examples/sim/planners/neural_planner.py |
New Franka Panda waypoint rollout example using NeuralPlanner. |
tests/sim/planners/test_neural_planner.py |
Adds unit tests for planner registration and basic generation behavior with a fake checkpoint. |
docs/source/overview/sim/planners/neural_planner.md |
New NeuralPlanner documentation page (experimental warning + usage snippet). |
docs/source/overview/sim/planners/motion_generator.md |
Updates MotionGenerator docs to mention NeuralPlanner support. |
docs/source/overview/sim/planners/index.rst |
Adds NeuralPlanner to planners overview and toctree. |
agent_context/topics/motion-planning/motion-planning.md |
Updates internal motion-planning context to include NeuralPlanner and assets entry points. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if start_qpos is None: | ||
| qpos = self.robot.get_qpos(name=control_part)[0] | ||
| else: | ||
| qpos = torch.as_tensor(start_qpos, dtype=torch.float32, device=self.device) | ||
| if qpos.dim() == 1: | ||
| qpos = qpos.unsqueeze(0) | ||
| return qpos.to(self.device).clone() |
There was a problem hiding this comment.
checked in the test
| if options.plan_opts is None: | ||
| if hasattr(self.planner, "default_plan_options"): | ||
| options.plan_opts = self.planner.default_plan_options() | ||
| else: | ||
| options.plan_opts = PlanOptions() | ||
| result = self.planner.plan( | ||
| target_states=target_plan_states, options=options.plan_opts | ||
| ) |
There was a problem hiding this comment.
Planner options go through plan_opts (same as ToppraPlanOptions)
| @@ -0,0 +1,63 @@ | |||
| # NeuralPlanner | |||
There was a problem hiding this comment.
Mention that the policy of Neural Planner is specified for a robot.
Code Review: Neural Planner
Verdict: Merge with fixesNo Critical issues — the code is functional, tests pass, and the planner-registry integration is structurally sound. Several Important issues remain, most clustered around the MotionGenerator integration boundary, which is the primary architectural question for this PR. Strengths
IssuesImportant (should fix before merge)1.
Why it matters: This is the central integration finding. It shows the neural planner does not cleanly fit the "interpolate-then-plan" pipeline Fix: Add a guard in 2. The old line Why it matters: Two fields with the same name on two option objects, where only one is read depending on the planner, is a leaky abstraction. The removal of propagation is a behavior change with no deprecation path and no validation that Fix: Either propagate 3.
Fix: Try 4. Public API docstrings missing — convention violation
Fix: Add docstrings to 5. Leaky TOPPRA returns positions, velocities, accelerations, and a real Why it matters: Consumers that treat Fix: Either (a) document on 6. Tests verify plumbing, not planning behavior
Fix: Make Minor (nice to have)
Recommendations
AssessmentReady to merge: With fixes. The neural planner implementation itself is solid — checkpoint loading is defensive, quaternion/limit handling is correct, and tests pass. The integration into Automated code review. Findings reviewed against commit |
| @@ -0,0 +1,91 @@ | |||
| # ---------------------------------------------------------------------------- | |||
There was a problem hiding this comment.
Rename to nmg_weights would be better. and place to a weights folder
| from .eef_assets import * | ||
| from .robot_assets import * | ||
| from .scene_assets import * | ||
| from .solver_assets import * |
| options=MotionGenOptions( | ||
| plan_opts=NeuralPlanOptions( | ||
| control_part=arm_name, | ||
| start_qpos=start_qpos, |
There was a problem hiding this comment.
How we handle start qpos now?
Description
This PR adds an experimental
NeuralPlannerthat uses an APG transformer checkpoint to follow EEF waypoints viaMotionGenerator.NeuralPlanner,NeuralPlannerCfg, andNeuralPlanOptionsType of change
Screenshots
neural_planner.mp4
Checklist
black .command to format the code base.