diff --git a/src/jaxsim/rbda/contacts/common.py b/src/jaxsim/rbda/contacts/common.py index 6bdce1762..9a3fc3f24 100644 --- a/src/jaxsim/rbda/contacts/common.py +++ b/src/jaxsim/rbda/contacts/common.py @@ -324,10 +324,10 @@ def initialize_model_and_data( The initialized model and data objects. """ - with model.editable(validate=validate) as model_out: - model_out.contact_model = self + with self.editable(validate=validate) as contact_model: + contact_model.parameters = data.contacts_params - with data.editable(validate=validate) as data_out: - data_out.contacts_params = data.contacts_params + with model.editable(validate=validate) as model_out: + model_out.contact_model = contact_model - return model_out, data_out + return model_out, data