Skip to content
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

Stiffness and Damping Switched in Tendon .cs file #2215

Open
2 tasks done
sriddle97 opened this issue Nov 6, 2024 · 4 comments
Open
2 tasks done

Stiffness and Damping Switched in Tendon .cs file #2215

sriddle97 opened this issue Nov 6, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@sriddle97
Copy link

sriddle97 commented Nov 6, 2024

Intro

Hello,
I've been trying to debug my model of a soft robot constructed using composite cable and tendon elements. I made a separate post about the cable element moments of inertia but I also noticed that changing the tendon stiffnesses in the xml file did not result in a higher stiffness when the simulation runs.

My setup

Mujoco, python

What's happening? What did you expect?

As part of the debug process I tried changing the stiffness parameter in the xml file and noticed that multiplying that by even a factor of 1000 did not appreciably change the stiffness experienced when the simulation runs. The force required to contract the tendon a prescribed amount for stiffness=50 is 5N and for stiffness=50,000 it is 5.8N.

I went through the Mujoco Github repository looking for potential bugs and stumbled across one that may be relevant. In the MjBaseTendon.cs file https://github.com/google-deepmind/mujoco/blob/main/unity/Runtime/Components/Tendons/MjBaseTendon.cs it appears that the stiffness is set equal to the damping and vice versa on lines 45 and 46.

Stiffness = mjcf.GetFloatAttribute("damping");
Damping = mjcf.GetFloatAttribute("stiffness");

It looks correct later in lines 55 and 56 but I am not sure what purpose each of those components of the code serve as they are in different protected override sections.

Could this by why changing my tendon stiffness value is not actually resulting in increased stiffness at run time?

Confirmations

@sriddle97 sriddle97 added the bug Something isn't working label Nov 6, 2024
@yuvaltassa
Copy link
Collaborator

@Balint-H this looks like an actual (easy to fix) bug. Can you confirm?

@Balint-H
Copy link
Collaborator

Hello, yes this looks like a clear cut fix, will push it today.

@sriddle97
Copy link
Author

Thank you for taking care of this. Did this fix ever get pushed? I still see the original, incorrect lines in the .cs file.

@Balint-H
Copy link
Collaborator

I sent the pull request for the fix, but it still needs to be approved by someone. @erez-tom could you help out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants