Feat/add hans s30 robot#3378
Open
shijixiang0114 wants to merge 3 commits intohuggingface:mainfrom
Open
Conversation
Author
|
I have resubmitted this version using the company account. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
feat(robots): add Hans Robot S30 6-DoF industrial arm adapter
Type / Scope
robots,examplesSummary / 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
Robotinterface.Related issues
What changed
New files — robot adapter (
src/lerobot/robots/hans_s30/):cps_client.py— minimal TCP client wrapping the Hans CPS protocol(
HRIF_*API); includesRobotFSMenum andwait_for_fsmhelper.config_hans_s30.py—HansS30Config/HansS30RobotConfigdataclasses; registered as
"hans_s30".hans_s30.py—HansS30class implementing theRobotinterface(connect / disconnect / get_observation / send_action) plus
enable_free_driver/disable_free_driverfor zero-force teaching.__init__.py— public exports.New files — examples (
examples/hans_s30/):teleoperate.py,record.py,replay.py,evaluate.py— standardexample 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):CPSClient); no hardware required.Modified —
pyproject.toml:per-file-ignoresforcps_client.pyto suppressN802(function names must be lowercase) for
HRIF_*methods, which mustmatch the vendor API naming convention.
Notable implementation details:
connect()is idempotent: reads the FSM before issuing any initcommand, skipping steps already completed by the controller (avoids
error 20018 on warm restart).
HRIF_MoveJuses theWayPointTCP command (notWayPoint2) withis_joint=1; velocity must be strictly less than acceleration(controller enforces this — error 20073 otherwise).
enable_free_driver()explicitly catches error 20606 and raises adescriptive
RuntimeErrorwhen the zero-force teaching licence isnot 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