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

Refactor SoftContacts algorithm #245

Merged
merged 9 commits into from
Sep 27, 2024
Merged

Refactor SoftContacts algorithm #245

merged 9 commits into from
Sep 27, 2024

Conversation

diegoferigo
Copy link
Member

@diegoferigo diegoferigo commented Sep 26, 2024

I realized that we can greatly simplify the algorithm by removing all conditional branches. It might run slightly slower since it has to compute a few more variables, but the code becomes much more readable and easy to debug in case of problems.

I tried to run some simulations either with spheres (that are approximated with 250 points) and humanoid robots free falling on terrain, and performance are almost the same, in few cases I get average execution time couple of % points slower, which is more than acceptable.

Furthermore, I generalized some soft contact resources for something else that will land soon 😃


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

@diegoferigo diegoferigo self-assigned this Sep 26, 2024
@diegoferigo diegoferigo force-pushed the refactor_soft_contacts branch from cbc7a63 to f8a92a6 Compare September 26, 2024 13:37
@diegoferigo diegoferigo force-pushed the refactor_soft_contacts branch 2 times, most recently from 3ad87f6 to 9330c00 Compare September 26, 2024 13:57
@diegoferigo diegoferigo force-pushed the refactor_soft_contacts branch from 9330c00 to cc7b010 Compare September 26, 2024 13:58
@diegoferigo diegoferigo marked this pull request as ready for review September 26, 2024 14:01
@diegoferigo diegoferigo requested a review from xela-95 September 26, 2024 14:01
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 a lot Diego! I just added some minor comments

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 a lot for addressing the review!

@diegoferigo diegoferigo force-pushed the refactor_soft_contacts branch from 8b9a695 to 33e0900 Compare September 27, 2024 07:28
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.

Great @diegoferigo! It looks good to me 🚀

Co-authored-by: Filippo Luca Ferretti <[email protected]>
@diegoferigo diegoferigo force-pushed the refactor_soft_contacts branch from 33e0900 to d59d2c2 Compare September 27, 2024 08:01
@diegoferigo diegoferigo merged commit a4d1476 into main Sep 27, 2024
24 checks passed
@diegoferigo diegoferigo deleted the refactor_soft_contacts branch September 27, 2024 08:57
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