-
Notifications
You must be signed in to change notification settings - Fork 11
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
Support coulomb and viscous joint friction #21
Conversation
Sorry, they return "the joint torque actuated by the physics engine" or the "the torque reference specified by the user" ? |
The "the torque references specified by the user" are part of the jaxsim/src/jaxsim/physics/model/physics_model_state.py Lines 121 to 125 in 74b57e8
The first location where the torque references can be gathered is this one. In the case the user does not explicitly set the references (e.g. because there are PID/whole-body controllers), jaxsim/src/jaxsim/high_level/model.py Lines 58 to 62 in 74b57e8
Then, to make We know well nowadays that often this information is easily lost in translation, and I tried to return as much data as possible to the users. There should be all the ingredients to produce a real joint torques feedback. |
226df95
to
1cca937
Compare
1cca937
to
af9db8c
Compare
It's worth mentioning that the adopted friction model is discontinuous. As soon as we start investigating AD support #4, we might need to smooth the friction model for better gradients. |
TLDR In practice it is sometimes useful to have different constants for both coulomb and viscous friction velocity directions. I do not know if the current PR supports this - reading fast it does not seem so |
@DanielePucci SDF models have This PR actually does read these two values separately and implements the joint friction model described in the first post: jaxsim/src/jaxsim/simulation/ode.py Lines 108 to 120 in 1c1c1ea
I'm not sure what you mean with velocity directions. You mean two different pairs of parameters for each joint used when |
Yes |
I understand, you may see current work in this direction in isorrentino/icub-firmware@73e405d robotology/icub-firmware@a5176f2 |
Thanks for reporting, good to know. Updating Python code to support this feature would be really straightforward, currently the main limitation is the model description that does not allow it out of the box. I have plans that will be soon revealed for supporting the new custom SDF attributes, and this extension could be included in this way. The trade off is that models containing such elements would become simulator-specific. In any case, let's keep this in mind if someone needs it in the future. |
The functionality mentioned in #21 (comment) could be implemented by finalizing ami-iit/rod#4. I plan to migrate soon our parsing logic to this new library. |
This PR introduces the support of coulomb and viscous joint friction.
The friction model used by physics is the following:
where
are the static and viscous joint friction parameters, and$\mathbf{q} = ({}^W H_B, \mathbf{s}) \in SE(3) \times \mathbb{R}^n$ .
Note that in presence of joint friction, the joint torque actuated by the physics engine differs from the torque reference specified by the user. This is historically a delicate subject in many physics engines. In order to simplify the implementation of torque/impedance controllers that require in their feedback term the knowledge of the real joint torques, our high-level classes already return this value in the
StepData
object returned byModel.integrate
:jaxsim/src/jaxsim/high_level/model.py
Lines 60 to 62 in 74b57e8