-
Notifications
You must be signed in to change notification settings - Fork 192
[DRAFT] Refactor SolverFeatherstone #916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughRefactors kernel parameter names from tau to joint_tau and updates all references. Introduces Featherstone-specific State and Model classes, a ModelBuilder to finalize these, modifies SolverFeatherstone construction and step control flow, switches kernel import paths, and adds optional triangle-triangle contact evaluation gating. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Solver as SolverFeatherstone
participant Model as ModelFeatherstone
participant StateIn as StateFeatherstone (in)
participant StateOut as StateFeatherstone (out)
participant Kernels as kernels_body
participant Contact as eval_triangle_contact_forces
User->>Solver: step(StateIn, StateOut, Control?, Contacts?, dt)
Solver->>Model: Access matrices/buffers (M, J, P, H, L)
Solver->>StateIn: Read joint/body state arrays
Solver->>Kernels: assemble/evaluate dynamics (uses joint_tau, qdd, S_s, etc.)
Kernels-->>Solver: Updated system matrices/vectors
alt enable_tri_contact and Contacts provided
Solver->>Contact: evaluate triangle-triangle contacts
Contact-->>Solver: contact forces/impulses
end
Solver->>StateOut: Write updated matrices and per-state outputs
Solver-->>User: return
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)newton/_src/solvers/featherstone/kernels_body.py (1)
newton/_src/solvers/featherstone/solver_featherstone.py (7)
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 |
@etaoxing I would hold off from making these changes - we want to keep the Having your diffsim improvements would definitely be a great contribution though! |
|
Sounds good @eric-heiden! After trying out the change, definitely agree solver-specific Will keep this PR as a draft then (and hold off on messing with other solvers) until #710 is ready! |
Description
(work in progress) Refactor SolverFeatherstone to follow similar code structure as SolverSemiImplicit.
StateFeatherstone,ModelFeatherstone,ModelBuilderFeatherstone_state,_model,_builderobjects are prefixed with an underscoreNewton Migration Guide
Please ensure the migration guide for warp.sim users is up-to-date with the changes made in this PR.
docs/migration.rstis up-to dateBefore your PR is "Ready for review"
newton/tests/test_examples.py)pre-commit run -aSummary by CodeRabbit