-
Notifications
You must be signed in to change notification settings - Fork 11
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
Refactor contact models and add tests #260
Conversation
@ jnp.linalg.inv(M_L[link_idx, :3, :3]) | ||
* (1 / jnp.diag(M_L[link_idx, 0:3, 0:3]).mean()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flferretti I suspect that the usage of the spatial inertia of the link
- https://github.com/google/brax/blob/865d974c0285d345425d76df30c38614c828c8c8/brax/generalized/constraint.py#L169
- https://github.com/google/brax/blob/865d974c0285d345425d76df30c38614c828c8c8/brax/base.py#L316C5-L316C14
- https://github.com/google-deepmind/mujoco/blob/5e989d18c349e914fb82ae937006ff4832b011ce/src/engine/engine_setconst.c#L87-L100
Note that I didn't fix it here in this PR. We should replace M_L
with something else after some investigation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delayed to a next PR.
ed2b8b3
to
598abeb
Compare
In this PR, I also added some simple test of all contact models so that we at least know that we won't break anything related to them in the future. Regardless, since I touched some internal details of the |
598abeb
to
d8feb7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an early comment, would it make sense to include in this PR avoid repeating the contact_params
attributes in JaxSimModelData
and in ContactModel
?
b0dbdad
to
2b6f69d
Compare
@xela-95 w.r.t. to the original PR, I updated the direction of action of the baumgarte stabilization. Now it produces a force towards the terrain's normal, and this behavior is aligned with
Let me think about it. Having nominal parameters already defined in the contact model itself is quite useful, but the dynamic override from |
2b6f69d
to
85a98da
Compare
95559f1
to
acae469
Compare
a80cbaf
to
2e0b3af
Compare
822fe18
to
3ec2a87
Compare
3ec2a87
to
7b2fc3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! I left a couple comments
f2e613f
to
224f051
Compare
Fixes a regression that prevented overriding the nominal parameters stored in model with those stored in data
Co-authored-by: Filippo Luca Ferretti <102977828+flferretti@users.noreply.github.com>
Co-authored-by: Filippo Luca Ferretti <102977828+flferretti@users.noreply.github.com>
224f051
to
1e5d13f
Compare
@flferretti @xela-95 I removed from this PR the new logic of the There are few PRs that depend on this one. I want to merge these changes and propose again the new logic of the |
I wanted to polish and uniform the great work done in the last few months about contact models. Likely, we need to keep working on them to optimize their performance, I took advantage of going through them more carefully than my previous reviews.
I have some doubts on few details of the
RigidContacts
andRelaxedRigidContacts
. I will comment my edits in this PR to discuss my doubts and proposed changes.📚 Documentation preview 📚: https://jaxsim--260.org.readthedocs.build//260/