aikkala / O2MConverter

OpenSim to MuJoCo XML converter
63 stars 13 forks source link

gait model issue #4

Closed gpzhaome closed 2 years ago

gpzhaome commented 2 years ago

Hi,

I just came across this project. It's very helpful for me. Thanks for sharing.

But I got a problem with the gait models (FullBodyModel_SimpleArms_Hamner2010_Markers_v2_0, gait10dof18, gait2392, leg6dof9). The shank segment and the thigh segment overlap each other when I load the converted xml model to mujoco (I'm using mujoco 2.1). Do you also have the same issue?

Thanks.

aikkala commented 2 years ago

Hi,

I'm familiar with this issue, but unfortunately I don't have a fix for it. I would suggest that you disable collisions (set collision="predefined") and then add only those collisions which you need, e.g. between feet and ground with contact pairs.

gpzhaome commented 2 years ago

Thanks for the suggestion of disabling the collision detections. But I think you misunderstand the issue. The issue is that the thigh segment is completely overlapped by the shank segment. This is the screenshot when I load the model: image

This problem exists for all the gait models except the Rajagopal2015.

aikkala commented 2 years ago

Ok, I see what you mean. This is due to the way those OpenSim models are defined. The issue is that some of the joints depend on other joint values, and when initialising a mujoco model/simulation, those dependent joint values have not been automatically set. You can either do something like is done in Utils.initialise_full_qpos function, which updates the dependent joint values, or run the simulation for a few steps and let mujoco handle the updating of dependent joint values. Note that this model is also inside the floor geom, so you might want to lift it a bit higher (e.g. set pos="0 0 1" for the body named "pelvis").

gpzhaome commented 2 years ago

OK, I see. Thanks!