MyoHub / myoconverter

A tool to convert opensim 4.0+ MSK models into MuJoCo format with optimized muscle kinematics and kinetics
Apache License 2.0
67 stars 5 forks source link

Gait10dof18musc_cvt3.xml model issue #41

Open scakki opened 1 month ago

scakki commented 1 month ago

Hello!

I'm having trouble with the Gait10dof18musc_cvt3.xml model in MuJoCo 2.3.7. When I try to load it, the simulation becomes unstable and throws an error. Strangely, the Gait10dof18musc_cvt2.xml model works perfectly without any issues.

Has anyone experienced this or knows how to resolve it? Any guidance would be greatly appreciated!

MuJoCo version 2.3.7 Plugins registered by library 'libelasticity.so': mujoco.elasticity.cable mujoco.elasticity.solid Plugins registered by library 'libsensor.so': mujoco.sensor.touch_grid WARNING: Nan, Inf or huge value in QACC at DOF 0. The simulation is unstable. Time = 0.0300.

Screenshot_20241007_152658 Screenshot_20241007_152730

scakki commented 1 month ago

Hello,

I am still facing this issue. Anyone who has used this model? Any suggestions on how this can be fixed? I would greatly appreciate any suggestions!

Thank you for your time.

Vittorio-Caggiano commented 1 month ago

@elladyr do you have any feedback on this specific model?

elladyr commented 1 month ago

Hi @scakki

The Gait10dof18musc_cvt3.xml model by default seems to come with the stacked feet.

Setting the joint poses using the keyposes "fixes" this problem, if you are running a simulation in Myosuite. Do note that the you will also need to set all the joint velocities to 0 to remove all residual velocities and forces that is calculated by the simulator.

If you are using the visualizer from Mujoco, you will see that advancing the simulation by about 0.5 sec would cause the legs to "snap back" to its correct anatomical position.

Let me know if you have any other questions.

scakki commented 1 month ago

Hello @elladyr,

Thank you so much for your response. With your suggestion, I was able to snap the legs back into place, but in the process, it seems like the muscle actuators somehow became detached. Do you have any suggestions on what might be causing this? image

Additionally, I have another question. I'm a bit confused about why the following muscles are defined as joints. Could you point me to any resources or documentation that could help me understand this? rect_fem_r_rect_fem_r-P3_x rect_fem_r_rect_fem_r-P3_y vasti_r_vas_int_r-P4_x vasti_r_vas_int_r-P4_y vasti_r_vas_int_r-P3_y vasti_r_vas_int_r-P3_z gastroc_r_med_gas_r-P2_x gastroc_r_med_gas_r-P2_y gastroc_r_med_gas_r-P2_z

Thanks again for your time!

elladyr commented 1 month ago

Hi @scakki

  1. When using the Mujoco 2.3.7 visualizer, if you just clicked on the "Key" slider on the bottom left of the attached screenshot, you should be able to see a properly aligned model.

Screenshot: image

  1. The sliding joints (e.g. rect_fem_r_rect_fem_r-P3_x, etc) are modelling movable muscle attachment points from OpenSIM.
scakki commented 1 month ago

Thank you, @elladyr! I was able to address the issue with the legs and improve the model's posture. However, the vasti_l and vasti_r muscles appear to be detached, resulting in their activation not affecting any joints. Please check the attached video for a clearer understanding of the problem (I have increased the damping a little to make it more evident).

Gait10dof18musc.webm

scakki commented 3 weeks ago

Hello everyone,

Does anyone have suggestions on how to fix this muscle? Any advice would be greatly appreciated. Thank you!

elladyr commented 2 weeks ago

Hi @scakki,

Thank you for your patience.

Well, for one the pose you are having now will not show any effect of the vasti muscles because the joint is already at the knee joint extension limits. However, in my own testing (suspending the model and testing the muscles), the vasti muscles are indeed not creating any force to extend the knee.

https://github.com/user-attachments/assets/47317f24-06dc-4d0d-9ae9-cd23d3af840c

Could you try running the MyoConverter again on this model and see if the problem persist?

scakki commented 2 weeks ago

Hello @elladyr,

Thank you for taking the time to test it. I reconverted it myself using the MyoConverter documentation, but the issue still persists. I also noticed that while the vast muscle doesn't function properly in cvt3.xml, it seems to work somewhat in cvt1.xml. Do you have any suggestions or advice on how to fix this or what the potential issue might be? Your input would be greatly appreciated.