cyclo_mjlab is a research-oriented repository built on
MJLab and
MuJoCo. It provides reinforcement learning environments,
task configurations, and motion-processing tools for developing locomotion and
motion-imitation policies for the ROBOTIS K1 humanoid robot.
The repository currently provides:
- Velocity: flat-ground velocity-tracking locomotion
- Mimic: Dance1 and Dance2 reference-motion tracking
- Automatic generation of
params/sim2real.yamlwhen training starts - Automatic export of
exported/policy.onnxandexported/policy.ptduring play
Important
This repository currently uses MJLab 1.6.1, MuJoCo 3.11.0, and Python 3.12.
Docker provides a consistent environment with the required Python packages, MuJoCo libraries, and GPU configuration pre-installed. Conda and a host Python environment are not required.
- Docker Engine with Docker Compose
- NVIDIA GPU with an appropriate NVIDIA driver
- NVIDIA Container Toolkit
- Git and access to this repository
-
Clone the repository with its submodules:
git clone --recurse-submodules git@github.com:ROBOTIS-GIT/cyclo_mjlab.git cd cyclo_mjlabIf the repository was cloned without submodules, initialize them separately:
git submodule update --init --recursive
-
Build the Docker image when needed and start the container:
./docker/container.sh start
-
Enter the running container:
./docker/container.sh enter
After entering the container, the training and playback commands below can be
run directly from /workspace/cyclo_mjlab.
| Command | Description |
|---|---|
./docker/container.sh build |
Build or update the image using the build cache |
./docker/container.sh start |
Build if missing, check image compatibility, and start and verify the container |
./docker/container.sh recreate |
Check the current image, recreate the container, and verify its runtime and CUDA |
./docker/container.sh enter |
Open an interactive shell in the running container |
./docker/container.sh stop |
Stop the container |
./docker/container.sh logs |
Follow the container logs |
./docker/container.sh clean |
Remove the container and image while preserving cache volumes |
The Docker image includes:
- Python 3.12
- MJLab 1.6.1
- MuJoCo and MuJoCo Warp 3.11.0
- Warp 1.14.0
- Runtime dependencies pinned with hashes in
requirements.lock
The default image/container names are cyclo-mjlab:latest and cyclo_mjlab.
The image carries LABEL version="1.0.0" to identify its release. This label is
metadata; compatibility checks use the actual installed runtime versions.
The project source and logs/ directory are shared with the host, so training
results remain available after the container is removed.
Release 1.0.0 requires Python 3.12 and MJLab 1.6.1. Images built for the previous
Python 3.11/MJLab 1.2 environment are incompatible. Updating the checkout does not
update an existing image, even when its tag is latest.
After updating the checkout, finish or stop any training or playback before replacing the container, then run on the host:
git submodule update --init --recursive
./docker/container.sh build
./docker/container.sh recreate
./docker/container.sh enterbuild updates the image using the build cache; recreate replaces the container using that
image. Recreating preserves the source bind mount, training logs, and named cache
volumes, but discards changes stored only in the old container's writable layer.
Keep the same CYCLO_MJLAB_IMAGE and CYCLO_MJLAB_CONTAINER overrides, if used.
Both start and recreate check the image against this checkout's
pyproject.toml before changing containers. An incompatible image causes the
command to fail with rebuild instructions. After startup, the container's
runtime and CUDA are checked again; failures are reported without declaring the
environment ready. Driver or GPU-access failures require fixing the host's
NVIDIA setup rather than simply rebuilding the image.
To run checks manually inside the container:
python docker/check_environment.py # Runtime versions and imports
python docker/check_environment.py --gpu # Also execute a CUDA tensor operationThese checks verify the runtime, not training convergence or individual tasks.
python scripts/reinforcement_learning/train.py Cyclo-Velocity-Flat-K1-Rev1-v0 \
--env.scene.num-envs 4096python scripts/reinforcement_learning/play.py Cyclo-Velocity-Flat-K1-Rev1-v0 \
--checkpoint-file logs/rsl_rl/k1_velocity/<run>/model_<iteration>.pt \
--num-envs 1python scripts/reinforcement_learning/train.py Cyclo-Mimic-K1-Rev1-Dance1 \
--env.scene.num-envs 4096python scripts/reinforcement_learning/train.py Cyclo-Mimic-K1-Rev1-Dance2 \
--env.scene.num-envs 4096python scripts/reinforcement_learning/play.py Cyclo-Mimic-K1-Rev1-Dance1 \
--checkpoint-file logs/rsl_rl/k1_mimic/<run>/model_<iteration>.pt \
--num-envs 1To display the reference trajectory next to the trained policy during playback:
python scripts/reinforcement_learning/play.py Cyclo-Mimic-K1-Rev1-Dance1 \
--checkpoint-file logs/rsl_rl/k1_mimic/<run>/model_<iteration>.pt \
--num-envs 1 \
--reference-ghost-offset 1.4,0,0python scripts/reinforcement_learning/play.py Cyclo-Mimic-K1-Rev1-Dance2 \
--checkpoint-file logs/rsl_rl/k1_mimic/<run>/model_<iteration>.pt \
--num-envs 1Replace <run> and <iteration> with the timestamped run directory and model
iteration to use.
The motion tools convert K1 CSV motion data into the MuJoCo-ordered NPZ format and validate or replay the converted trajectory:
python scripts/tools/motion/csv_to_npz.py --help
python scripts/tools/motion/replay_npz.py --helpThis repository is licensed under the Apache License 2.0.
- MJLab: Apache License 2.0; see THIRD_PARTY_LICENSES.md
- HybridRobotics/whole_body_tracking: MIT License; see THIRD_PARTY_LICENSES.md
- ROBOTIS AI Sapiens K1 Rev.1 assets: Apache License 2.0; see LICENSE.ai_sapiens

