Skip to content
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

Update ContactModel.compute_contact_forces APIs #247

Merged
merged 10 commits into from
Sep 27, 2024

Conversation

diegoferigo
Copy link
Member

@diegoferigo diegoferigo commented Sep 27, 2024

The new contact models that have been introduced recently need to consider the whole system dynamics to compute the contact forces. This was not necessary in the original SoftContacts model. However, this is just a simplification specific to the SoftContacts model implementation, and it is the main reason why they can run so fast compared to the new models.

I believe that the most generic APIs take model and data as input arguments instead of position and velocity. This also aligns the disparity in which the position|velocity arguments of SoftContacts were the individual ones, while for the other contact models were the vmapped ones. Furthermore, it removes the ambiguity for the other contact models in which the passed position|velocity could differ from the kinematics that can be computed from model|data.


📚 Documentation preview 📚: https://jaxsim--247.org.readthedocs.build//247/

@diegoferigo diegoferigo requested a review from xela-95 September 27, 2024 09:22
@diegoferigo diegoferigo self-assigned this Sep 27, 2024
@diegoferigo diegoferigo marked this pull request as ready for review September 27, 2024 09:30
@diegoferigo diegoferigo force-pushed the update_contact_model_apis branch from 44060d2 to 6a37c5b Compare September 27, 2024 09:43
Copy link
Collaborator

@flferretti flferretti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Diego, LGTM!

Copy link
Member

@xela-95 xela-95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @diegoferigo!! LGTM!

@diegoferigo diegoferigo force-pushed the update_contact_model_apis branch 3 times, most recently from 6b8753b to a6737cb Compare September 27, 2024 13:44
@diegoferigo diegoferigo force-pushed the update_contact_model_apis branch from a6737cb to cecc824 Compare September 27, 2024 13:45
src/jaxsim/api/ode_data.py Show resolved Hide resolved
src/jaxsim/api/data.py Outdated Show resolved Hide resolved
Co-authored-by: Filippo Luca Ferretti <102977828+flferretti@users.noreply.github.com>
Copy link
Collaborator

@flferretti flferretti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the review! This improves a lot the readability and the logic of that part of the codebase

@diegoferigo diegoferigo merged commit d06ada9 into main Sep 27, 2024
24 checks passed
@diegoferigo diegoferigo deleted the update_contact_model_apis branch September 27, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants