aikkala / O2MConverter

OpenSim to MuJoCo XML converter
63 stars 13 forks source link

How convert motion file (.mot) to mujoco? #7

Open tsbiosky opened 1 year ago

tsbiosky commented 1 year ago

Great works! But is it possible to create MJCF motion file from the opensim motion (.mot ) ?

aikkala commented 1 year ago

As far as I recall, the joint names should be equal in opensim and mujoco, but the joint values between opensim joints (or more specifically opensim Coordinates) and mujoco joints may not be exactly the same in all cases. If the joint names are not equal, then you need to manually check which opensim joint corresponds to which mujoco joint. Then you can parse the .mot file and create e.g. a python script and use the deepmind mujoco bindings to feed the parsed values in to the mujoco model

tsbiosky commented 1 year ago

Thank you for your reply ,in Opensim motion file it has coordinates for each joint at every time step, but how should I put the list of cooadinates into the XML file for Mujoco , in Mujoco XML the joint only has a initial pos and axis .

As far as I recall, the joint names should be equal in opensim and mujoco, but the joint values between opensim joints (or more specifically opensim Coordinates) and mujoco joints may not be exactly the same in all cases. If the joint names are not equal, then you need to manually check which opensim joint corresponds to which mujoco joint. Then you can parse the .mot file and create e.g. a python script and use the deepmind mujoco bindings to feed the parsed values in to the mujoco model

aikkala commented 1 year ago

That's not possible, I'm afraid. You need to create a c++/python script to set the values for each time step