Open Duck project's reference motion generator for imitation learning, based on Placo.
The reference motions are used in two RL works, one using mujoco playground here and another using Isaac Gym here
This repo uses
git-lfs
. Install it withsudo apt install git-lfs
before cloning the repo
Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
uv run scripts/auto_waddle.py (-j?) --duck ["go_bdx", "open_duck_mini", "open_duck_mini_v2"] (--num <> / --sweep) --output_dir <>
If you have an error like this :
Failed to determine STL storage representation for <...> Hint: the mesh directory may be wrong
, just rungit lfs pull
Args :
-j?
number of jobs. Ifj
is not specified, will run sequentially. Ifj
is specified without a number, your computer will crash :) (runs with all available cores). Usej4
for example--duck
selects the duck type--sweep
generates all combinations of motion within the ranges specified inOpen_Duck_reference_motion_generator/open_duck_reference_motion_generator/robots/<duck>/auto_gait.json
--num
generates random motions--output_dir
self explanatory
For example, to generate all the reference motion for Open Duck Mini, run :
uv run scripts/auto_waddle.py -j8 --duck open_duck_mini_v2 --sweep
This will write in a directory called recordings/
This will generate polynomial_coefficients.pkl
uv run scripts/fit_poly.py --ref_motion recordings/
To plot :
uv run scripts/plot_poly_fit.py --coefficients polynomial_coefficients.pkl
uv run scripts/replay_motion.py -f recordings/<file>.json
uv run open_duck_reference_motion_generator/gait_playground.py --duck ["go_bdx", "open_duck_mini", "open_duck_mini_v2"]
- The robots descriptions should be in a separate repository and imported as a submodule. This would help having duplicates of the same files, or with different versions etc.
- Validate that we can train policies with these motions (might have broken something during the port...)
- Fix small bugs in gait_playground (refreshing, changing robots ...)
- Nicer visualization ? Directly visualize using meshcat maybe.
- A document to specify the reference motion format, if someone wants to convert some mocap data to use for the imitation reward ?
- The repo duck themed, but it could be a generic motion generator based on placo for biped robots (will add sigmaban at some point)
- Sub TODO : explain how to add a new robot