Skip to content

Commit

Permalink
[wip] Add support for ViscoElasticContacts in jaxsim.api.ode
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo committed Oct 7, 2024
1 parent 7e9eea9 commit 6479013
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/jaxsim/api/ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import jaxsim.typing as jtp
from jaxsim.integrators import Time
from jaxsim.math import Quaternion
from jaxsim.rbda import contacts

from .common import VelRepr
from .ode_data import ODEState
Expand Down Expand Up @@ -371,8 +372,6 @@ def system_dynamics(
by the system dynamics evaluation.
"""

from jaxsim.rbda.contacts import RelaxedRigidContacts, RigidContacts, SoftContacts

# Compute the accelerations and the material deformation rate.
W_v̇_WB, , aux_dict = system_velocity_dynamics(
model=model,
Expand All @@ -387,10 +386,18 @@ def system_dynamics(

match model.contact_model:

case SoftContacts():
case contacts.SoftContacts():
extended_ode_state["tangential_deformation"] = aux_dict["m_dot"]

case RigidContacts() | RelaxedRigidContacts():
case contacts.ViscoElasticContacts():

extended_ode_state["contacts_state"] = {
"tangential_deformation": jnp.zeros_like(
data.state.extended["tangential_deformation"]
)
}

case contacts.RigidContacts() | contacts.RelaxedRigidContacts():
pass

case _:
Expand Down

0 comments on commit 6479013

Please sign in to comment.