Mujoco Mocapper is a tool that takes a mujoco file and adds mocap to it. It can be installed via the pip
command.
In the previous articles here and here, we discussed how to add mocap to a mujoco XML fie. The steps are very manual and tediuous and can be error prone and time consuming. Using the mujoco-mocapper
tool, we can automate the process and make it easier to add mocap to a mujoco XML file.
The following links for the tool:
Installation and Usage
The tool can be installed via the pip
command.
pip install mujoco_mocapper
and then you can run the tool via the mujoco-mocapper
command.
mujoco-mocapper <input-file> <body> <output-file>
Tool Steps
The tool does the following steps:
- Runs mujoco and finds the global position of the body we want to mocap
- Opens the input XML file and then adds the mocap related elements to the XML file and saves it as an XML file
- Runs mujoco on the new XML file with the keyboard controlled mocap
Examples
Here are some examples of the tool and mocapping some examples from the mujoco-menagerie repo.
Example 1: UR10e
mujoco-mocapper mujoco_menagerie/universal_robots_ur10e/scene.xml wrist_3_link mujoco_menagerie/universal_robots_ur10e/scene_mc.xml
Example 2: Skydio
mujoco-mocapper mujoco_menagerie/skydio_x2/scene.xml x2 mujoco_menagerie/skydio_x2/scene_mc.xml
Limitations and Future Features
The tool is still in its early stages.
- Keyframes are not part of the initalization but getting the mocap positions for the keyframes would be very useful.
- Support for multiple mocaps/bodies etc.
- The tool only supports keyboard controlled mocap. It would be nice to support a more general mocap and ability to save the current mocap and joint positions and replay them back.
- Deal with the assets file locations that require more advanced XML parsing.