Add planner selection to atomic-action tutorials - #616
Merged
Conversation
Expose TOPPRA, trapezoidal, and cuRobo selection across the runnable atomic-action tutorials while keeping NeuralPlanner out of the shared selector. Integrate trapezoidal native timing with composite action phases and update the corresponding tutorials, planner docs, tests, and project context.
|
Comment on lines
+140
to
+143
| resampled = resample_with_distance( | ||
| trajectory, | ||
| sample_count, | ||
| device=trajectory.device, |
There was a problem hiding this comment.
When TrapezoidalPlanner returns its native samples and timing, this helper resamples only the positions to the composite phase's requested count and discards the planner's dt. Callers such as Press then execute the resulting positions at a fixed simulation control interval. If the Cartesian path produced more samples than requested, compressing it into a shorter, uniformly timed motion can make the executed joint velocities and accelerations exceed the limits used by the planner.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/lab/sim/atomic_actions/primitives/_helpers.py
Line: 140-143
Comment:
**Timing Guarantees Are Lost**
When `TrapezoidalPlanner` returns its native samples and timing, this helper resamples only the positions to the composite phase's requested count and discards the planner's `dt`. Callers such as `Press` then execute the resulting positions at a fixed simulation control interval. If the Cartesian path produced more samples than requested, compressing it into a shorter, uniformly timed motion can make the executed joint velocities and accelerations exceed the limits used by the planner.
**Knowledge Base Used:**
- [Simulation lab](https://app.greptile.com/dexforce/-/custom-context/knowledge-base/dexforce/embodichain/-/docs/simulation-lab.md)
- [Motion planning and kinematics](https://app.greptile.com/dexforce/-/custom-context/knowledge-base/dexforce/embodichain/-/docs/motion-planning-and-kinematics.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Use trapezoidal timing when atomic-action tutorials omit --planner, while retaining cuRobo for the live collision-world recovery demo. Update planner guidance and regression coverage accordingly.
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.
Description
Add a shared motion-planner selector to the runnable atomic-action tutorials.
The new
--planneroption supportstoppra,trapezoidal, andcurobo, whileintentionally leaving
NeuralPlannerout of the tutorial selector because itrequires model-specific ONNX configuration.
trapezoidalis now the defaultfor ordinary atomic-action tutorials; the live collision-world recovery demo
retains its cuRobo-only default.
The change also makes planner-owned trapezoidal samples safe to consume in
composite atomic-action phases, adds CPU/Torch trajectory-resampling fallback
and focused coverage, and documents planner behavior, examples, and known
tutorial-specific constraints in the atomic-action and motion-generation
guides.
All atomic-action tutorials now use the same shared scene lighting: one global
downward
sunlight (main_light) for the simulation. Vectorized arenas nolonger create separate per-arena point lights, and the dual-arm examples no
longer need tutorial-specific light positions.
Issue reference: none provided.
Dependencies: no new dependencies. cuRobo remains optional and is only used
when selected (and requires its existing CUDA/runtime setup).
Type of change
Screenshots
Not applicable; this changes tutorial CLI behavior, scene lighting, and planner documentation.
Checklist
black .command to format the code base.python docs/scripts/check_api_docs.py), if applicableValidation
/root/miniconda3/envs/py311/bin/python -m pytest -q tests/sim/motion tests/sim/atomic_actions tests/compute/test_trajectory.py(
1363 passed, 31 skipped, 12 deselected)/root/miniconda3/envs/py311/bin/python -m pytest -q tests/test_agent_context_map.py tests/test_agent_context_tools.py(
23 passed)/root/miniconda3/envs/py311/bin/python docs/scripts/check_api_docs.py(
1925/1925 exports documented)/root/miniconda3/envs/py311/bin/python -m pytest -q tests/sim/atomic_actions/test_tutorial_utils.py(
77 passed)black .,compileall,git diff --check, and context affected-topic checkspassed.
deprecation and cross-reference warnings remain non-fatal.
Known limitations
dynamic_obstacle_recovery.pyremains cuRobo-only because it updates a livecollision world.
control_dt.pyintentionallyretains its IK interpolation experiment, and exact Cartesian-linear phases
remain IK-grounded.