Problems with anisotropic friction #2517
-
IntroHi, I work in ML research, mostly at the intersection of RL and control. I'm running into some issues while trying to model a robot which needs anisotropic friction. I have come up with a minimal example to replicate those problems, as seen below. My setupI'm using Mujoco version My questionAs mentioned in the intro section, I need to set anisotropic friction in a robot that I need to simulate, and to understand how to do this, I've been trying to get the toy example below to work. The idea in that toy example is to balance a ball on three capsules, which are supposed to behave like omniwheels: For example, activating the motor corresponding to the green one should apply a torque in the direction illustrated below. Furthermore, if we spin the ball in a manner that is aligned with the principal axis of the capsule, we should encounter very low friction. From the documentation, it seems that the only way to have different friction values for the two tangent directions is to define a contact point (contact point friction). I have done this and set the friction coefficients to However, that is absolutely not the case. Not only does the (local) axis along which high friction applies seem to differ from one capsule to another, but in some situations, the direction of the ball changes in unexpected ways. If you decide to run the attached code: just set a few positive values for Could you please help me understand what I'm doing wrong? Thank you very much for your time! Minimal model and/or code that explain my questionHere's the *xml code:
and here's the python script:
Confirmations
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
The visualizer allows you to see the axes of the contact frame. Did you try that? |
Beta Was this translation helpful? Give feedback.
-
Another option is to fix the collider... I suspect that in line 309 if you flip the last 3 arguments with the 3 before them like return mjraw_SphereSphere(con, margin, vec, mat2, size2, pos1, mat1, size1); then the collider will do what you want. Can you build from source and confirm? |
Beta Was this translation helpful? Give feedback.
So you want to replace this line with
I don't think that will make it into the next release, but you can make the change locally.