Kuavo Docs
Feature ExamplesResearch FrameworksImitation Learning Examples

🧠 Embodied Intelligence Data Processing and Model Training Framework

📝 Case Overview

This is an embodied intelligence data processing and model training framework based on the Kuafu robot, supporting Kuavo 4pro & Kuavo 5 & Kuavo 5W.

Kuavo 4pro Mojito PreparationKuavo 5 Fruit and Vegetable Sorting
Mojito PreparationFruit and Vegetable Sorting

This case describes how to use the Leju Data Collection Platform to collect data, configure the server and real-robot environment with the kuavo_data_challenge repository, perform data format conversion, model training, and real-robot deployment and inference on Kuavo 4pro & Kuavo 5 & Kuavo 5W. It also implements the Kuavo 4pro Mojito preparation scenario and the Kuavo 5 fruit and vegetable sorting scenario with the Leju Kuafu robot.

🗺️ Framework Diagram

Framework Diagram

🔧 Hardware Configuration

  • Robot platform: Kuavo 4pro & Kuavo 5 & Kuavo 5W
  • VR device: Quest3
  • Router: Xiaomi BE6500 Pro WiFi7 * 1
  • USB-to-Ethernet adapter: Lvneng USB3.0 Gigabit Wired Network Card * 1
  • Type-C-to-Ethernet adapter: UGREEN Type-C to RJ45 Ethernet Adapter * 1
  • Ethernet cable: 2m Gigabit Ethernet Cable * 2
  • Computing server:
    • GPU: NVIDIA GeForce RTX 4090 D 24G
    • CPU: Intel i9-14900KF
    • Memory: 64G
    • Storage: 2TB

The router, USB-to-Ethernet adapter, and Type-C-to-Ethernet adapter can also be replaced by other models that are recognized normally.

🧩 Software Environment

  • Computing server: Ubuntu 20.04 + ROS noetic + NVIDIA CUDA Toolkit
  • Lower-level controller kuavo-ros-opensource repository version: tag 1.3.3
  • Imitation learning kuavo_data_challenge repository branch: research_scenario
  • kuavo-humanoid-sdk SDK version: 1.3.3
  • lerobot version: 0.4.2

🤖 Full Robot Imitation Learning Workflow

🔧 Environment Setup

🤖 KUAVO-DATA-CHALLENGE is a complete robot imitation learning framework built on LeRobot and designed specifically for the Kuavo humanoid robot. The framework provides a complete toolchain covering data conversion, model training, and real-robot deployment.

For more usage instructions, dataset specifications, and policy introductions, please visit 📖 Kuavo Data Challenge Official Documentation Site

🎯 Core Features:

  • 🔄 Data Conversion: Supports conversion from ROS bag to LeRobot parquet format
  • 🚀 One-Click Training: IL model training framework (diffusion policy, ACT)
  • 🎮 Real-Time Deployment: Supports real-time inference and control of trained models on the actual robot

♻️ Environment Requirements

  • OS: Ubuntu 20.04 recommended (for 22.04 / 24.04, running in a Docker container is recommended)
  • Python: Python 3.10 recommended
  • ROS: ROS Noetic + Kuavo Robot ROS patch (installation inside Docker is supported)
  • Dependencies: Docker, NVIDIA CUDA Toolkit (if GPU acceleration is required)

🔔 Storage space under the / directory is limited; it is recommended to perform the following operations in the /media/data directory

📦 Installation Guide

1. Operating System Environment Setup

Ubuntu 20.04 + ROS noetic + NVIDIA CUDA Toolkit + Docker is recommended.

Detailed steps (expand to view), for reference only
a. Install the Operating System and NVIDIA Driver
sudo apt update
sudo apt upgrade -y
ubuntu-drivers devices
# 测试通过版本为 535,可尝试更新版本(请勿使用 server 分支)
sudo apt install nvidia-driver-535
# 重启计算机
sudo reboot
# 验证驱动
nvidia-smi
b. Install NVIDIA Container Toolkit
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
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}
c. Install Docker
sudo apt update
sudo apt install git
sudo apt install docker.io
# 配置 NVIDIA Runtime
nvidia-ctk
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
sudo docker info | grep -i runtime
# 输出中应包含 "nvidia" Runtime

2. ROS Environment Setup

Since the real Kuavo robot runs Ubuntu 20.04 + ROS Noetic (not Docker), installing ROS Noetic directly is recommended. If ROS Noetic cannot be installed because the Ubuntu version is too new, Docker can be used.

a. Install ROS Noetic directly on the system (recommended) (expand to view), for reference only

Installation example:

wget http://fishros.com/install -O fishros && . fishros
# 菜单选择:5 配置系统源 → 2 更换源并清理第三方源 → 1 添加ROS源
wget http://fishros.com/install -O fishros && . fishros
# 菜单选择:1 一键安装 → 2 不更换源安装 → 选择 ROS1 Noetic 桌面版

Test the ROS installation:

roscore  # 新建终端
rosrun turtlesim turtlesim_node  # 新建终端
rosrun turtlesim turtle_teleop_key  # 新建终端
b. Install ROS Noetic using Docker (expand to view), for reference only
  • First, it is best to switch to a different mirror:
sudo vim /etc/docker/daemon.json
  • Then add some registry mirrors to this JSON file:
{
    "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"
    ]
}
  • Then save the file and exit, and restart the Docker service:
sudo systemctl daemon-reload && sudo systemctl restart docker
  • Now start creating the image. First, create a Dockerfile:
mkdir /path/to/save/docker/ros/image
cd /path/to/save/docker/ros/image
vim Dockerfile

Then write the following content into 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

# 设置ROS的debian源
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

# 添加ROS的Keys
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

# 安装ROS Noetic
# 设置键盘布局为 Chinese
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/*

# 初始化rosdep
RUN rosdep init

Save and exit once you have finished writing.

  • Build the Ubuntu 20.04 + ROS Noetic image:
sudo docker build -t ubt2004_ros_noetic .
  • Once the build is complete, simply enter the image. Start the container and load the image for the first time:
sudo docker run -it --name ubuntu_ros_container ubt2004_ros_noetic /bin/bash
# 或 GPU 启动(推荐)
sudo docker run -it --gpus all --runtime nvidia --name ubuntu_ros_container ubt2004_ros_noetic /bin/bash
# 可选,挂载本地目录路径等
# 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 each subsequent start:

sudo docker start ubuntu_ros_container
sudo docker exec -it ubuntu_ros_container /bin/bash
  • Alternatively: use a custom startup script, launch_docker.sh. Note that since this involves mounting the Python environment, please complete step 4 before using this sh approach!
#!/bin/bash

# Paths
CODE_DIR=/path/to/code
PYTHON_DIR=/path/to/python_env
DATA_DIR=/path/to/data
IMAGE=ros:noetic
CONTAINER=ros_noetic

# Create container if it doesn't exist
if ! docker ps | grep -q "$CONTAINER"; then
    echo "🛠  Creating container $CONTAINER ..."
    docker create --name=$CONTAINER $IMAGE
fi

# Run container with mounts and environment
echo "🚀 Starting container $CONTAINER ..."
docker run \
    -i -t \
    -v $CODE_DIR:/code \
    -v $DATA_DIR:/data \
    -v $PYTHON_DIR:$PYTHON_DIR \
    --env PATH=/path/to/python_venv/kdc_dev/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    $CONTAINER /bin/bash
  • After entering the image, initialize the ROS environment variables and then start roscore
source /opt/ros/noetic/setup.bash
roscore

If there are no errors, the Docker configuration for Ubuntu 20.04 + ROS Noetic is complete.

⚠️ Warning: If ROS is running in a Docker environment as described above, the subsequent code below may need to be run inside the container. If you encounter problems, please check whether you are currently inside the container!


3. Clone the Code

# SSH
git clone git@github.com:LejuRobotics/kuavo_data_challenge.git
# 或者
# HTTPS
git clone https://github.com/LejuRobotics/kuavo_data_challenge.git

cd kuavo-data-challenge
# 切换分支
git checkout research_scenario

# 更新third_party下的lerobot子模块:
git submodule init
git submodule update --recursive --progress
cd third_party/lerobot/
git reset --hard 0f551df8f4bad4c504e395ea3df74fc5f714016f # 切换 0.4.2 commit

4. Python Environment Setup

Create a virtual environment named kdc_dev (Python 3.10) using conda (recommended) or python venv:
  • Anaconda configuration:
conda create -n kdc_dev python=3.10
conda activate kdc_dev
  • Or, install Python 3.10.18 from source, then create a virtual environment with venv

⚠️ Note: ppa:deadsnakes is no longer available on Ubuntu 20.04 after June 2025, so the following installation method may not succeed:

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 can give it a try; if it doesn't work, please install from source:

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

Then create the venv environment:

python3.10 -m venv kdc_dev
source kdc_dev/bin/activate

Check and make sure the installation is correct:

python  # Check the Python version; the output should be 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 the pip version; the output should be pip for Python 3.10
# Example output: pip 25.1 from /path/to/your/env/python3.10/site-packages/pip (python 3.10)

5. Install dependencies:

source /opt/ros/noetic/setup.bash  # Source the Python libraries bundled with ROS before entering the Python environment; it is recommended to add this line to ~/.bashrc

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple  # It is recommended to switch the package index first to speed up downloads and installation

# Compute server
pip install -r requirements_ilcode.txt   # ROS Noetic is not required, but only the kuavo_train imitation learning training code can be used; kuavo_data (data conversion) and kuavo_deploy (deployment code) both depend on ROS
# Or
pip install -r requirements_total.txt    # ROS Noetic must be installed (recommended)

# Robot onboard computer AGX Orin
pip install -r requirements_total_agxorin.txt    # ROS Noetic must be installed (recommended)

After installation, print and check the lerobot version: it was version 0.4.2 as of November 20, 2025

pip show lerobot

If it is not 0.4.2:

cd third_party/lerobot
git fetch
git reset --hard 0f551df8f4bad4c504e395ea3df74fc5f714016f
cd ../../

Then run pip install -r requirements again.

If pip installation is complete but an ffmpeg or torchcodec error occurs when running the training code:

conda install ffmpeg==6.1.1

# Or

# pip uninstall torchcodec

📦 Data Collection

  • ⚠️⚠️⚠️ Note: The lower-level controller code uses kuavo-ros-opensource with tag 1.3.3 kuavo-ros-opensource · Gitee
    ⚠️⚠️⚠️ Note: Before collection, perform head and hand zero-point calibration on the robot and mark the zero positions (with the arms straightened normally, and the head positioned so that the camera can see the full scene during collection) to ensure the robot zero points are consistent between collection and deployment. The head and arm zero points will affect the model deployment performance.

Chapter Introduction

Data collection records the robot's behavior over a period of time based on ROS to generate a RosBag package, which can be regarded as raw data. What is provided for model training is data that needs to be converted, so in addition to the most basic data collection function, this data collection system also provides a data processing function. At the same time, given differences in robot end effectors and resource storage paths, this data collection system provides flexible parameter configuration.

🚀 Leju Data Collection Platform

Leju Data Collection Management Platform is a SaaS service platform built specifically for the embodied intelligence field. It provides data collection, annotation, review, storage, management, and visualization functions to better help users manage and analyze data efficiently. Leju Data Collection Platform Leju Data Collection Platform 2

1. Confirm the environment

Confirm that the kuavo_data_pilot workspace exists under the AGX home directory /home/leju_kuavo on the onboard computer. The directory structure is as follows:

kuavo_data_pilot/
├── src/                      # Core function modules
│   ├── kuavo_data_pilot_bin  # Camera startup scripts and Gradio platform
│   ├── kuavo_msgs/           # Message dependencies
│   ├── manipulation_nodes/   # Data collection platform dependencies
│   ├── OrbbecSDK_ROS1/       # Orbbec camera package
│   └── realsense-ros/        # realsense camera package
└── ...

2. Device management

Follow Leju Data Collection Platform User Manual - Device Management

  • ① Configure the robot: Fill in the onboard computer IP address, click the refresh button to the right of the MAC address to automatically obtain the MAC address of the onboard computer's wireless network card
  • ② Configure NAS (if any)

3. Add a collection task

Follow Leju Data Collection Platform User Manual - Task Configuration and Leju Data Collection Platform User Manual - Business Workflow to configure the scene and add a collection task.

4. Configure wrist cameras

  1. On the AGX terminal of the onboard computer, run rs-enumerate-devices to view the Device info/Serial Number of the left and right wrist cameras
  2. Run sudo vim /etc/kuavo.conf in the terminal and enter the device numbers you found into CAMERA_LEFT=,CAMERA_RIGHT=
  3. Run the following in the terminal:
sudo systemctl start start_camera.service
  1. Open another terminal and run rqt_image_view to check whether the images on the topics corresponding to cam_h cam_l cam_r are correct. If the left and right wrist camera images are swapped, go back to step 2 and swap the device numbers
  2. Once the camera settings are confirmed correct, you can optionally set the camera service to start automatically on boot:
sudo systemctl enable start_webserver.service 

5. Connect to the data collection platform

Run the following in the onboard computer terminal

sudo systemctl start start_webserver.service # Start the websocket connection service
sudo journalctl -u start_webserver.service -f # View the service running log; the first startup of the service will first install a series of dependencies and update the deb version
sudo systemctl enable start_webserver.service # Once confirmed normal, you can optionally set the service to start automatically on boot
  • At this point, when you enter data collection, the status of the configured robot device will change from Offline to Idle. Click Idle, and the interface will display the images from the robot's three cameras, and the status changes from Idle to Busy.
  • In the future, when starting the robot, if the onboard computer IP remains unchanged, you can directly connect to the robot upon entering the data collection platform.

6. Start robot VR teleoperation

# Run on the lower-level controller
cd kuavo-ros-opensource
sudo su
source devel/setup.bash
roslaunch noitom_hi5_hand_udp_python launch_quest3_ik.launch \
    ip_address:=your_quest_ip \
    use_cpp_incremental_ik:=true \
    use_incremental_hand_orientation:=false
  • After the VR program starts, click Start Collection to begin the data collection task.
  • For the subsequent data annotation, review, and export work, simply follow the Leju Data Collection Platform User Manual.
  • After the data collection task is completed, you can collect one more go_bag.bag, which is used during model deployment inference to control the robot arm to reach the work start position.

📨 kuavo_data_challenge Usage

🌐 LET Open-Source Dataset

The LET dataset is collected based on the full-size humanoid robot Kuavo and covers real-world multi-task data across multiple scenarios and operation types. It targets robot manipulation, mobility, and interaction tasks, and supports scalable robot learning in real environments.

Dataset link: LET Full-Size Humanoid Robot Real-World Dataset LET Open-Source Dataset

1. Data Format Conversion

Detailed steps - ⚠️⚠️⚠️ If you export the lerobot-format dataset directly from the data collection platform, you can skip this step.

Dataset sources

  • Download the rosbag dataset from the LET open-source dataset
  • Use the gym tool to download the rosbag dataset from the data collection platform cloud. See gym Tool Usage Instructions.

Convert native Kuavo rosbag data into the parquet format usable by the Lerobot framework:

##### Kuavo 5
python kuavo_data/CvtRosbag2Lerobot.py \
  --config-path=../configs/data/ \
  --config-name=KuavoRosbag2Lerobot_kuavo5.yaml \
  rosbag.rosbag_dir=/path/to/rosbag \
  rosbag.lerobot_dir=/path/to/lerobot_data

##### Kuavo 4pro
python kuavo_data/CvtRosbag2Lerobot.py \
  --config-path=../configs/data/ \
  --config-name=KuavoRosbag2Lerobot_kuavo4pro.yaml \
  rosbag.rosbag_dir=/path/to/rosbag \
  rosbag.lerobot_dir=/path/to/lerobot_data

Notes:

  • rosbag.rosbag_dir: path to the raw rosbag data
  • rosbag.lerobot_dir: save path for the converted lerobot-parquet data; usually a subfolder named lerobot is created under this directory
  • configs/data/KuavoRosbag2Lerobot.yaml: configuration file

Configuration file

Configure using KuavoRosbag2Lerobot.yaml. Key configuration items:

ParameterDescriptionExample value
eef_typeEnd effector type; options: leju_claw, qiangnaoqiangnao
which_armWhich arm's joint + image data is needed; options: left, right, bothboth
use_depthWhether depth image data is neededtrue
task_descriptionTask description, user-defined"Pick and Place"
train_hzSampling frequency of the training data10
resize/widthResize width of the main camera image848

2. Imitation Learning Training

Detailed steps

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=32 \
  policy_name=diffusion

Notes:

  • --config-name: configuration file; for policy_name, fill in diffusion_config.yaml or act_config.yaml
  • task: user-defined task name (preferably corresponding to the task defined in data conversion), e.g. pick and place
  • method: user-defined method name used to distinguish different training runs, e.g. diffusion_bs128_usedepth_nofuse
  • root: local path to the training data; be sure to append lerobot, matching the save path in step 1: /path/to/lerobot_data/lerobot
  • training.batch_size: batch size, adjustable according to GPU memory
  • policy_name: the policy to use, used to instantiate the policy; currently diffusion and act are supported
  • For other parameters, see the yaml file description. It is recommended to modify the yaml file directly to avoid command-line input errors

Configuration file

Configure using diffusion_config.yaml or act_config.yaml. Key configuration items:

ParameterDescriptionExample value
max_epochMaximum number of training epochs500
save_freq_epochModel parameter save frequency10
deviceTraining devicecuda
resumeWhether to enable resume training from a checkpointfalse
resume_timestampResume training by loading the last epoch's parameters from outputs/train/<task>/<method>/<resume_timestamp>run_20251118_144927

2.1 Imitation Learning Training: Single-Machine Multi-GPU Mode

Install the accelerate library: pip install accelerate (it is usually already installed when you install lerobot)


accelerate launch kuavo_train/train_policy_with_accelerate.py \
  --config_file configs/accelerate/accelerate_config.yaml \
  --config-path=../configs/policy \
  --config-name=diffusion_config.yaml

Notes:

  • --config-name: configuration file; for the corresponding policy_name, enter diffusion_config.yaml or act_config.yaml. For parameter configuration, refer to the detailed parameter description in 2. Imitation Learning Training above.

Configuration File

Configuration is done using accelerate_config.yaml. Key configuration items:

ParameterDescriptionExample Value
num_processesNumber of processes used in this instance (corresponds to the number of GPUs)2
gpu_idsSpecifies which GPU to use (by index)"0,1"

3. Real-Robot Model Deployment

Detailed Steps

After training is complete, call the model for real-robot deployment: Modify the configuration file kuavo_env.yaml, set env_name to Kuavo-Real, and modify other items such as eef_type and obs_key_map as needed, then you can deploy and test on the real robot.

Configuration File

Key configuration items:

ParameterDescriptionExample Value
env_nameName of the kuavo environmentKuavo-Real
eef_typeEnd effector type, options: leju_claw, qiangnaoqiangnao
which_armWhich arm's joint + image data is needed, options: left, right, bothright
head_initInitial position of the robot headnull
ros_rateInference control frequency10
image_sizeMain camera image size: width, height&IMGSIZE [848, 480]
frame_alignmentWhether to enable frame alignmenttrue
go_bag_pathBag for reaching the working position/path/to/your/go.bag
policy_typePolicy name"act"
deviceInference devicecuda
taskTask name"your_task"
methodMethod name"your_method"
timestampTimestamp"your_timestamp"
epochTraining output epoch; can be 50, 100, best, etc.best
max_episode_stepsMaximum episode steps200

⚠️ Note:

  1. Model deployment The parameters in the configuration file must be consistent with the parameters in Data Format Conversion or Data Collection Platform Export
  2. The code loads the policy model parameters from outputs/train/<task>/<method>/<timestamp>/epoch<epoch>

3.1 Hardware Startup

After the robot is standing normally, call the /enable_wbc_arm_trajectory_control ROS service to enable WBC (Whole Body Control) arm trajectory control, and set the control mode to 1 (automatic arm-swing mode):

rosservice call /enable_wbc_arm_trajectory_control "control_mode: 1"

3.2 Real-Robot Inference Deployment Script

  • Start the real-robot inference deployment script:
    python kuavo_deploy/eval_kuavo.py

The command line displays a prompt:

=== Kuavo Robot Control Example ===
This script demonstrates how to control different tasks using command line arguments
-e Supports pause, resume, and stop functions

  📋 Control function description:
  🔄 Pause/Resume: send SIGUSR1 signal (kill -USR1 <PID>)
  ⏹️  Stop task: send SIGUSR2 signal (kill -USR2 <PID>)
  📊 View logs: tail -f log/kuavo_deploy/kuavo_deploy.log

1. Show help information:
python kuavo_deploy/src/scripts/script.py --help

2. Dry-run mode - see what operations will be performed:
python kuavo_deploy/src/scripts/script.py --task go --dry_run --config /path/to/custom_config.yaml

3. Reach the working position:
python kuavo_deploy/src/scripts/script.py --task go --config /path/to/custom_config.yaml

4. Run the model directly from the current position:
python kuavo_deploy/src/scripts/script.py --task run --config /path/to/custom_config.yaml

5. Interpolate to the last frame state of the bag and start running:
python kuavo_deploy/src/scripts/script.py --task go_run --config /path/to/custom_config.yaml

6. Start running from the last frame state of go_bag:
python kuavo_deploy/src/scripts/script.py --task here_run --config /path/to/custom_config.yaml

7. Return to zero position:
python kuavo_deploy/src/scripts/script.py --task back_to_zero --config /path/to/custom_config.yaml

8. Automatically test the model in simulation, execute eval_episodes times:
python kuavo_deploy/src/scripts/script_auto_test.py --task auto_test --config /path/to/custom_config.yaml

9. Enable verbose output:
python kuavo_deploy/src/scripts/script.py --task go --verbose --config /path/to/custom_config.yaml

=== Task description ===
go          - first interpolate to the first frame of the bag, then replay the bag to move to the working position
run         - run the model directly from the current position
go_run      - reach the working position and run the model directly
here_run    - interpolate to the last frame state of the bag and start running
back_to_zero - after interrupting model inference, play the bag backwards to return to the zero position
auto_test   - automatically test the model in simulation, execute eval_episodes times

Please select the example to execute: 1. Show normal test help information 2. Show auto-test help information 3. Further select an example
1. Execute: python kuavo_deploy/src/scripts/script.py --help
2. Execute: python kuavo_deploy/src/scripts/script_auto_test.py --help
3. Further select an example
Please select the example to execute (1-3) or press Enter to exit:

Enter 3 on the command line and press Enter, and a prompt appears:

Please enter the custom configuration file path:

Enter the custom configuration file path. For the default configuration file, refer to configs/deploy/kuavo_env_kuavo4pro.yaml; if it is the 5th generation, enter the path configs/deploy/kuavo_env_kuavo5.yaml, and a prompt appears:

📁 Configuration file path: configs/deploy/kuavo_env.yaml
🔍 Parsing configuration file...
📋 Model configuration information:
   Task: your_task
   Method: your_methof
   Timestamp: your_timestamp
   Epoch: 300
📂 Full model path: your_path
✅ Model path exists
The examples available for execution are as follows:
1. First interpolate to the first frame of the bag, then replay the bag to move to the working position (dry-run mode)
Execute: python kuavo_deploy/src/scripts/script.py --task go --dry_run --config /path/to/config.yaml
2. First interpolate to the first frame of the bag, then replay the bag to move to the working position
Execute: python kuavo_deploy/src/scripts/script.py --task go --config /path/to/config.yaml
3. Run the model directly from the current position
Execute: python kuavo_deploy/src/scripts/script.py --task run --config /path/to/config.yaml
4. Reach the working position and run the model directly
Execute: python kuavo_deploy/src/scripts/script.py --task go_run --config /path/to/config.yaml
5. Interpolate to the last frame state of the bag and start running
Execute: python kuavo_deploy/src/scripts/script.py --task here_run --config /path/to/config.yaml
6. Return to zero position
Execute: python kuavo_deploy/src/scripts/script.py --task back_to_zero --config /path/to/config.yaml
7. First interpolate to the first frame of the bag, then replay the bag to move to the working position (verbose output enabled)
Execute: python kuavo_deploy/src/scripts/script.py --task go --verbose --config /path/to/config.yaml
8. Automatically test the model in simulation, execute eval_episodes times
Execute: python kuavo_deploy/src/scripts/script_auto_test.py --task auto_test --config /path/to/config.yaml
9. Exit
Please select the example to execute (1-9)
  • Select the desired function. Generally, first enter 2 to move to the working position, then enter 3 to start the real-robot synchronous inference program; press p to pause inference, and s / ctrl+c to stop inference.

3.3 Real-Robot Asynchronous Inference

The steps are the same as 3.2 Real-Robot Inference Deployment Script. After entering 2 to move to the working position, execute the following real-robot asynchronous inference program:

##### Kuavo 4pro
python kuavo_deploy/eval_kuavo_async_no_lock_kuavo4pro.py --kuavo-config-path /your_working_dir/configs/data/KuavoRosbag2Lerobot_kuavo4pro.yaml --device=cuda --fps=10 --task="tiaojiu" --duration=300

##### Kuavo 5
python kuavo_deploy/eval_kuavo_async_no_lock_kuavo5.py --kuavo-config-path /your_working_dir/configs/data/KuavoRosbag2Lerobot_kuavo5.yaml --device=cuda --fps=10 --task="pick fruit" --duration=300

⚠️⚠️⚠️ Be careful when running for the first time. Move objects away from the robot first, and observe whether reaching the working position and running the model are normal and as expected

4. Inference Performance Tuning

Detailed Steps
  • Taking the ACT algorithm as an example

4.1 Synchronous Inference

Before fetching an action each time, the ACT policy decides according to the configuration "whether to use the whole chunk or only the first few steps" and "whether to perform temporal ensembling". The following parameters are configured under policy in configs/policy/act_config.yaml and affect smoothness, real-time performance, and inference frequency.

ParameterLocation (Configuration)Typical Value / DefaultDescription
temporal_ensemble_coeffpolicy.temporal_ensemble_coeffNone, or 0.01 / -0.1, etc.When not None, temporal ensembling is enabled: the whole chunk is inferred at every step, and an exponentially weighted average is taken over the multi-step predictions before outputting the action for the current step. A coefficient greater than 0 (e.g. 0.01) favors older actions and is smoother; less than 0 (e.g. -0.1) favors newer actions and tracks the current observation more closely. When enabled, n_action_steps must be 1, and inference runs at every step, which is computationally expensive.
n_action_stepspolicy.n_action_steps1, or 1 to chunk_sizeThe number of steps actually taken from the chunk after each inference: the first n_action_steps steps are enqueued and executed step by step; when the queue is empty, inference runs again. The smaller the value (e.g. 1–10), the more frequent the inference, the more the actions track the observation, and the better the real-time performance, but the compute cost and latency increase; the larger the value (e.g. 50–100), the less frequent the inference, the smoother the motion, and the less noticeable the latency, but the slower the response to sudden changes.
  • Implementation and constraints: the logic is in ACTPolicy.select_action() in third_party/lerobot/src/lerobot/policies/act/modeling_act.py

4.2 Asynchronous Inference

Asynchronous inference (eval_kuavo_async_no_lock_kuavo.py) decouples inference from execution through an action buffer + inference thread + execution thread, affecting smoothness, real-time performance, inference frequency, and the risk of gaps.

Parameter/StageLocation (Code/Configuration)Current DefaultDescription
action_buffer_sizeACTAsyncRealDemoConfig.action_buffer_size20Capacity of the action buffer. The larger it is, the better it absorbs inference jitter and the less likely gaps occur, but stale actions pile up and increase latency; the smaller it is, the more it follows the latest plan, but the buffer is prone to running empty and causing execution stutter.
min_buffer_sizeACTAsyncRealDemoConfig.min_buffer_size4Triggers a new round of inference when the number of actions in the buffer is ≤ this value. The larger it is, the earlier the trigger, the more frequent the inference, and the more timely the action updates, with higher compute cost and real-time performance; the smaller it is, the later the trigger and the less inference, with a possible gap.
chunk segmentaction_buffer.put(postprocessed_actions[...][5:25] (take 20 steps)Only indices 5–25 of each inferred chunk are enqueued and replace the old buffer. The earlier the segment, the more it tracks the current observation; the later, the smoother it is.
sleep after inferenceafter a single inference inside get_actions_asyncmax(0, 0.03 - inference_model_time)Leave an interval of at least about 30 ms after each inference to limit the inference frequency and avoid saturating the CPU.
  • Implementation file: kuavo_deploy/eval_kuavo_async_no_lock_kuavo.py

4.3 Model Output and Action Smoothing

The joint targets output by the model go through clipping (joint end-range limits), first-frame interpolation, inter-frame interpolation, and low-pass filtering before being sent to the robot. The following parameters are currently fixed in the code and are described here for reference only; if you need to adjust smoothness and response speed, you can try modifying the corresponding code and default values.

StageLocation (Code)Current DefaultDescription
Low-pass filteringLowPassFilter imported in kuavo_deploy/kuavo_env/KuavoBaseRosEnv.pycutoff_hz=1.0, dt=0.01Applies a first-order low-pass filter to the action sent at each step to reduce high-frequency jitter. The smaller cutoff_hz is, the smoother and slower the tracking; you can try 0.5–2.0.
First-frame interpolationthe first-frame part inside step()num_points=100, dt=0.01 (total duration about 1 s)Linearly interpolates from the current joint state to the first-beat target. The more points and the smaller the per-step interval, the smoother the first step.
Inter-frame interpolationthe non-first-frame part inside step()action_dt=0.1, interpolated_dt=0.01 (10 interpolation points)Total duration and step size of the linear interpolation from the previous action to the current action. Increasing action_dt (e.g. 0.15–0.2) improves smoothness, but slightly increases latency.
  • Implementation files: Action execution is in kuavo_deploy/kuavo_env/KuavoBaseRosEnv.py (step(), exec_action()) The low-pass filter is in kuavo_deploy/kuavo_env/lowpass_filter.py (LowPassFilter: cutoff_hz / tau, dt, alpha).

5. Notes

Detailed Steps

📡 ROS Topics

Topic NameFunction Description
/cam_h/color/image_raw/compressedRGB color image from the top camera
/cam_h/深度/image_raw/compressedDepthDepth image from the top camera, realsense
/cam_l/color/image_raw/compressedRGB color image from the left camera
/cam_l/深度/image_rect_raw/compressedDepthDepth image from the left camera, realsense
/cam_r/color/image_raw/compressedRGB color image from the right camera
/cam_r/深度/image_rect_raw/compressedDepthDepth image from the right camera, realsense
/control_robot_hand_positionDexterous hand joint angle control command
/dexhand/stateCurrent joint angle state of the dexterous hand
/leju_claw_stateCurrent joint angle state of the Leju gripper
/leju_claw_commandLeju gripper joint angle control command
/joint_cmdControl commands for all joints
/kuavo_arm_trajRobot arm trajectory control
/sensors_data_rawRaw data from all sensors

📁 Code Output Structure

输出/
├── train/<task>/<method>/run_<timestamp>/ # 训练模型与参数
├── eval/<task>/<method>/run_<timestamp>/ # 测试日志与视频

📂 Core Code Structure

KUAVO-DATA-CHALLENGE/
├── configs/ #配置文件
├── kuavo_data/ # 数据处理转换模块
├── kuavo_deploy/ # 部署脚本(模拟器/真机)
├── kuavo_train/ # 模仿学习训练代码
├── lerobot_patches/ # Lerobot 运行补丁
├──outputs/ # 模型与结果
├──third_party/ # Lerobot 依赖
└──requirements_xxx.txt #依赖列表
└── README.md # 说明文档

🔬 Research Scenario Implementation

🍸 Mojito Cocktail Preparation -- Long-Horizon Task Decomposition Capability{#Cocktail_Making}

🏠 Scenario Introduction

Execution flow of the mojito cocktail preparation long-horizon task:

  • ① The initial state is the robot with both hands raised, positioned above the bar counter
  • ② The right gripper grasps a lemon and places it into the mojito glass
  • ③ The right gripper grasps mint leaves, places them into the mojito glass, and returns to its home position
  • ④ The left gripper grasps the sparkling water bottle, pours the sparkling water steadily into the glass, and discards the empty bottle
  • ⑤ The left gripper grasps the rum bottle, pours the liquor steadily into the glass, sets the bottle down stably, and the left gripper returns to its home position

🖥️ System Environment

  • Robot version: KUAVO 4PRO MAXA + gripper
  • Lower-level controller kuavo-ros-opensource repository version: tag 1.3.3
  • Imitation learning kuavo_data_challenge repository branch: research_scenario
  • kuavo-humanoid-sdk SDK version: 1.3.3
  • lerobot version: 0.4.2
  • VR mode: position incremental + orientation absolute + wired (recommended)
  • Imitation learning framework: ACT

📦 Items Required for the Scenario

ItemQuantitySizeImagePurchase link (reference)
White dinner plate2Diameter: 15cm, height: 2cm白色餐盘Link
White rum1Bacardi 40° white rum, 500ml白朗姆酒Link
Mojito glass1Large; mouth diameter: 6.3cm, height: 16cm, capacity 530ml莫吉托杯Link
Sparkling water bottle1Taixiang soda sparkling water, 325ml气泡水瓶Link
Bar mat1Black, 70*40cm吧台垫Link
Liquor pourer1304 stainless steel liquor pourer倒酒器Link
Lemon1Tahitian seedless green lime; length: approx. 6cm, width: approx. 4cm; cut in half柠檬Link
Mint leaves1As long as they fit into the glass薄荷叶Any
Trash bin1Any (used to discard the sparkling water bottle)AnyAny
White oval table1Height: 96cm, max length: 240cm, max width: 120cm白色椭圆桌None

🚀 Overall Workflow

Data Collection

  1. Switch the lower-level controller repository kuavo-ros-opensource to code version tag 1.3.3. Configure the scenario and the robot as described in Data Collection, and connect the robot to the data collection platform.

  2. Before collecting data, perform head and hand zero-point calibration on the robot and mark the zero positions (the arms should be straightened normally, and the head must be positioned so that the camera can see the complete scene during collection). Ensure the robot's zero points are consistent between data collection and deployment, because the head and arm zero points affect model deployment performance.

  3. Start the robot's standing program

rostopic pub /cmd_pose geometry_msgs/Twist "linear:
  x: 0.0
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 0.0"
  1. Publish an empty message to the /cmd_pose topic to return the robot to its home pose and improve the consistency of the robot's body posture during data collection; use the ROS topic interface or the on-device control function of the data collection platform to make the robot look down at the bar counter, with the head pitch rotated 20°; then mark the robot's standing position.

  2. Start the position-incremental + orientation-absolute VR teleoperation program. For wired VR, refer to the Wired VR Solution User Guide

cd kuavo-ros-opensource
sudo su
source devel/setup.bash
roslaunch noitom_hi5_hand_udp_python launch_quest3_ik.launch \
    ip_address:=your_quest_ip \
    use_cpp_incremental_ik:=true \
    use_incremental_hand_orientation:=false
  1. Use VR to raise both hands to the working position above the bar counter. Collect 30 complete cocktail-making sequences as shown in the video, and collect another 30 sequences of only the lemon-picking subtask to improve the success rate of lemon picking, forming the dataset.

Data Conversion

  1. Use the gym tool to download the rosbag dataset from the data collection platform's cloud to the training host; refer to the gym Tool User Guide.

  2. Refer to Data Format Conversion to convert the data into a lerobot dataset.

Model Training

  1. Refer to Imitation Learning Training and use the ACT policy for training.

Model Inference

  1. Place the trained model weights into the KDC repository on the robot's onboard computer. The directory structure should be as follows:
outputs
 └── train
     └── your_task_name
         └── your_method
             └── timestamp
                 ├── epochxxx
                 │   ├── config.json
                 │   └── model.safetensors
                 ├── policy_postprocessor_step_0_unnormalizer_processor.safetensors
                 ├── policy_postprocessor.json
                 ├── policy_preprocessor_step_3_normalizer_processor.safetensors
                 └── policy_preprocessor.json
  1. After the robot is standing normally, call the /enable_wbc_arm_trajectory_control ROS service to enable WBC (Whole Body Control) arm trajectory control, and set the control mode to 1 (automatic arm-swing mode):
rosservice call /enable_wbc_arm_trajectory_control "control_mode: 1"
  1. Move go.bag to the robot's onboard computer, and refer to Real Robot Model Deployment to perform model inference and reproduce the result shown in the video:
  • Start the real-robot inference deployment script and execute task go: it first interpolates to the pose of the first frame in go.bag, then plays back the go.bag bag file to move to the working position.
  • Run the real-robot asynchronous inference script (with default parameters) kuavo_deploy/eval_kuavo_async_no_lock_kuavo4pro.py

🍎 Fruit and Vegetable Sorting -- Model Generalization Capability{#Fruit_Vegetable_Sorting}

🏠 Scenario Introduction

Execution flow of the fruit and vegetable sorting generalization task:

  • From the robot's first-person view, the vegetable storage basket is on the left and the fruit storage basket is on the right. Four types of fruits and vegetables -- apples, bananas, green peppers, and carrots -- are placed at random on the table. The robot starts with both hands raised above the table (without blocking the storage baskets) and autonomously completes the recognition, grasping, and sorted placement of all fruits and vegetables into the two storage baskets.

🖥️ System Environment

  • Robot version: KUAVO 5 MAXA + gripper
  • Lower-level controller kuavo-ros-opensource repository version: tag 1.3.3
  • Imitation learning kuavo_data_challenge repository branch: research_scenario
  • kuavo-humanoid-sdk SDK version: 1.3.3
  • lerobot version: 0.4.2
  • VR mode: position incremental + orientation absolute + wired (recommended)
  • Imitation learning framework: ACT

📦 Items Required for the Scenario

ItemQuantitySizeImagePurchase link (for reference only)
Banana model1Length: 19cm, width: 4.5cm香蕉模型None
Apple model1Height: 7cm, diameter: 7.5cm苹果模型None
Green pepper model1Height: 9cm, width: 6.5cm青椒模型None
Carrot model2Length: 21cm, width: 4.5cm胡萝卜模型None
Bamboo basket2Light brown, length: 30cm, width: 20cm, height: 7cm竹筐Link
White oval table1Height: 96cm, max length: 240cm, max width: 120cm白色椭圆桌None

🚀 Overall Workflow

Data Collection

The collection process is the same as for Mojito Cocktail Preparation, with the following differences during collection:

  • ① The four types of fruits and vegetables are placed on the table in random positions and orientations
  • ② Sort the fruits and vegetables closest to the robot first
  • ③ Vegetables near the vegetable basket on the left are sorted with the left gripper, and fruits near the fruit basket on the right are sorted with the right gripper
  • ④ For fruits and vegetables far from their corresponding baskets, sort them by passing them between the left and right hands

Data Conversion and Model Training

  • The overall process is the same as for Mojito Cocktail Preparation. Note that ⚠️ in the configuration parameters you must change the robot version to KUAVO5; KUAVO5 has one more waist degree of freedom than KUAVO4pro, so the dimensionality of the arm joint data read changes.

Model Inference

  • The overall workflow is the same as Mojito Mixing; the final step runs the Kuavo5 real-robot asynchronous inference script (with default parameters): kuavo_deploy/eval_kuavo_async_no_lock_kuavo5.py

⚠️ Important Notes

  1. For each data episode, the arm and head poses should be kept as consistent as possible at the start of the task; the arm and head poses should also be kept as consistent as possible at the end of the task.
  2. When collecting data, minimize pauses to prevent the model from producing back-and-forth motion due to ambiguity during inference.
  3. When collecting data, avoid the following: different next-step actions occurring under identical camera images and identical arm poses. Otherwise, the trained model weights will be ambiguous, and the model will be unable to accurately determine the next motion command.
  4. It is recommended to use a wired VR setup (low latency, smooth motion) + an incremental VR program (easier to operate, wider range of executable motion).

On this page

📝 Case Overview🗺️ Framework Diagram🔧 Hardware Configuration🧩 Software Environment🤖 Full Robot Imitation Learning Workflow🔧 Environment Setup🎯 Core Features:♻️ Environment Requirements📦 Installation Guide1. Operating System Environment Setupa. Install the Operating System and NVIDIA Driverb. Install NVIDIA Container Toolkitc. Install Docker2. ROS Environment Setup3. Clone the Code4. Python Environment Setup5. Install dependencies:📦 Data CollectionChapter Introduction🚀 Leju Data Collection Platform1. Confirm the environment2. Device management3. Add a collection task4. Configure wrist cameras5. Connect to the data collection platform6. Start robot VR teleoperation📨 kuavo_data_challenge Usage🌐 LET Open-Source Dataset1. Data Format ConversionDataset sourcesConfiguration file2. Imitation Learning TrainingConfiguration file2.1 Imitation Learning Training: Single-Machine Multi-GPU ModeConfiguration File3. Real-Robot Model DeploymentConfiguration File3.1 Hardware Startup3.2 Real-Robot Inference Deployment Script3.3 Real-Robot Asynchronous Inference4. Inference Performance Tuning4.1 Synchronous Inference4.2 Asynchronous Inference4.3 Model Output and Action Smoothing5. Notes📡 ROS Topics📁 Code Output Structure📂 Core Code Structure🔬 Research Scenario Implementation🍸 Mojito Cocktail Preparation -- Long-Horizon Task Decomposition Capability{#Cocktail_Making}🏠 Scenario Introduction🖥️ System Environment📦 Items Required for the Scenario🚀 Overall WorkflowData CollectionData ConversionModel TrainingModel Inference🍎 Fruit and Vegetable Sorting -- Model Generalization Capability{#Fruit_Vegetable_Sorting}🏠 Scenario Introduction🖥️ System Environment📦 Items Required for the Scenario🚀 Overall WorkflowData CollectionData Conversion and Model TrainingModel Inference⚠️ Important Notes