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

Add new ViscoElasticContacts #248

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

diegoferigo
Copy link
Member

@diegoferigo diegoferigo commented Sep 27, 2024

WIP


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

@diegoferigo diegoferigo self-assigned this Sep 27, 2024
@diegoferigo diegoferigo changed the title Add new ViscoElasticContactModel Add new ViscoElasticContacts Sep 27, 2024
@xela-95
Copy link
Member

xela-95 commented Sep 30, 2024

Hi @diegoferigo, another early comment since I'm testing this contact model: in jaxsim.api.ode.system_dynamics @

case SoftContacts():
ode_state_kwargs["tangential_deformation"] = aux_dict["m_dot"]
case RigidContacts() | RelaxedRigidContacts():
pass
case _:
raise ValueError("Unable to determine contact state class prefix.")
# Extract the velocities.
we should add a case for this class of contact model.

From collidable_point_dynamics I can see this model outputs some auxiliary data, that should be extracted:

aux_data = dict(W_f_avg2_C=W_f̿_Ci, m_tf=m_tf)

@diegoferigo
Copy link
Member Author

[...]
we should add a case for this class of contact model.

From collidable_point_dynamics I can see this model outputs some auxiliary data, that should be extracted: [...]

Thanks @xela-95 for the feedback. The dictionary returned by the visco-elastic contact model is somewhat different then the one returned by the soft contact model. The latter returns $\dot{\mathbf{m}}$ (the derivative of the material deformation) that needs to be integrated together with the generalized state $(\mathbf{q}, \, \boldsymbol{\nu})$. The visco-elastic contacts, instead, directly compute $\mathbf{m}(t+\Delta t)$, therefore we need to override $\mathbf{m}$ of the extended state similarly than the velocity reset done in by the rigid contacts.

Regardless, I'm still unsure how to integrate the new visco-elastic contacts with the default jaxsim.model.step function. What I just wrote is only necessary when the default integrators are used. The best way to exploit this new contact model, however, is to use its own integrator jaxsim.rbda.contacts.visco_elastic.step, that integrates both the generalized position and velocity using the contact forces computed explicitly with the continuous exponential integrator.

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.

2 participants