This repository is developed based on Lerobot, combined with Leju Kuavo robot, providing complete example code for data format conversion (rosbag β parquet), Imitation Learning (IL) training, simulator testing, and real robot deployment verification.
β οΈ Note: This repository does not yet support end-effector control; currently only joint angle control is available!
Ubuntu 20.04 + NVIDIA CUDA Toolkit + Docker is recommended.
sudo apt update
sudo apt upgrade -y
ubuntu-drivers devices
# Tested verfied version is 535, you can try newer versions (do not use server branch)
sudo apt install nvidia-driver-535
# Reboot the computer
sudo reboot
# Verify driver installation
nvidia-smi
When using nvidia-smi acceleration in Docker images, it is necessary to load the nvidia runtime library, therefore NVIDIA Container Toolkit needs to be installed.
sudo apt install curl
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1 && sudo apt-get install -y nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}
sudo apt update
sudo apt install git
sudo apt install docker.io
# Configure NVIDIA Runtime in Docker
nvidia-ctk
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
sudo docker info | grep -i runtime
# The output should include "nvidia" Runtime
Both Kuavo Mujoco simulation and real robot operation are based on the ROS Noetic environment. Since the real Kuavo robot uses Ubuntu 20.04 + ROS Noetic (non-docker), it is recommended to directly install ROS Noetic. If ROS Noetic cannot be installed due to a higher Ubuntu version, Docker can be used.
Installation example:
wget http://fishros.com/install -O fishros && . fishros
# Menu selection: 5 Configure system sources β 2 Change sources and clean third-party sources β 1 Add ROS sources
wget http://fishros.com/install -O fishros && . fishros
# Menu selection: 1 One-click installation β 2 Install without changing sources β Select ROS1 Noetic Desktop
Test ROS installation:
roscore # Open a new terminal
rosrun turtlesim turtlesim_node # Open a new terminal
rosrun turtlesim turtle_teleop_key # Open a new terminal
sudo vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://docker.imgdb.de",
"https://docker-0.unsee.tech",
"https://docker.hlmirror.com",
"https://docker.1ms.run",
"https://func.ink",
"https://lispy.org",
"https://docker.xiaogenban1993.com"
]
}
sudo systemctl daemon-reload && sudo systemctl restart docker
mkdir /path/to/save/docker/ros/image
cd /path/to/save/docker/ros/image
vim Dockerfile
Then write the following content in the Dockerfile:
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirrors.tuna.tsinghua.edu.cn/ubuntu/|g' /etc/apt/sources.list && \
sed -i 's|http://security.ubuntu.com/ubuntu/|http://mirrors.tuna.tsinghua.edu.cn/ubuntu/|g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y locales tzdata gnupg lsb-release
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
# Set ROS debian sources
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Add ROS keys
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# Install ROS Noetic
# Set keyboard layout to Chinese if necessary
RUN apt-get update && \
apt-get install -y keyboard-configuration apt-utils && \
echo 'keyboard-configuration keyboard-configuration/layoutcode string cn' | debconf-set-selections && \
echo 'keyboard-configuration keyboard-configuration/modelcode string pc105' | debconf-set-selections && \
echo 'keyboard-configuration keyboard-configuration/variant string ' | debconf-set-selections && \
apt-get install -y ros-noetic-desktop-full && \
apt-get install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential && \
rm -rf /var/lib/apt/lists/*
# Initialize rosdep
RUN rosdep init
After writing, save and exit. Build the Ubuntu 20.04 + ROS Noetic image:
sudo docker build -t ubt2004_ros_noetic .
After the build is complete, enter the image. For the first time starting the container and loading the image:
sudo docker run -it --name ubuntu_ros_container ubt2004_ros_noetic /bin/bash
# Or GPU launch (recommended)
sudo docker run -it --gpus all --runtime nvidia --name ubuntu_ros_container ubt2004_ros_noetic /bin/bash
# Optional, mount local directory paths, etc.
# sudo docker run -it --gpus all --runtime nvidia --name ubuntu_ros_container -v /path/to/your/code:/root/code ubt2004_ros_noetic /bin/bash
For subsequent launches:
sudo docker start ubuntu_ros_container
sudo docker exec -it ubuntu_ros_container /bin/bash
After entering the image, initialize the ROS environment variables, then start roscore:
source /opt/ros/noetic/setup.bash
roscore
If everything is correct, the Docker configuration for Ubuntu 20.04 + ROS Noetic is complete.
# SSH
git clone --depth=1 https://github.com/LejuRobotics/kuavo_data_challenge.git
# Or
# HTTPS
git clone --depth=1 https://github.com/LejuRobotics/kuavo_data_challenge.git
Update the lerobot submodule under third_party:
cd kuavo_data_challenge
git submodule init
git submodule update --recursive
conda create -n kdc_icra python=3.10
conda activate kdc_icra
Install python3.10 first, then use venv to create a virtual environment:
β οΈ Warning: ppa:deadsnakes no longer provide packages for ubuntu20.04 after June 2025, the following installation method may not work anymore:
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.10 python3.10-venv python3.10-dev
You may need to build from source as follows:
sudo apt update
sudo apt install -y build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-devlibreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev uuid-dev wget
wget https://www.python.org/ftp/python/3.10.18/Python-3.10.18.tgz
tar -xzf Python-3.10.18.tgz
cd Python-3.10.18
./configure --prefix=$HOME/python3.10 --enable-optimizations
make -j$(nproc)
sudo make install
Now create the venv environment:
python3.10 -m venv kdc_dev
source kdc_dev/bin/activate
Check and ensure correct installation:
python # Check Python version, confirm output is 3.10.xxx (usually 3.10.18)
# Example output:
# Python 3.10.18 (main, Jun 5 2025, 13:14:17) [GCC 11.2.0] on linux
# Type "help", "copyright", "credits" or "license" for more information.
# >>>
pip --version # Check pip version, confirm output shows pip for 3.10
# Example output: pip 25.1 from /path/to/your/env/python3.10/site-packages/pip (python 3.10)
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # If youre located within mainland China, it is recommended to change the source first to speed up download and installation
# There is no need for you to run this if otherwise!
pip install -r requirements_ilcode.txt # No ROS Noetic required, but only guarantees functionality of kuavo_train imitation learning training code. kuavo_data (data conversion) and kuavo_deploy (deployment code) both depend on ROS
# Or
pip install -r requirements_total.txt # Ensure ROS Noetic is installed first (recommended)
After installation, double-check the lerobot version: Should be Version 0.4.2 as of November 2025.
pip show lerobot
If not, reset the lerobot repository:
cd third_party/lerobot
git fetch
git reset --hard origin/main
cd ../../
Retry pip install -r requirement_xx.txt to retry installation.
If you encounter ffmpeg or torchcodec errors when running:
conda install ffmpeg==6.1.1
# Or
# pip uninstall torchcodec
Convert Kuavo native rosbag data to parquet format usable by the Lerobot framework:
python kuavo_data/CvtRosbag2Lerobot.py \
--config-path=../configs/data/ \
--config-name=KuavoRosbag2Lerobot.yaml \
rosbag.rosbag_dir=/path/to/rosbag \
rosbag.lerobot_dir=/path/to/lerobot_data
Description:
rosbag.rosbag_dir: Path to original rosbag datarosbag.lerobot_dir: Path to save converted lerobot-parquet data. A subfolder named lerobot is usually created in this directoryconfigs/data/KuavoRosbag2Lerobot.yaml: Please review and select cameras to enable and whether to use depth images as neededOr, you can set args in configs/data/KuavoRosbag2Lerobot.yaml
Use the converted data for imitation learning training:
python kuavo_train/train_policy.py \
--config-path=../configs/policy/ \
--config-name=diffusion_config.yaml \
task=your_task_name \
method=your_method_name \
root=/path/to/lerobot_data/lerobot \
training.batch_size=128 \
policy_name=diffusion
Description:
task: Custom task name (preferably corresponding to the task definition in data conversion), e.g., pick and placemethod: Custom method name, used to distinguish different training runs, e.g., diffusion_bs128_usedepth_nofuse, etc.root: Local path to training data. Note to include lerobot. Should correspond to the data conversion save path in step 1: /path/to/lerobot_data/lerobottraining.batch_size: Batch size, can be adjusted according to GPU memorypolicy_name: Policy to use, used for policy instantiation. Currently supports diffusion and actOr, you can set args in configs/policy/act_config/diffusion_config.yaml
Double-check installation of Accelerate: pip install accelerate (Usually automatically installed with Lerobot)
# Configure the accelerate yaml according to your machines specs
vim configs/accelerate/accelerate_config.yaml
# After configuration, try this example:
accelerate launch --config_file configs/accelerate/accelerate_config.yaml kuavo_train/train_policy_with_accelerate.py --config-path=../configs/policy --config-name=diffusion_config.yaml
After training is complete, you can start the Mujoco simulator and call the deployment code for evaluation:
a. Start Mujoco simulator: For details, see readme for simulator
b. Call deployment code
Configuration files are located in ./configs/deploy/:
kuavo_env.yaml: Kuavo robot execution environment configuration, with env_name as Kuavo-Sim. Change other parameters such as obs_key_map as needed.Please review the yaml file and modify the # inference configs related parameters (model loading), etc.
Start automated inference deployment:
python kuavo_deploy/eval_kuavo.py
Follow the instructions. Generally, Select 3 first, then provide the kuavo_env.yaml path (configs/deploy/kuavo_env.yaml). Finally, select "8. Auto-test model in simulation, execute eval_episodes times:". For details on this operation, see kuavo deploy
Same steps as part a in step 3, change the configuration file kuavo_env.yaml's env_name as Kuavo-Real.
PC deployment steps to be updated; For Orin deployment, please check: README_AGX_ORIN.md
The log during testing is located at log/kuavo_deploy/kuavo_deploy.log, please check thoroughly.
Simulation Environment:
| Topic Name | Description |
|---|---|
/cam_h/color/image_raw/compressed | Top camera RGB color image |
/cam_h/depth/image_raw/compressedDepth | Top camera depth image |
/cam_l/color/image_raw/compressed | Left camera RGB color image |
/cam_l/depth/image_rect_raw/compressedDepth | Left camera depth image |
/cam_r/color/image_raw/compressed | Right camera RGB color image |
/cam_r/depth/image_rect_raw/compressedDepth | Right camera depth image |
/gripper/command | Simulated rq2f85 gripper control command |
/gripper/state | Simulated rq2f85 gripper current state |
/joint_cmd | Control commands for all joints, including legs |
/kuavo_arm_traj | Robot arm trajectory control |
/sensors_data_raw | Raw data from all sensors |
Real Robot Environment:
| Topic Name | Description |
|---|---|
/cam_h/color/image_raw/compressed | Top camera RGB color image |
/cam_h/depth/image_raw/compressedDepth | Top camera depth image, realsense |
/cam_l/color/image_raw/compressed | Left camera RGB color image |
/cam_l/depth/image_rect_raw/compressedDepth | Left camera depth image, realsense |
/cam_r/color/image_raw/compressed | Right camera RGB color image |
/cam_r/depth/image_rect_raw/compressedDepth | Right camera depth image, realsense |
/control_robot_hand_position | Dexterous hand joint angle control command |
/dexhand/state | Dexterous hand current joint angle state |
/leju_claw_state | Leju claw current joint angle state |
/leju_claw_command | Leju claw joint angle control command |
/joint_cmd | Control commands for all joints, including legs |
/kuavo_arm_traj | Robot arm trajectory control |
/sensors_data_raw | Raw data from all sensors |
outputs/
βββ train/<task>/<method>/run_<timestamp>/ # Training models and parameters
βββ eval/<task>/<method>/run_<timestamp>/ # Test logs and videos
KUAVO_DATA_CHALLENGE/
βββ configs/ # Configuration files
βββ kuavo_data/ # Data processing and conversion module
βββ kuavo_deploy/ # Deployment scripts (simulator/real robot)
βββ kuavo_train/ # Imitation learning training code
βββ lerobot_patches/ # Lerobot runtime patches
βββ outputs/ # Models and results
βββ third_party/ # Lerobot dependencies
βββ requirements_xxx.txt # Dependency lists
βββ README.md # Documentation
lerobot_patchesThis directory contains compatibility patches for Lerobot, with main features including:
FeatureType to support RGB and Depth imagescompute_episode_stats and create_stats_buffers for statistical calculations of images and depth data, min, max, mean, std, etc.dataset_to_policy_features to ensure correct mapping of Kuavo RGB + Depth FeatureTypeIf you need to use Lerobot-based custom designs such as depth data, new FeatureTypes, normalization methods, etc., you can add them yourself. When using, import at the very beginning of the entry script (such as kuavo_train/train_policy.py and other training file code):
import lerobot_patches.custom_patches # Ensure custom patches are applied, DON'T REMOVE THIS LINE!
This project is extended based on Lerobot. Thanks to the HuggingFace team for developing the open-source robot learning framework, which provides an important foundation for this project.
75 commits
1 commits
Python
97.8%
Shell
1.9%
This repository is developed based on Lerobot, combined with Leju Kuavo robot, providing complete example code for data format conversion (rosbag β parquet), Imitation Learning (IL) training, simulator testing, and real robot deployment verification.
β οΈ Note: This repository does not yet support end-effector control; currently only joint angle control is available!
Ubuntu 20.04 + NVIDIA CUDA Toolkit + Docker is recommended.
sudo apt update
sudo apt upgrade -y
ubuntu-drivers devices
# Tested verfied version is 535, you can try newer versions (do not use server branch)
sudo apt install nvidia-driver-535
# Reboot the computer
sudo reboot
# Verify driver installation
nvidia-smi
When using nvidia-smi acceleration in Docker images, it is necessary to load the nvidia runtime library, therefore NVIDIA Container Toolkit needs to be installed.
sudo apt install curl
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1 && sudo apt-get install -y nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}
sudo apt update
sudo apt install git
sudo apt install docker.io
# Configure NVIDIA Runtime in Docker
nvidia-ctk
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
sudo docker info | grep -i runtime
# The output should include "nvidia" Runtime
Both Kuavo Mujoco simulation and real robot operation are based on the ROS Noetic environment. Since the real Kuavo robot uses Ubuntu 20.04 + ROS Noetic (non-docker), it is recommended to directly install ROS Noetic. If ROS Noetic cannot be installed due to a higher Ubuntu version, Docker can be used.
Installation example:
wget http://fishros.com/install -O fishros && . fishros
# Menu selection: 5 Configure system sources β 2 Change sources and clean third-party sources β 1 Add ROS sources
wget http://fishros.com/install -O fishros && . fishros
# Menu selection: 1 One-click installation β 2 Install without changing sources β Select ROS1 Noetic Desktop
Test ROS installation:
roscore # Open a new terminal
rosrun turtlesim turtlesim_node # Open a new terminal
rosrun turtlesim turtle_teleop_key # Open a new terminal
sudo vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://docker.imgdb.de",
"https://docker-0.unsee.tech",
"https://docker.hlmirror.com",
"https://docker.1ms.run",
"https://func.ink",
"https://lispy.org",
"https://docker.xiaogenban1993.com"
]
}
sudo systemctl daemon-reload && sudo systemctl restart docker
mkdir /path/to/save/docker/ros/image
cd /path/to/save/docker/ros/image
vim Dockerfile
Then write the following content in the Dockerfile:
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirrors.tuna.tsinghua.edu.cn/ubuntu/|g' /etc/apt/sources.list && \
sed -i 's|http://security.ubuntu.com/ubuntu/|http://mirrors.tuna.tsinghua.edu.cn/ubuntu/|g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y locales tzdata gnupg lsb-release
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
# Set ROS debian sources
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Add ROS keys
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# Install ROS Noetic
# Set keyboard layout to Chinese if necessary
RUN apt-get update && \
apt-get install -y keyboard-configuration apt-utils && \
echo 'keyboard-configuration keyboard-configuration/layoutcode string cn' | debconf-set-selections && \
echo 'keyboard-configuration keyboard-configuration/modelcode string pc105' | debconf-set-selections && \
echo 'keyboard-configuration keyboard-configuration/variant string ' | debconf-set-selections && \
apt-get install -y ros-noetic-desktop-full && \
apt-get install -y python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential && \
rm -rf /var/lib/apt/lists/*
# Initialize rosdep
RUN rosdep init
After writing, save and exit. Build the Ubuntu 20.04 + ROS Noetic image:
sudo docker build -t ubt2004_ros_noetic .
After the build is complete, enter the image. For the first time starting the container and loading the image:
sudo docker run -it --name ubuntu_ros_container ubt2004_ros_noetic /bin/bash
# Or GPU launch (recommended)
sudo docker run -it --gpus all --runtime nvidia --name ubuntu_ros_container ubt2004_ros_noetic /bin/bash
# Optional, mount local directory paths, etc.
# sudo docker run -it --gpus all --runtime nvidia --name ubuntu_ros_container -v /path/to/your/code:/root/code ubt2004_ros_noetic /bin/bash
For subsequent launches:
sudo docker start ubuntu_ros_container
sudo docker exec -it ubuntu_ros_container /bin/bash
After entering the image, initialize the ROS environment variables, then start roscore:
source /opt/ros/noetic/setup.bash
roscore
If everything is correct, the Docker configuration for Ubuntu 20.04 + ROS Noetic is complete.
# SSH
git clone --depth=1 https://github.com/LejuRobotics/kuavo_data_challenge.git
# Or
# HTTPS
git clone --depth=1 https://github.com/LejuRobotics/kuavo_data_challenge.git
Update the lerobot submodule under third_party:
cd kuavo_data_challenge
git submodule init
git submodule update --recursive
conda create -n kdc_icra python=3.10
conda activate kdc_icra
Install python3.10 first, then use venv to create a virtual environment:
β οΈ Warning: ppa:deadsnakes no longer provide packages for ubuntu20.04 after June 2025, the following installation method may not work anymore:
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install -y python3.10 python3.10-venv python3.10-dev
You may need to build from source as follows:
sudo apt update
sudo apt install -y build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-devlibreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev uuid-dev wget
wget https://www.python.org/ftp/python/3.10.18/Python-3.10.18.tgz
tar -xzf Python-3.10.18.tgz
cd Python-3.10.18
./configure --prefix=$HOME/python3.10 --enable-optimizations
make -j$(nproc)
sudo make install
Now create the venv environment:
python3.10 -m venv kdc_dev
source kdc_dev/bin/activate
Check and ensure correct installation:
python # Check Python version, confirm output is 3.10.xxx (usually 3.10.18)
# Example output:
# Python 3.10.18 (main, Jun 5 2025, 13:14:17) [GCC 11.2.0] on linux
# Type "help", "copyright", "credits" or "license" for more information.
# >>>
pip --version # Check pip version, confirm output shows pip for 3.10
# Example output: pip 25.1 from /path/to/your/env/python3.10/site-packages/pip (python 3.10)
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # If youre located within mainland China, it is recommended to change the source first to speed up download and installation
# There is no need for you to run this if otherwise!
pip install -r requirements_ilcode.txt # No ROS Noetic required, but only guarantees functionality of kuavo_train imitation learning training code. kuavo_data (data conversion) and kuavo_deploy (deployment code) both depend on ROS
# Or
pip install -r requirements_total.txt # Ensure ROS Noetic is installed first (recommended)
After installation, double-check the lerobot version: Should be Version 0.4.2 as of November 2025.
pip show lerobot
If not, reset the lerobot repository:
cd third_party/lerobot
git fetch
git reset --hard origin/main
cd ../../
Retry pip install -r requirement_xx.txt to retry installation.
If you encounter ffmpeg or torchcodec errors when running:
conda install ffmpeg==6.1.1
# Or
# pip uninstall torchcodec
Convert Kuavo native rosbag data to parquet format usable by the Lerobot framework:
python kuavo_data/CvtRosbag2Lerobot.py \
--config-path=../configs/data/ \
--config-name=KuavoRosbag2Lerobot.yaml \
rosbag.rosbag_dir=/path/to/rosbag \
rosbag.lerobot_dir=/path/to/lerobot_data
Description:
rosbag.rosbag_dir: Path to original rosbag datarosbag.lerobot_dir: Path to save converted lerobot-parquet data. A subfolder named lerobot is usually created in this directoryconfigs/data/KuavoRosbag2Lerobot.yaml: Please review and select cameras to enable and whether to use depth images as neededOr, you can set args in configs/data/KuavoRosbag2Lerobot.yaml
Use the converted data for imitation learning training:
python kuavo_train/train_policy.py \
--config-path=../configs/policy/ \
--config-name=diffusion_config.yaml \
task=your_task_name \
method=your_method_name \
root=/path/to/lerobot_data/lerobot \
training.batch_size=128 \
policy_name=diffusion
Description:
task: Custom task name (preferably corresponding to the task definition in data conversion), e.g., pick and placemethod: Custom method name, used to distinguish different training runs, e.g., diffusion_bs128_usedepth_nofuse, etc.root: Local path to training data. Note to include lerobot. Should correspond to the data conversion save path in step 1: /path/to/lerobot_data/lerobottraining.batch_size: Batch size, can be adjusted according to GPU memorypolicy_name: Policy to use, used for policy instantiation. Currently supports diffusion and actOr, you can set args in configs/policy/act_config/diffusion_config.yaml
Double-check installation of Accelerate: pip install accelerate (Usually automatically installed with Lerobot)
# Configure the accelerate yaml according to your machines specs
vim configs/accelerate/accelerate_config.yaml
# After configuration, try this example:
accelerate launch --config_file configs/accelerate/accelerate_config.yaml kuavo_train/train_policy_with_accelerate.py --config-path=../configs/policy --config-name=diffusion_config.yaml
After training is complete, you can start the Mujoco simulator and call the deployment code for evaluation:
a. Start Mujoco simulator: For details, see readme for simulator
b. Call deployment code
Configuration files are located in ./configs/deploy/:
kuavo_env.yaml: Kuavo robot execution environment configuration, with env_name as Kuavo-Sim. Change other parameters such as obs_key_map as needed.Please review the yaml file and modify the # inference configs related parameters (model loading), etc.
Start automated inference deployment:
python kuavo_deploy/eval_kuavo.py
Follow the instructions. Generally, Select 3 first, then provide the kuavo_env.yaml path (configs/deploy/kuavo_env.yaml). Finally, select "8. Auto-test model in simulation, execute eval_episodes times:". For details on this operation, see kuavo deploy
Same steps as part a in step 3, change the configuration file kuavo_env.yaml's env_name as Kuavo-Real.
PC deployment steps to be updated; For Orin deployment, please check: README_AGX_ORIN.md
The log during testing is located at log/kuavo_deploy/kuavo_deploy.log, please check thoroughly.
Simulation Environment:
| Topic Name | Description |
|---|---|
/cam_h/color/image_raw/compressed | Top camera RGB color image |
/cam_h/depth/image_raw/compressedDepth | Top camera depth image |
/cam_l/color/image_raw/compressed | Left camera RGB color image |
/cam_l/depth/image_rect_raw/compressedDepth | Left camera depth image |
/cam_r/color/image_raw/compressed | Right camera RGB color image |
/cam_r/depth/image_rect_raw/compressedDepth | Right camera depth image |
/gripper/command | Simulated rq2f85 gripper control command |
/gripper/state | Simulated rq2f85 gripper current state |
/joint_cmd | Control commands for all joints, including legs |
/kuavo_arm_traj | Robot arm trajectory control |
/sensors_data_raw | Raw data from all sensors |
Real Robot Environment:
| Topic Name | Description |
|---|---|
/cam_h/color/image_raw/compressed | Top camera RGB color image |
/cam_h/depth/image_raw/compressedDepth | Top camera depth image, realsense |
/cam_l/color/image_raw/compressed | Left camera RGB color image |
/cam_l/depth/image_rect_raw/compressedDepth | Left camera depth image, realsense |
/cam_r/color/image_raw/compressed | Right camera RGB color image |
/cam_r/depth/image_rect_raw/compressedDepth | Right camera depth image, realsense |
/control_robot_hand_position | Dexterous hand joint angle control command |
/dexhand/state | Dexterous hand current joint angle state |
/leju_claw_state | Leju claw current joint angle state |
/leju_claw_command | Leju claw joint angle control command |
/joint_cmd | Control commands for all joints, including legs |
/kuavo_arm_traj | Robot arm trajectory control |
/sensors_data_raw | Raw data from all sensors |
outputs/
βββ train/<task>/<method>/run_<timestamp>/ # Training models and parameters
βββ eval/<task>/<method>/run_<timestamp>/ # Test logs and videos
KUAVO_DATA_CHALLENGE/
βββ configs/ # Configuration files
βββ kuavo_data/ # Data processing and conversion module
βββ kuavo_deploy/ # Deployment scripts (simulator/real robot)
βββ kuavo_train/ # Imitation learning training code
βββ lerobot_patches/ # Lerobot runtime patches
βββ outputs/ # Models and results
βββ third_party/ # Lerobot dependencies
βββ requirements_xxx.txt # Dependency lists
βββ README.md # Documentation
lerobot_patchesThis directory contains compatibility patches for Lerobot, with main features including:
FeatureType to support RGB and Depth imagescompute_episode_stats and create_stats_buffers for statistical calculations of images and depth data, min, max, mean, std, etc.dataset_to_policy_features to ensure correct mapping of Kuavo RGB + Depth FeatureTypeIf you need to use Lerobot-based custom designs such as depth data, new FeatureTypes, normalization methods, etc., you can add them yourself. When using, import at the very beginning of the entry script (such as kuavo_train/train_policy.py and other training file code):
import lerobot_patches.custom_patches # Ensure custom patches are applied, DON'T REMOVE THIS LINE!
This project is extended based on Lerobot. Thanks to the HuggingFace team for developing the open-source robot learning framework, which provides an important foundation for this project.
75 commits
1 commits
Python
97.8%
Shell
1.9%