The problem of adding new motion capture data for human motion tracking
Opened this issue · 6 comments
In the human motion tracking task, I want to add new motion capture data, but the amc file I downloaded from CMU is different from the xml of the keyframe in mjpc. Is some format conversion program being used? How do I get the new motion capture data file in the new xml format. Thanks a lot.
Unfortunately, I haven't open-sourced any of these functions as they're overly complicated and not very user friendly for anyone else than myself. It's been long on my todo-list to clean up the IK-code but I'm honestly not sure if I'll ever get there.
You need to transform the .amc
-files into our .xml
format. For that, you basically have to extract the cartesian joint/body positions for each frame and order them like they're used here:
mujoco_mpc/mjpc/tasks/humanoid/tracking/tracking.cc
Lines 69 to 73 in 1f78168
That should be relatively easy to do. Just note that you'll have to rescale the positions with a constant value to get them right. Then just write the each frame into an .xml
file like here:
That is, each key
in the .xml
contains 48 = 16 * 3
(cartesian xyz position for the 16 joints) mpos
values.
What's a bit trickier is if you also want to use reset positions for the motions. These are controlled by the first keyframe
's qpos
and qvel
values (like in the above example key
). For these, you're gonna have to do some inverse kinematics because the .amc
-files don't include those for our humanoid. For the inverse kinematics, I've used the multi-site IK functions from here: google-deepmind/dm_control#399.
I looked around and noticed that I had opened a PR (https://github.com/hartikainen/mocap-environments/pull/6/files) for converting the AMASS files (which also contains most of the CMU mocap motions) into our .xml
format. That might give you some ideas on how to approach the conversion. But be warned: as I mentioned above, the code is not super usable right now and it's been so long since I opened the PR that the code might be buggy/stale already.
@rottenapple777 if you would clean that up and make it usable, that would be a much-appreciated contribution 👍
@hartikainen Okay, I'll check it out. Thanks for taking the time to reply.
Is there an update on this?