-
Notifications
You must be signed in to change notification settings - Fork 955
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
Setting frictionloss breaks joint equality constraint #2430
Comments
You have two forces fighting each other, one is going to win. Equality constraints, like all constraints in MuJoCo, are soft. You can make them harder if you wish using solimp/solref. |
@yuvaltassa Thanks for your quick response! I understand that all constraints in MuJoCo are soft, and have tried setting
|
@yuvaltassa I find that, while it is indeed related to soft constraints, the thing actually makes the phenomenon counterintuitive might be the Understanding this, it is easy to construct a funny example that when you apply force on one body, it stays in place, while the other starts to move (both body have one joint of x slide, and coupled):
Is it possible to have better |
Can you please send your minimal "funny example"? This looks valuable... |
Here it is. Move actuator 0 to left bound to see the effect. The larger the <?xml version="1.0" encoding="utf-8"?>
<mujoco>
<compiler angle="radian" />
<option timestep="0.001" integrator="implicit" noslip_iterations="1" />
<worldbody>
<geom name="plane" type="plane" size="0.5 0.5 0.025" pos="0 0 -0.15" />
<body name="1">
<joint name="1" type="slide" axis="1 0 0" frictionloss="100000" />
<geom name="1" type="sphere" size="0.1" rgba="1 0 0 1" />
</body>
<body name="2" pos="0 0.5 0">
<joint name="2" type="slide" axis="1 0 0" />
<geom name="2" type="sphere" size="0.1" rgba="0 1 0 1" />
</body>
</worldbody>
<equality>
<joint joint1="1" joint2="2" polycoef="0 1" />
</equality>
<actuator>
<motor joint="1" ctrlrange="-30000 0" />
</actuator>
</mujoco> P.S.: For the specific case of applying and overcoming large friction force on light bodies, I could think of applying large armature as a reasonable workaround. |
Yes I played with this and see what is happening. Your diagnosis is correct, this is basically due to how |
@yuvaltassa Thank you for the information. May I ask if #2423 has the same root cause or not? |
Ah missed that one. I hope to look more closely later in the week, will let you know. |
Intro
Hi!
I am a graduate student at HKU, I use MuJoCo for my research on robotic manipulation.
My setup
MuJoCo 3.2.7, Python and C, Linux
What's happening? What did you expect?
I apologize if this issue falls more under the current limitations of constraint optimization rather than being a bug.
When using
equality/joint
to couple two joints A and B (e.g., withpolycoef="0 1"
), the expectation is that both joints should move in sync. If a passive/actuator/applied force is applied to prevent joint B from moving, joint A should also stop. However, an issue arises when the force is implemented viafrictionloss
on joint B.In such cases:
frictionloss
, joint B starts to lag behind.frictionloss
, joint B completely stops moving while joint A moves almost freely.Since
frictionloss
is implemented as constraints, this behavior might indicate an issue with the constraint solution. Interestingly, other constraint forces like contact forces seem to perform as expected.For further context and to avoid potential "XY problem," the documentation mentions:
While it is straightforward to create a basic helical joint using a slide and a hinge with joint equality, I am experimenting with achieving self-locking. Specifically, I want the force applied to the slide (such as gravity and normal force) to not cause any movement in both the slide and the hinge, only to prevent potential movement. I would appreciate any insights or solutions that might address this issue.
Steps for reproduction
See XML
Minimal model for reproduction
Code required for reproduction
No response
Confirmations
The text was updated successfully, but these errors were encountered: