Skip to content

Feat/add hans s30 robot#3378

Open
shijixiang0114 wants to merge 3 commits intohuggingface:mainfrom
shijixiang0114:feat/add-hans-s30-robot
Open

Feat/add hans s30 robot#3378
shijixiang0114 wants to merge 3 commits intohuggingface:mainfrom
shijixiang0114:feat/add-hans-s30-robot

Conversation

@shijixiang0114
Copy link
Copy Markdown

@shijixiang0114 shijixiang0114 commented Apr 14, 2026

Title

feat(robots): add Hans Robot S30 6-DoF industrial arm adapter

Type / Scope

  • Type: Feature
  • Scope: robots, examples

Summary / Motivation

Adds a LeRobot adapter for the Hans Robot S30, a 6-DoF industrial
manipulator widely used in Chinese manufacturing and research labs.
The S30 communicates over TCP/IP using the vendor's proprietary CPS
(Controller Programming System) protocol — no USB serial bus or
Dynamixel/Feetech motors are involved.

This contribution makes the S30 a first-class LeRobot citizen:
operators can collect demonstrations via zero-force teaching, replay
episodes, and run trained policies in closed-loop, all through the
standard Robot interface.

Related issues

  • Related: #(none — new hardware support)

What changed

New files — robot adapter (src/lerobot/robots/hans_s30/):

  • cps_client.py — minimal TCP client wrapping the Hans CPS protocol
    (HRIF_* API); includes RobotFSM enum and wait_for_fsm helper.
  • config_hans_s30.pyHansS30Config / HansS30RobotConfig
    dataclasses; registered as "hans_s30".
  • hans_s30.pyHansS30 class implementing the Robot interface
    (connect / disconnect / get_observation / send_action) plus
    enable_free_driver / disable_free_driver for zero-force teaching.
  • __init__.py — public exports.

New files — examples (examples/hans_s30/):

  • teleoperate.py, record.py, replay.py, evaluate.py — standard
    example scripts following the project's existing conventions.
  • README.md — hardware prerequisites, quick-start, config reference,
    and safety notes.

New file — tests (tests/robots/test_hans_s30.py):

  • Offline unit tests (mock CPSClient); no hardware required.

Modified — pyproject.toml:

  • Added per-file-ignores for cps_client.py to suppress N802
    (function names must be lowercase) for HRIF_* methods, which must
    match the vendor API naming convention.

Notable implementation details:

  • connect() is idempotent: reads the FSM before issuing any init
    command, skipping steps already completed by the controller (avoids
    error 20018 on warm restart).
  • HRIF_MoveJ uses the WayPoint TCP command (not WayPoint2) with
    is_joint=1; velocity must be strictly less than acceleration
    (controller enforces this — error 20073 otherwise).
  • enable_free_driver() explicitly catches error 20606 and raises a
    descriptive RuntimeError when the zero-force teaching licence is
    not activated on the controller.

How was this tested (or how to run locally)

Unit tests (no hardware):

pytest tests/robots/test_hans_s30.py -v

@github-actions github-actions Bot added documentation Improvements or fixes to the project’s docs tests Problems with test coverage, failures, or improvements to testing robots Issues concerning robots HW interfaces examples Issues related to the examples labels Apr 14, 2026
@shijixiang0114
Copy link
Copy Markdown
Author

I have resubmitted this version using the company account.
Please refer to the submission from the company account. Thank you.

@shijixiang0114
Copy link
Copy Markdown
Author

#3388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or fixes to the project’s docs examples Issues related to the examples robots Issues concerning robots HW interfaces tests Problems with test coverage, failures, or improvements to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant