From 908ca8ba6fb9893dc5432a99e8c67220e7d7cab6 Mon Sep 17 00:00:00 2001 From: Filippo Luca Ferretti Date: Mon, 17 Jun 2024 18:35:10 +0200 Subject: [PATCH] Fix contact state pattern matching in `ode_data` --- src/jaxsim/api/ode_data.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/jaxsim/api/ode_data.py b/src/jaxsim/api/ode_data.py index 2baaf9809..c34af9ebe 100644 --- a/src/jaxsim/api/ode_data.py +++ b/src/jaxsim/api/ode_data.py @@ -213,15 +213,11 @@ def build( ) # Get the contact model from the `JaxSimModel` - match model.contact_model: - case SoftContacts(): + match contact: + case SoftContactsState(): pass case None: - contact = ( - contact - if contact is not None - else SoftContactsState.zero(model=model) - ) + contact = SoftContactsState.zero(model=model) case _: raise ValueError("Unable to determine contact state class prefix.")