feat(expert-program): validate parallel joint segments - #482
Conversation
a271c5a to
a41a4cd
Compare
Greptile SummaryThe PR adds a cuRobo-backed safety gate for synchronized joint-position branches, validating densely interpolated command segments against joint limits, self-collision, and the live collision world.
Confidence Score: 4/5The implementation appears safe to merge, with the non-blocking requirement to document the newly exported validator APIs. The safety-validation flow is coherently wired and tested, and no concrete blocking runtime failure remains; the accepted issue is limited to missing documentation for the new public surface. Files Needing Attention: embodichain/lab/gym/envs/expert_program/init.py and public documentation
|
| Filename | Overview |
|---|---|
| embodichain/lab/gym/envs/expert_program/simulation_parallel_safety.py | Adds the production validator, runtime binding checks, segment interpolation, live-scene snapshots, and fail-closed collision handling. |
| embodichain/lab/sim/planners/curobo/curobo_planner.py | Adds cuRobo configuration-level validation for each supplied trajectory sample and integrates live dynamic-obstacle updates. |
| embodichain/lab/sim/planners/motion_generator.py | Exposes and validates the planner capability and boolean trajectory-validity contract. |
| embodichain/lab/gym/envs/expert_program/catalog.py | Extends safety-validator creation with the assembled scene registry and atomic-action engine while enforcing robot identity. |
| embodichain/lab/gym/envs/expert_program/init.py | Publicly exports the new validator APIs without the documentation required for public API additions. |
| tests/gym/envs/expert_program/test_simulation_parallel_safety.py | Covers dense merged trajectories, row-local rejection, uncovered joints, interpolation caps, configuration validation, and runtime binding. |
Sequence Diagram
sequenceDiagram
participant Runtime as Parallel Runtime
participant Gate as Safety Validator
participant Robot
participant Scene as Scene Registry
participant MG as Motion Generator
participant Curobo as cuRobo Checker
Runtime->>Gate: validate(branch frames, merged frame)
Gate->>Robot: read measured joint positions
Gate->>Gate: merge targets and densify segment
Gate->>Scene: snapshot live obstacle poses
Gate->>MG: validate_joint_trajectory(samples, poses)
MG->>Curobo: validate every sample
Curobo-->>MG: validity mask (B, T)
MG-->>Gate: validity mask
alt every active row is valid
Gate-->>Runtime: allow dispatch
else any active row is invalid
Gate-->>Runtime: raise ParallelSafetyError
end
Prompt To Fix All With AI
### Issue 1
embodichain/lab/gym/envs/expert_program/__init__.py:158-161
**Document the public safety APIs**
These exports add public validator and factory APIs without documenting their required aggregate control-part configuration, interpolation limits, runtime dependencies, or integration procedure, leaving users without the repository's required public API guidance.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(expert-program): validate parallel ..." | Re-trigger Greptile
| from .simulation_parallel_safety import ( | ||
| CuroboParallelCommandSafetyValidator, | ||
| CuroboParallelSafetyValidatorFactory, | ||
| ) |
There was a problem hiding this comment.
Document the public safety APIs
These exports add public validator and factory APIs without documenting their required aggregate control-part configuration, interpolation limits, runtime dependencies, or integration procedure, leaving users without the repository's required public API guidance.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/lab/gym/envs/expert_program/__init__.py
Line: 158-161
Comment:
**Document the public safety APIs**
These exports add public validator and factory APIs without documenting their required aggregate control-part configuration, interpolation limits, runtime dependencies, or integration procedure, leaving users without the repository's required public API guidance.
**Context Used:** AGENTS.md ([source](https://github.com/dexforce/embodichain/blob/main/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Description
Stack
feat/placement-relation-bindingsAdd a production cuRobo-backed safety validator for synchronized joint-position branches. The validator combines the merged command with measured full-robot state, requires an aggregate control part covering every commanded joint, and densifies the exact segment under a configured maximum joint step.
Every supplied sample is checked against cuRobo joint bounds, self-collision, and the registry-backed live static/dynamic world. Uncovered joints, overlapping commands, collision rows, and sample-cap under-sampling fail closed. The gate validates the command as written; it neither replans nor replaces the trajectory.
Refs #471
Refs #474
Type of change
Screenshots
Not applicable.
Validation
pytest -q tests/gym/envs/expert_program/test_simulation_parallel_safety.py tests/sim/planners/test_curobo_planner.py tests/gym/envs/expert_program/test_catalog.py tests/gym/envs/expert_program/test_extensions.py tests/gym/envs/expert_program/test_simulation_environment.py— 164 passed, 1 skipped, 2 deselectedChecklist