SolverMuJoCo: custom attribute for eq_solref#1245
Conversation
Signed-off-by: Alain Denzler <adenzler@nvidia.com>
📝 WalkthroughWalkthroughThis PR introduces comprehensive support for custom per-entity attributes on equality constraints, specifically the Changes
Sequence Diagram(s)sequenceDiagram
participant MJCF as MJCF Parser
participant Builder as ModelBuilder
participant Model as Model
participant Solver as SolverMuJoCo
participant Kernel as update_eq_properties_kernel
MJCF->>MJCF: Parse equality constraints<br/>with custom attrs
MJCF->>Builder: add_equality_constraint_*<br/>(custom_attributes=eq_solref)
Builder->>Builder: Validate & process<br/>custom attributes
Builder->>Model: Store attributes<br/>by EQUALITY_CONSTRAINT freq
Note over Builder,Model: Model construction & finalization
Solver->>Model: Load model with<br/>eq_solref attributes
Solver->>Solver: Create mjc_eq_to_newton_eq<br/>index mapping
Solver->>Solver: Set initial MuJoCo<br/>eq_solref values
Note over Solver: Runtime updates
Solver->>Solver: Notify:<br/>EQUALITY_CONSTRAINT_PROPERTIES
Solver->>Solver: Call update_eq_properties()
Solver->>Kernel: update_eq_properties_kernel<br/>(eq_solref, mapping)
Kernel->>Kernel: Map Newton idx →<br/>MuJoCo idx
Kernel->>Kernel: Copy solref to<br/>MuJoCo state
Kernel-->>Solver: Updated solver state
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
🧰 Additional context used🧠 Learnings (13)📓 Common learnings📚 Learning: 2025-08-12T17:51:37.474ZApplied to files:
📚 Learning: 2025-09-24T00:26:54.486ZApplied to files:
📚 Learning: 2025-08-19T12:27:30.629ZApplied to files:
📚 Learning: 2025-08-19T12:27:30.629ZApplied to files:
📚 Learning: 2025-11-24T08:05:21.390ZApplied to files:
📚 Learning: 2025-10-10T10:47:41.082ZApplied to files:
📚 Learning: 2025-09-22T21:08:31.901ZApplied to files:
📚 Learning: 2025-09-22T21:08:31.901ZApplied to files:
📚 Learning: 2025-08-12T05:17:34.423ZApplied to files:
📚 Learning: 2025-08-25T20:10:59.536ZApplied to files:
📚 Learning: 2025-10-27T18:45:18.446ZApplied to files:
📚 Learning: 2025-08-18T15:56:26.587ZApplied to files:
🧬 Code graph analysis (3)newton/_src/sim/builder.py (1)
newton/tests/test_mujoco_solver.py (3)
newton/_src/solvers/mujoco/solver_mujoco.py (3)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (18)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Signed-off-by: Alain Denzler <adenzler@nvidia.com>
Signed-off-by: Alain Denzler <adenzler@nvidia.com>
This one does not include USD parsing because we don't know about equality constraints in USD yet. We can always add later if needed.
Before your PR is "Ready for review"
newton/tests/test_examples.py)pre-commit run -aSummary by CodeRabbit
Release Notes
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.