Skip to main content

LeRobot follower implementation for the ugo Pro humanoid robot

Project description

LeRobot + ugo Pro Integration

License CI

IndexImage

This repository packages a full follower implementation that bridges the ugo Pro R&D model with Hugging Face’s LeRobot ecosystem. It complies with the Bring Your Own Hardware (BYOH) conventions so the robot is autodiscovered by lerobot-teleoperate, lerobot-record, etc.

Key pieces live under lerobot_robot_ugo_pro/:

  • config_ugo_pro.pyUgoProConfig, a BYOH-registered RobotConfig.
  • ugo_pro.py — the Robot subclass with lifecycle, observation/action schemas, and safety hooks.
  • telemetry/ — streaming CSV parser (TelemetryParser) and TelemetryFrame dataclass.
  • transport/ — UDP telemetry listener and command client with a 10 ms rate limiter.
  • follower/mapper.py — leader→joint mapping with follower gain, mirror, and role support.

Design references, UDP specs, and the end-to-end task plan are documented in docs/.


Installation

pip install lerobot-robot-ugo-pro
# or while developing:
pip install -e ".[dev]"

The package exposes the ugo_pro robot type via the lerobot.robots entry-point, so once installed it is automatically available to the LeRobot CLI tools. When running straight from a git checkout (before packaging), set PYTHONPATH=$PWD or LEROBOT_THIRD_PARTY_MODULES=lerobot_robot_ugo_pro.ugo_pro so the follower class is importable.


Quick Start

Setup Variables

export REPO_ID="username/my_record_name"
export TASK_NAME="Grab the green cube"

Camera Configuration

lerobot-find-cameras

Teleoperation via CLI

lerobot-teleoperate \
  --robot.type=ugo_pro \
  --robot.id=my_ugo_pro \
  --robot.cameras="{ front: {type: opencv, index_or_path: 0, width: 1920, height: 1080, fps: 15}, left: {type: opencv, index_or_path: 2, width: 1920, height: 1080, fps: 15}, right: {type: opencv, index_or_path: 1, width: 1920, height: 1080, fps: 15}}" \
  --teleop.type=ugo_bilcon \
  --teleop.id=my_ugo_bilcon \
  --display_data=true

Recording

lerobot-record \
  --robot.type=ugo_pro \
  --robot.id=my_ugo_pro \
  --robot.cameras="{ front: {type: opencv, index_or_path: 0, width: 1920, height: 1080, fps: 15}, left: {type: opencv, index_or_path: 2, width: 1920, height: 1080, fps: 15}, right: {type: opencv, index_or_path: 1, width: 1920, height: 1080, fps: 15}}" \
  --teleop.type=ugo_bilcon \
  --teleop.id=my_ugo_bilcon \
  --display_data=false \
  --dataset.fps=15 \
  --dataset.push_to_hub=false \
  --dataset.repo_id=$REPO_ID \
  --dataset.single_task=$TASK_NAME
  --dataset.num_episodes=2 \
  --resume=true

Dataset Viewer (Local)

lerobot-dataset-viz \
  --repo-id $REPO_ID \
  --episode-index 0

Replay

lerobot-replay \
  --robot.type=ugo_pro \
  --robot.id=my_ugo_pro \
  --dataset.repo_id=$REPO_ID \
  --dataset.episode=0

Policy Training

lerobot-train \
  --dataset.repo_id=$REPO_ID \
  --policy.repo_id=$REPO_ID_MODEL \
  --policy.type=act  \
  --output_dir=outputs/train/model \
  --job_name=modelname \
  --policy.device=cuda \
  --wandb.enable=true \
  --wandb.project=conditional_act_v3 \
  --policy.push_to_hub=false \
  --steps=40000 \
  --batch_size=4 \
  --save_checkpoint=true \
  --save_freq=10000

Configuration Highlights

UgoProConfig exposes the knobs needed to match a particular MCU deployment:

Field Description
telemetry_host / telemetry_port UDP bind for incoming MCU telemetry (8886 by default).
mcu_host / command_port MCU IP + port for outbound commands (192.168.4.40:8888).
left_arm_ids / right_arm_ids Servo ID ordering (defaults to [21-28] for left and [11-18] for right).
follower_role "dual", "left-only", or "right-only" to restrict which arm receives targets.
mirror_mode Swap and sign-flip leader actions to mirror across arms.
follower_gain Blend factor (0→hold current pose, 1→direct leader tracking, intermediate blends).
action_map Map arbitrary leader keys (e.g. leader.elbow) to servo IDs.
timeout_sec Telemetry timeout; exceeded → automatic re-send of the last targets for fail-safe.
cameras Optional CameraConfig dict; validated for width/height/fps per BYOH rules.

Joint limits, default velocity/torque ceilings, and command history depth are also configurable. See docs/lerobot_ugo_pro_design.md for the complete field reference and validation rules.


Telemetry & Command Path

  • Telemetry: UgoTelemetryClient binds to telemetry_port, decodes CSV packets via TelemetryParser, and stores the latest TelemetryFrame inside a thread-safe JointStateBuffer.
  • Observation: UgoPro.get_observation() translates the frame into per-joint keys (joint_<id>.pos_deg, optional vel_raw, cur_raw, target_deg), VSD metadata, status fields, and camera outputs.
  • Action: UgoFollowerMapper normalizes leader input into ordered joint targets (applying mirror mode, follower role, and gain), while UgoCommandClient builds the MCU CSV as a single comma-separated target row (no cmd/id/tar/spd/trq/sync headers) and rate-limits to the configured 10 ms cycle.
  • Fail-safe: If telemetry stalls beyond timeout_sec, the follower re-sends the last safe targets so the MCU keeps the current posture.

Refer to docs/ugo_arm_monitoring_spec.md for the CSV schema, packet cadence, and vsd metadata semantics.


Development & Testing

git clone https://github.com/ugo-plus/lerobot-robot-ugo-pro.git
cd lerobot-robot-ugo-pro
pip install -e ".[dev]"
pytest

Useful commands:

  • pytest — runs the targeted suites (parser, mapper, config, UDP client, robot tests with dummy transports).
  • mypy lerobot_robot_ugo_pro tests — type-check runtime + test utilities.
  • ruff check . / ruff format . — linting/formatting.
  • pre-commit install && pre-commit run --all-files — keep local checks aligned with CI (.github/workflows/ci.yml runs ruff + mypy + pytest).

Need reference data while developing? See:

  • docs/custom_robot_integration_with_lerobot.md — BYOH checklist mirrored from upstream docs.
  • docs/lerobot_ugo_pro_design.md — architecture decisions and module breakdown.
  • docs/ugo_arm_monitoring_spec.md — UDP telemetry / command protocol straight from the MCU team.

Support & Future Work

The implementation already covers telemetry parsing, follower mapping, UDP transport, and LeRobot integration. Upcoming work includes feedback channels to teleoperators, dataset tooling, and expanded monitoring hooks. Contributions are welcome — please open an issue or PR if you extend the mapper, transport, or docs for your deployment.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lerobot_robot_ugo_pro-1.1.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lerobot_robot_ugo_pro-1.1.0-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file lerobot_robot_ugo_pro-1.1.0.tar.gz.

File metadata

  • Download URL: lerobot_robot_ugo_pro-1.1.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for lerobot_robot_ugo_pro-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4872110ee3e4a84d4cb3084f77a5eabd41fbb4e229ff6beacb195099c2c0596b
MD5 a11a8294d8d9d513fac087d7a11eb166
BLAKE2b-256 012d6fc3e3b5b8557b72773f3c9686203c00ee80adb5ff4b5c35b5e7e53d7658

See more details on using hashes here.

File details

Details for the file lerobot_robot_ugo_pro-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lerobot_robot_ugo_pro-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9209a17b48a5492d8a97aad01aeb545a185cb47e3e602a2abc135709a4a6e288
MD5 604465a2eb9952bdb9c09b84cad14997
BLAKE2b-256 eb4418488218e990aaabf7ec08262f2cba44661050577eab2de72344a5460c44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page