From 062ea78f8fb12b4fc9a2f2df9fced3def0a521f0 Mon Sep 17 00:00:00 2001 From: Filippo Luca Ferretti Date: Wed, 26 Feb 2025 12:12:33 +0100 Subject: [PATCH] Use vertical asymptote joint viscous friction --- src/jaxsim/api/actuation_model.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/jaxsim/api/actuation_model.py b/src/jaxsim/api/actuation_model.py index b6cc2ba1c..96dbb7d28 100644 --- a/src/jaxsim/api/actuation_model.py +++ b/src/jaxsim/api/actuation_model.py @@ -83,13 +83,16 @@ def compute_resultant_torques( ṡ = data.joint_velocities - v_thresh = 10.0 + v_thresh = 50.0 # Compute the joint friction torque. - τ_friction = -( - jnp.diag(kc) @ jnp.sign(ṡ) - + jnp.diag(kv) @ (ṡ * v_thresh / (jnp.abs(ṡ) + v_thresh)) - ) + # τ_friction = -( + # # jnp.diag(kc) @ jnp.sign(ṡ) + # + jnp.diag(kv) @ (ṡ * v_thresh / (jnp.abs(ṡ) + v_thresh)) + # ) + + # Vertical asymptote + τ_friction = -jnp.diag(kv) @ (ṡ / (v_thresh - jnp.abs(ṡ))) # =============================== # Compute the total joint forces.