Control a reBot arm from AI agents over MCP, with reCamera snapshots, detections and hand-eye calibration
English | 中文
Python SDK and stdio MCP server bridging Seeed reCamera (SG2002 RISC-V edge vision) and rebot-armd (Rust arm daemon).
rebot(arm-control core): standard library only, Python >= 3.8. TheArmclass for short programs meant to run unchanged on a PC and on the reCamera (see Write your own program), plus the armd protocol client and detection access underneath it.rebot_companion(SDK): rebot-armd client (re-exported fromrebot) (REST reads, WebSocket control lease, joint and Cartesian actions), reCamera ArUco trigger client, JPEG snapshots from the camera H.264 stream, B601-DM kinematics, hand-eye calibration, and a deterministic pick-and-place pipeline.rebot-mcp: a stdio MCP server that exposes the arm, snapshots and detections as tools to AI agents.
-
Stdio MCP server for AI agents (
rebot-mcp): 35 tools by default (up to 38 with--allow-clear-faultand--allow-safety-config; 16 tools in--read-onlymode: 16 lease-free tools (never acquires the control lease; includesdetectinference trigger,grasp_dry_run, ande_stop), so it is not purely read-only queries). Covers state + environment context, snapshots, detection, lease-freegrasp_dry_run, single-view/multi-view object measurement, motion, gripper, stop, named poses, place, sequences/episodes, keep-out boxes, fault recovery, collision guard, safety description, sandbox packs, and on-board policy execution. Works with MCP clients that support stdio servers; end-to-end tests used the Pythonmcpclient against a real arm. Motion, lease acquisition, and writes default tomock/simfollowers unless--allow-real-armis passed; fault clearing and cockpit takeover are off unless enabled at launch (see MCP server). -
Hand-eye calibration: eye-to-hand (closed-form Horn point registration) and eye-in-hand (Park & Martin
$AX=XB$ ), cross-checked against OpenCVCALIB_HAND_EYE_PARKin the tests. Accuracy is verified on synthetic data only; it has not been measured on a real arm yet. - Two stages: Stage 1, an agent orchestrates the tools; Stage 2, a deterministic local pick-and-place pipeline that needs no LLM.
- Kinematics: full URDF forward kinematics (within 0.1 mm of an independent URDF parser in the tests) and an analytic planar inverse kinematics solver for the B601-DM.
-
reCamera integration:
rebot_companionand the MCP server run on a host; therebotpackage (standard library only) is meant to run on the camera as well (not yet run on the device). On-demand detection triggers (6-DoF ArUco marker poses, YOLO 2D boxes) and JPEG snapshots decoded on the host from the camera's H.264 stream.
This software moves a real arm. Read Safety before running anything that moves.
- Key Features
- Architecture
- Requirements
- Install
- Quickstart
- Write your own program
- Project layout
- Topology
- Arm control
- MCP server (agent control)
- Hand-eye calibration
- Gripper calibration
- Camera intrinsics
- Record a LeRobot dataset
- Teach: sequences and device recordings
- Run a learned policy
- Examples
- Safety
- Development
- Acknowledgements
- License
┌────────────────────────────────────────────────────────────┐
│ Host PC: rebot-companion (Python) │
│ Stage 1: agent / script orchestration (rebot-mcp, ex. 03) │
│ Stage 2: deterministic pipeline (pipeline.py, ex. 04) │
└───────────────────────────┬────────────────────────────────┘
│ HTTP / WebSocket
▼
┌──────────────────────────────┬─────────────────────────────┐
│ rebot-armd (arm daemon) │ reCamera services │
│ REST + WS lease :8765 │ rebot-vision HTTP :8090 │
│ actions, limits, watchdog │ H.264 WebSocket :8001 │
│ detection API /api/v1/... │ RTSP /live0 :8554 │
└──────────────────────────────┴─────────────────────────────┘
The SDK does not run on the camera. The camera and armd provide single-purpose endpoints:
POST /api/trigger(rebot-vision, :8090): one detection, returns marker poses (x, y, z, roll, pitch, yaw).ws://<host>:8001/: H.264 stream;rebot_companion.snapshotdecodes one IDR frame to JPEG.rtsp://<host>:8554/live0(1280x720): used by the intrinsics tool.- There is no HTTP snapshot endpoint on the device (
:80/snapshot.jpgredirects to the supervisor UI).ReCameraClient.get_snapshot()works only whensnapshot_url=is passed. /api/v1/detection/*on armd: object detection (detect/snapshot_annotatedtools).
Two stages:
- Stage 1: an agent (through
rebot-mcp) or a host script calls these APIs and decides what to do next. - Stage 2: once calibration, poses and pick parameters are fixed,
DeterministicPickPlacePipelineruns the cycle without an LLM: trigger, transform, workspace check, leased motion.
Hardware:
- reBot B601-DM arm (armd uses a 7-joint vector: J1..J6 plus the gripper as index 6).
- Seeed reCamera. The defaults assume the USB network address
192.168.42.1. - An ArUco marker on the gripper (eye-to-hand) or in the scene (eye-in-hand) for hand-eye calibration and the pick pipeline.
Software on the devices:
- rebot-armd, reachable over HTTP/WebSocket (default port 8765). The Cartesian move, gripper
and action-status features need an armd build that serves
/api/v1/action/*and reportsactionin the observation;home/parkalso work with older builds. rebot-visionon the reCamera for marker triggers (part of therebot-teleoppackage, which also carries rebot-armd; no separate camera app is needed). The camera's own aruco-detector also works: its trigger needs a JSON body (aruco-detector >= 0.1.3 answers415otherwise; the SDK sends one) and distortion keys need aruco-detector >= 0.1.1.- The SenseCraft solution
rebot_agent_arminstallsrebot-teleop, this MCP server and the calibration verify step. reboton the reCamera (the package targets Python 3.8 there) does not come from this project's wheel, which requires Python >= 3.10. A rebot-teleop deb built withREBOT_SDK_DIR=<rebot-companion checkout>carries therebot/folder in/usr/share/rebot-teleop/python, and its app runner puts that directory onPYTHONPATH. Without it, copy therebot/folder next to the program'smain.py.
Host:
- Python >= 3.10 and uv for
rebot_companionand the MCP server. Therebotpackage alone needs Python >= 3.8 and no third-party packages. - Snapshots: PyAV (in the
agentextra) or theffmpegbinary onPATH. - Optional: Node.js, only to regenerate the JS reference values for the tests.
git clone https://github.com/Seeed-Solution/rebot-companion
cd rebot-companion
uv sync # SDK only
uv sync --extra agent # + MCP server: mcp 2.x, av, pillow
uv sync --extra calib # + OpenCV for tools/calibrate_intrinsics.py
uv sync --extra record # + PyAV, pyarrow for rebot-record
uv sync --extra policy # + PyAV, pyarrow for rebot-policy (learned policies: see Run a learned policy)
uv sync --extra onnx # + onnxruntime for ONNX policies without PyTorch/LeRobot
uv sync --all-extras # everything (development)| Extra | Packages | Needed for |
|---|---|---|
agent |
mcp>=2.3,<3, av>=12, pillow>=10 |
rebot-mcp, snapshots with PyAV, annotated snapshots |
calib |
opencv-python-headless>=4.8,<5 |
camera intrinsics tool |
record |
av>=12, pyarrow>=14 |
rebot-record (LeRobot dataset recorder) |
policy |
av>=12, pyarrow>=14 |
rebot-policy (camera, scripted policies); torch and lerobot are installed separately |
onnx |
onnxruntime>=1.18 |
rebot-policy --policy onnx:<dir> and rebot-scene ONNX validation |
The test suite runs against the versions pinned in uv.lock (for example mcp 2.3.0).
Connect to armd, read the state, grab a snapshot, make a small move and park. Run it with
uv run --extra agent python quickstart.py. Keep the arm's workspace clear.
from rebot_companion import ArmdClient
from rebot_companion.snapshot import snapshot_once
arm = ArmdClient("http://192.168.42.1:8765")
# 1. State (REST, no lease needed). The MCP tool get_state returns the same data plus the host FK pose.
obs = arm.get_observation()
print(obs.safety_state, obs.is_torqued, [round(q, 3) for q in obs.positions])
# 2. Snapshot: waits for the next IDR frame on the camera stream (timeout 6 s).
snap = snapshot_once("ws://192.168.42.1:8001/", max_width=800)
open("snapshot.jpg", "wb").write(snap.jpeg)
# 3. Small move and park, inside a control lease (heartbeat every 150 ms).
with arm.session() as s:
s.torque(True)
s.home_action()
s.move_relative("base", (0.0, 0.0, 0.02)) # 2 cm up in the base frame; needs the action API
s.park_action() # resting pose, then torque offThe arm part of this sequence is checked against the fake armd used by the tests
(tests/fake_armd.py), not on hardware. Without the action API, use the joint-space calls instead: s.home(), s.move_to(q, duration=2.0),
s.unload() (see Arm control).
rebot is the part of the SDK for your own scripts. It imports only the Python standard library,
so the same script runs on a PC (arm over the network) and on the reCamera (127.0.0.1).
from rebot import Arm
with Arm() as arm: # $REBOT_HOST, else 127.0.0.1; takes control, torque on
arm.home()
for obj in arm.detect("cup"): # detections, best first: label, score, box_norm
if arm.grasp(obj).holding:
arm.move_to((0.25, -0.15, 0.15)) # metres, arm base frame (x forward, y left, z up)
arm.gripper_open()
break
# Leaving the block parks the arm (torque off) and releases control,
# also after an error or Ctrl+C.Run on a PC (the rebot/ folder next to the script, or the package installed with uv sync):
REBOT_HOST=192.168.42.1 python3 main.pyRun on the reCamera: copy the rebot/ folder and the script to the device, then run it with the
device's python3:
scp -r rebot main.py <user>@192.168.42.1:~/arm/
ssh <user>@192.168.42.1 'cd ~/arm && python3 main.py'| Method | What it does |
|---|---|
Arm(host=None, port=None, enable=True, park_on_exit=True, force=False, obs_hz=10, handle_sigterm=True, operator_token=None, allow_insecure_operator_auth=None, operator_pin=None) |
connect, take the control lease, turn torque on; operator_token defaults to $REBOT_OPERATOR_TOKEN, operator_pin to $REBOT_OPERATOR_PIN
|
unlock(pin=None) (alias unlock_operator), lock() (alias lock_operator), auth_status()
|
operator session on armd (see Operator PIN) |
home(), park()
|
move home; move to the resting pose and turn torque off (the next motion turns torque on again) |
move_to(xyz, rpy=None, speed=None) |
straight-line move of the gripper; rpy in radians, speed in m/s |
move_relative(dx, dy, dz, frame="base", droll, dpitch, dyaw, speed) |
relative move in the base, tool or camera frame |
move_joints(positions, duration=None) |
joint-space move (7 values, radians) |
gripper_open(), gripper_close(), gripper_move(fraction)
|
gripper; gripper_close().holding reports a held object |
gripper_zero_check(store_offset=False, threshold_rad=0.10) |
mechanical zero check; result has stop_rad, offset_rad, pass_ (.passed) |
gripper_calibration(), set_gripper_calibration(points, offset_rad=None)
|
read calibration (GET); write opening table and/or offset (WS) |
detect(label=None, pipelines=("yolo",), min_score=0.3) |
one detector run through armd; list of detections (includes OBB fields angle_deg, angle_conf, grasp_width_px, obb_corners_norm, mask_focus when available) |
grasp(detection, task=None) or grasp("cup", box=(x0, y0, x1, y1))
|
armd's grasp action; .holding in the result; task names a stored grasp task (capability grasp_tasks) |
grasp_dry_run(detection, task=None) |
check reachability of a detection without moving or lease; unsupported task gives (False, "TASK_UNSUPPORTED", reason)
|
grasp_any(label=None, min_score=0.3, max_candidates=5, task=None) |
detect, dry-run in order, grasp first reachable target; TASK_UNSUPPORTED raises ActionFailed once |
state() |
latest observation (positions, safety_state, is_torqued, fault, ...) |
poses(), save_pose(name), delete_pose(name), move_to_pose(name, speed_scale=1.0)
|
named poses stored in armd |
place(pose=None, position=None, rpy=None, approach_height_m=0.08, release=True, retreat=True, speed_scale=1.0) |
put the held object down: lift, approach, descend, open, retreat (capability place) |
stop(), e_stop()
|
stop and hold; latched emergency stop |
wait_until_clear(timeout_s=10) |
after a COLLISION action failure: block until the arm has resumed (capability collision_guard) |
set_collision_guard(enabled=None, sensitivity=None), collision_guard()
|
switch the collision guard, set "low"/"medium"/"high", read its configuration (capability collision_guard) |
recover(max_attempts=1) |
clear a fault that armd marks recoverable, then torque on |
guard(timeout_s), feed()
|
release control when the main loop stops calling feed()
|
sequences(), save_sequence(name, steps), run_sequence(name, repeat=1, record=None), record(dataset, task), episodes(dataset)
|
sequences, device recordings and episodes (capability teach; see Teach) |
Starting points: examples/templates/sort_by_label.py (YOLO detection, grasp, place into bins chosen by
label) and examples/templates/demo_wave.py (tour of three taught poses). Building a program with an AI
assistant: see AGENTS.md (workflow, API cheat sheet, safety rules, error codes).
Behaviour:
Armturns SIGTERM intoSystemExitin the main thread (handle_sigterm=Falseopts out), so the device app runner's stop signal parks the arm and releases control.- Errors are
rebot.RebotErrorsubclasses with.codeand.message, for exampleIK_BRANCH_FLIP: target (0.9, 0, 0.1) needs the arm to flip its elbow; choose a closer or higher target (...)(this text is from the integration test below). recover()clears only faults whose observationfault.recoverableis true (watchdog timeout, control deadline, unsettled handover). E-stops, other faults, and every fault on an armd without fault codes raiseArmFaultError; clear those in the web cockpit after checking the arm. Leaving thewithblock does not clear them either.guard(timeout_s): a background thread releases the lease whenfeed()has not been called fortimeout_sseconds (time inside anArmmethod counts as fed, up to that call's own timeout plus 15 s: motionstimeoutor 60 s, other calls 30 s); armd's lease watchdog then handles the arm, and every later call raisesGuardTimeout.- Named poses,
move_to_pose,obs_hzand fault codes need an armd that reports capabilities version 6 (poses,obs_rate,fault_codes). Against older armd the pose methods raiseUnsupportedError(code == "UNSUPPORTED"),obs_hzis not sent (armd then sends every control tick), andrecover()does not clear faults.
rebot-armd 1.4.1 (rc10 and later) can enforce an operator PIN. Operator-only calls then fail with
OperatorRequired (code OPERATOR_REQUIRED) until the program unlocks: detect(), save_pose /
delete_pose, sequence saves, keep-out, collision guard and gripper calibration writes, recording,
episode import, and clearing a latched E-stop.
- The PIN is set in the reCamera console: rebot-teleop settings, group Operator Access.
- Scripts read it from
REBOT_OPERATOR_PIN;Arm()unlocks on the first operator-only call and once more after the session expires. The token stays in memory; the SDK does not log it.lock()ends the session; a PIN given only tounlock(pin)is then forgotten, a configuredoperator_pin/REBOT_OPERATOR_PINkeeps unlocking on demand. - A token works instead of the PIN:
REBOT_OPERATOR_TOKEN(oroperator_token=);ArmdClient.unlock_operator(pin)returns one. Token and PIN share one session. - The SDK does not send the PIN or token over plain
http://to a host other than127.0.0.1/localhost; it raisesINSECURE_TRANSPORTinstead. A PC driving the arm athttp://192.168.42.1opts in withREBOT_ALLOW_INSECURE_OPERATOR_AUTH=1(orallow_insecure_operator_auth=True); the PIN and token then cross the USB link unencrypted. Programs on the device use127.0.0.1and need no opt-in. - Do not write the PIN into scripts.
# on a PC, arm on the USB link
REBOT_HOST=192.168.42.1 REBOT_ALLOW_INSECURE_OPERATOR_AUTH=1 REBOT_OPERATOR_PIN=<pin> python3 main.py
# on the device
REBOT_OPERATOR_PIN=<pin> python3 main.pyWhat was checked:
import rebotloads no third-party module (numpy,httpx,websocketsstay out ofsys.modules). Therebotunit tests (WebSocket client, facade, protocol) pass on CPython 3.8.20 and 3.13 against the in-process fake armd; CI runs them on 3.8 (jobstdlib-core). The reCamera'spython3version was not checked; it has to be 3.8 or newer.tests/test_integration_armd.pydrivesArmagainst an armd binary built from rebot-armdad923dfwith--follower mockand the B601-DM profile: connect, enable,move_to,home,park, release, park on exit, readable errors. That armd reports capabilities version 5, so the version 6 features were checked only against the fake armd. Not run on hardware.
ARMD_BIN=/path/to/armd ARMD_PROFILE=/path/to/rebot-b601dm.json uv run pytest tests/test_integration_armd.py -srebot-companion/
├── pyproject.toml # uv project; extras: [agent] = MCP server, [calib] = OpenCV
├── rebot/ # arm-control core, standard library only (Python >= 3.8)
│ ├── arm.py # Arm facade for user programs
│ ├── client.py # rebot-armd client (REST reads + WebSocket lease session + actions)
│ ├── detection.py # detections through armd's detector proxy
│ ├── errors.py # RebotError and subclasses
│ ├── teach.py # sequence step helpers, SequenceResult, Recording (capability teach)
│ ├── _ws.py # minimal RFC 6455 WebSocket client
│ └── _http.py # JSON over urllib
├── rebot_companion/ # SDK (numpy / scipy)
│ ├── arm_client.py # re-export of rebot.client
│ ├── camera_client.py # reCamera rebot-vision / aruco-detector client (trigger / latest result)
│ ├── snapshot.py # JPEG snapshots from the H.264 stream + detection overlay
│ ├── units.py # rad <-> so101_norm <-> deg bidirectional unit conversions
│ ├── lerobot_recorder.py # LeRobot v3.0 dataset recorder (rebot-record)
│ ├── dataset_cli.py # device episodes <-> LeRobot v3.0 export / push (rebot-dataset)
│ ├── policy_runner.py # LeRobot / scripted policy -> armd servo stream (rebot-policy)
│ ├── leader_teleop.py # PC-side USB leader bridge -> armd servo (rebot-teleop-leader)
│ ├── mcp_server.py # stdio MCP server (rebot-mcp)
│ ├── kinematics.py # B601-DM FK (full URDF chain) and planar FK/IK (port of the Web cockpit)
│ ├── ik.py # IK adapter: base-frame pose -> armd 7-joint vector (incl. gripper)
│ ├── transforms.py # SE(3) transforms, Euler ZYX convention
│ ├── calibration.py # hand-eye calibration: point registration + AX=XB
│ └── pipeline.py # Stage 2 deterministic pick & place
├── examples/ # see "Examples"
├── tools/
│ ├── calibrate_intrinsics.py # camera intrinsics + distortion (OpenCV)
│ └── gen_web_fixtures.mjs # regenerates JS reference values for the tests
└── tests/
flowchart LR
subgraph Bench["Workcell"]
CAM["reCamera (SG2002)<br/>rebot-vision HTTP :8090<br/>H.264 WS :8001, RTSP :8554"]
ARMD["rebot-armd<br/>REST/WS :8765, Web cockpit"]
ARM["reBot B601-DM arm"]
end
PC["Host PC<br/>rebot-companion / rebot-mcp"]
ARMD -- "motor bus" --> ARM
CAM -. "views marker / scene" .-> ARM
PC -- "http://192.168.42.1:8090<br/>/api/trigger, /api/results/latest" --> CAM
PC -- "ws://192.168.42.1:8001/ (snapshots)<br/>rtsp://192.168.42.1:8554/live0 (intrinsics)" --> CAM
PC -- "http://<armd-host>:8765<br/>/api/v1/observation, WS lease, detection" --> ARMD
Default addresses:
| Component | rebot-mcp default |
Examples default |
|---|---|---|
| rebot-armd | http://192.168.42.1:8765 (armd on the reCamera) |
http://127.0.0.1:8765 (pass --arm-url) |
| camera H.264 stream | ws://192.168.42.1:8001/ |
— |
rebot-vision (:8090) |
— | http://192.168.42.1:8090 |
rebot-armd accepts actuator commands only on the WebSocket connection that holds the control
lease; REST motion/*, torque and clear_fault return LEASE_REQUIRED.
- Read state without a lease:
ArmdClient.get_observation()/ArmdClient.get_schema(). - Move inside
with arm.session() as s:(acquires the lease, heartbeats every 150 ms; armd's default lease timeout is 2500 ms):s.torque(True),s.home(),s.move_to(q, duration=2.0)(blocks until arrival),s.servo_stream(frames, rate_hz=50),s.unload(). ArmdClient.e_stop()works without a lease.- If the arm is still torqued when the lease expires, armd's watchdog acts. In the rebot-armd
source checked for this README (commit
5aba3d5), it parks the arm and turns torque off when the arm is healthy and has a resting pose; otherwise it holds position with torque on and latchesFault(WatchdogTimeout). Older armd builds only hold and latch. Finish withs.unload(), or after a fault calls.clear_fault()thens.torque(True). - Safe exit:
arm.session(safe_exit="error")(default) unloads a torqued arm when thewithblock raises (including Ctrl-C): clear a Fault, re-arm,unload(wait=True)bounded bysafe_exit_timeout(30 s), then release the lease.safe_exit="always"also does this on a normal exit;"off"only releases. The result is ins.safe_exit_outcome(unloaded,not_needed,unsupported,estop,no_lease,failed). A latched EStop is not cleared. When armd has no resting-pose profile,unloadanswersUNSUPPORTED; the outcome isunsupportedand the arm stays torqued. s.torque(False)is refused by armd (ARM_NOT_AT_RESTING_POSE) unless the arm is settled at the resting pose; uses.unload().s.unload()raisesUnloadFailedas soon as armd reportsArmedwith torque on after the unload motion (failed torque cut). Afters.unload(wait=False), closing the session waits for the unload, because a lease release cancels it in armd.- Servo:
servo_stream()needsrate_hz >= 10(armd drops the stream 200 ms after the last frame). armd drops frames that jump more than 0.35 rad from its commanded position without a reply (gripper exempt);servo()raisesServoJumpErrorfor such a step instead of sending it. - After a
force=Truepreemption, armd refuses motion withHANDOVER_SETTLINGfor a short settling period. - Actions (armd with
/api/v1/action/*):s.move_pose(xyz, rpy=None | quat=None)(straight-line Cartesian move ofend_link;move_tostays the joint-space jog),s.move_relative(frame, d, dyaw=, dpitch=, droll=),s.gripper("open" | "close" | "move", fraction=),s.home_action(),s.park_action(), ors.action(path, body). Each blocks untilobservation.actionwith the ack'saction_idis terminal and returns anActionResult;failed/cancelledraiseActionFailed(code). The default timeout is2 * expected_duration_s + 5s, capped at 60 s; on timeoutstopis sent andMotionTimeoutraised.ArmStatus.commanded_positionsandArmStatus.actionare empty / None on an armd without these fields. - SO-ARM101 follower: device serial
/dev/ttySC0(--follower so-arm101in armd), 6 DOF (5-DOF arm + 1 gripper). No gravity compensation, no mechanical zero-check, and no physical e-stop (software stop only); resting pose is foldedpark(). - 5-DOF Cartesian motions (
orient_dof=2): pitch and roll are directly controllable while yaw is coupled to arm position. Passauto_yaw=Truetomove_to(xyz, rpy=..., auto_yaw=True)(or omityaw_deginrebot-mcp) to let armd solve the matching yaw angle automatically withoutIK_UNREACHABLE. - PC USB Leader Bridge (
rebot-teleop-leader): streams 6-DOF STS3215 leader arm raw positions (USB/dev/ttyACM*,/dev/ttyUSB*, or macOS/dev/cu.usbmodem*) directly to armd's WebSocket servo interface with initial alignment guard, smooth quintic ramp-in, and clean parking on shutdown.
from rebot_companion import ArmdClient
arm = ArmdClient("http://127.0.0.1:8765")
with arm.session() as s:
s.torque(True)
target = list(s.home().positions) # keep home J6 (pi/2) and the gripper
target[0] += 0.2 # J1 +0.2 rad from home
s.move_to(target, duration=2.0)
s.unload() # park + torque off before the lease is releasedMarker trigger (ReCameraClient): trigger() posts a JSON body; a 415 raises CameraError.
It raises CameraTriggerTimeout on an HTTP timeout or a success: false reply; an empty list
means the frame had no marker. Markers without a pose are skipped.
rebot_companion/mcp_server.py is a stdio MCP server. It needs the agent extra.
uv run --directory /path/to/rebot-companion --extra agent rebot-mcp \
--armd http://192.168.42.1:8765 --camera-ws ws://192.168.42.1:8001/ \
[--client-id rebot-mcp] [--no-auto-lease] [--read-only] [--sim-only] [--allow-real-arm] \
[--decoder auto|pyav|ffmpeg] [--sandbox-pack-root DIR] \
[--allow-clear-fault] [--allow-preempt] [--allow-safety-config] [--log-level INFO]Generic MCP configuration (clients that use mcpServers, e.g. Claude Desktop claude_desktop_config.json, Cursor, Windsurf)
Add rebot to the mcpServers object in your agent's MCP configuration:
{
"mcpServers": {
"rebot": {
"command": "uv",
"args": [
"run",
"--directory", "/path/to/rebot-companion",
"--extra", "agent",
"rebot-mcp",
"--armd", "http://192.168.42.1:8765"
]
}
}
}The camera stream defaults to ws://192.168.42.1:8001/; add "--camera-ws", "ws://<host>:8001/" when the reCamera has another address. Clients with a different config format (for example OpenCode) need the same command and arguments in their own format.
claude mcp add rebot -- uv run --directory /path/to/rebot-companion --extra agent rebot-mcp \
--armd http://192.168.42.1:8765Logs go to stderr; stdout is the MCP channel.
| Flag | Default | Effect |
|---|---|---|
--armd |
http://192.168.42.1:8765 |
rebot-armd base URL (arm and detection API) |
--camera-ws |
ws://192.168.42.1:8001/ |
camera H.264 stream for snapshots |
--client-id |
rebot-mcp |
lease label shown to other clients |
--no-auto-lease |
off | do not acquire the lease until take_control |
--read-only |
off | expose only the 16 lease-free tools (never acquires the control lease; includes detect inference trigger, grasp_dry_run, and e_stop; not purely read-only queries) (highest precedence) |
--sim-only |
off | refuse motion, torque, lease, config writes (including save_pose), and sandbox upload/activate unless safety_describe.device.follower is mock or sim (overrides --allow-real-arm) |
--allow-real-arm |
off | allow motion, lease, and write tools on real or unknown followers (overridden by --read-only and --sim-only) |
--decoder |
auto |
pyav, ffmpeg, or auto (PyAV if installed) |
--sandbox-pack-root |
[] |
allowed host root directory for pack_dir uploads; repeatable (also reads REBOT_MCP_PACK_ROOTS) |
--allow-clear-fault |
off | adds the clear_fault tool (ignored under --read-only) |
--allow-preempt |
off | adds force to take_control (ignored under --read-only) |
--allow-safety-config |
off | adds set_keepout and set_collision_guard (ignored under --read-only) |
--operator-token |
None |
operator bearer token for protected commands (or REBOT_OPERATOR_TOKEN) |
--operator-pin |
None |
operator PIN; operator-only calls unlock on demand (or REBOT_OPERATOR_PIN, preferred: a command-line value shows in the process list) |
--allow-insecure-auth |
None |
allow sending operator credentials over plaintext non-loopback http:// / ws:// (needed for --armd http://192.168.42.1:8765 with a PIN or token) |
Tools:
| Tool | Input | Result |
|---|---|---|
get_state |
— | safety state, fault, torque, lease, joints (positions / commanded / velocities / torques / temperatures), tcp (host FK: xyz_m, rpy_deg, quat [w,x,y,z]), gripper, latest action, epoch_id, environment: {follower, is_sim, sandbox_mode, profile_id}. No lease needed |
snapshot |
max_width (800, 64..1920), quality (80, 10..95) |
JPEG image + JSON {width, height, device_ts_ms, age_ms} |
snapshot_annotated |
min_score (0.3), max_width, quality |
JPEG with the latest detector boxes + JSON {detections, det_frame_id, det_age_vs_frame_ms, note?} |
detect |
wait_ms (2500, 0..5000), min_score (0.3), pipelines (yolo / aruco / both, default both) |
{frame_id, ts_ms, pipelines, count, detections[{label, score, box_norm, center_norm, track_id, angle_deg?, angle_conf?, grasp_width_px?, obb_corners_norm?, mask_focus?}]}; uses POST /api/v1/detection/trigger with {"pipelines": [...]} when the detector reports per_request_pipelines (rebot-vision >= 1.3, perception API 2); older detectors run their current mode and pipelines in the result is null; on 404: enable inference → latest → disable (only if it enabled inference) |
grasp_dry_run |
label, box_norm ([x0, y0, x1, y1]), optional frame_id, ts_ms, task, timeout_s |
{reachable, code, message} via lease-free REST POST /api/v1/action/grasp (dry_run: true); available under --read-only and on real arms without --allow-real-arm. Optional task needs capability grasp_tasks |
measure_objects |
optional label, min_score (0.3) |
single-view depth-model size estimate ({frame_id, table_fit, objects, reasons, note}); no motion, no lease (available under --read-only) |
measure_objects_multiview |
optional label, box_norm, frame_id, min_score (0.3), views (3, 2..5), baseline_m (0.08, 0.03..0.12), speed_scale (0.3, 0.1..0.5), return_to_start, timeout_s |
moves the arm around the object and triangulates sizes (measurement); capability measure_multiview |
move_to |
x, y, z (m), roll_deg/pitch_deg/yaw_deg or quat, speed_mps (≤ 0.15, default 0.05), timeout_s (≤ 60) |
{action_id, state, settled, tcp_after, duration_s}; straight line of end_link; orientation omitted = keep |
move_relative |
frame (base/tool/camera), dx/dy/dz (each ≤ 0.30 m), dyaw_deg/dpitch_deg/droll_deg (each ≤ 90), level, speed_mps |
same as move_to |
gripper |
command (open/close/move), fraction (0 closed .. 1 open), grasp |
{holding, gap_rad, torque_nm, fraction, state} |
home / park |
— | action result; park ends Idle with torque off |
stop |
— | {state}; runs while another tool is moving |
e_stop |
— | {safety_state, epoch_id}; no lease needed; always available including --read-only |
enable |
— | torque on |
list_poses |
— | {count, poses[{name, positions, tcp}]}; no lease needed. Needs armd capability poses |
save_pose |
name (letters, digits, _, -; max 64) |
saves the current joint positions under name, replacing a pose of that name. Changes the device's saved poses. Capability poses |
move_to_pose |
name, speed_scale (0.1..1.0, default 0.5) |
action result; joint-space move. Capability poses |
place |
pose or x, y, z; rpy_deg, approach_height_m (0.08, 0.02..0.30), release, retreat, speed_scale (0.5), timeout_s |
action result; lift, approach, descend, open, retreat. Capability place |
get_keepout |
— | {boxes[{name, min_m, max_m}], source}; no lease needed. Capability keepout |
set_keepout |
boxes (max 16) |
replaces the runtime keep-out boxes ([] removes them). Changes the device configuration; listed only with --allow-safety-config. Capability keepout |
recover |
— | clears a fault armd marks recoverable (WATCHDOG_TIMEOUT, CONTROL_DEADLINE, HANDOVER_UNSETTLED) and re-enables torque; any other fault or E-stop returns NOT_RECOVERABLE and stays latched. Capability fault_codes |
collision_guard_status |
— | {enabled, sensitivity, thresholds_nm}; no lease needed. get_state.collision shows a stop in progress. Capability collision_guard |
describe_safety |
— | stops, faults (with recoverable), speed and joint limits, timing, hardware.physical_estop, plus a one-line summary; no lease needed. Capability safety_describe |
set_collision_guard |
enabled, sensitivity (low/medium/high) |
switches the collision guard and/or sets its sensitivity. Changes the device configuration; listed only with --allow-safety-config. Capability collision_guard |
list_sequences |
— | {count, sequences[{id, name, description, steps, rev, max_speed_scale}]}; no lease needed. Capability teach |
run_sequence |
sequence (name or id), repeat (1..100), from_step, single_step, allow_stale (false), record_dataset, record_task, timeout_s |
action result + steps_seen; on failure the error has failed_step. Capability teach |
list_episodes |
dataset, limit (50, 1..500) |
{count, episodes[{id, dataset, task, source, outcome, duration_s, frames, stale, ...}]}; no lease needed. Capability teach |
clear_fault |
— | clear EStop or Fault; listed only with --allow-clear-fault |
take_control |
force (only with --allow-preempt) |
acquire a free lease; with --allow-preempt, force=true takes control from the web cockpit |
release_control |
— | release the lease; if the arm is torqued, armd's watchdog parks it |
sandbox_catalog |
— | list server scenes, tools, policies, active mode, and built-in local packs; no lease needed |
sandbox_status |
— | current sandbox mode, active scene/tool/policy IDs, task stages, I/O, and policy status; no lease needed |
upload_sandbox_pack |
kind, pack_dir or files, optional pack_id |
validate and upload a scene/tool/policy pack to armd's sandbox store |
activate_sandbox |
mode (none/wasm/sim), optional scene, tool, policy, seed, auto_start_policy |
activate a sandbox simulation pack on armd |
policy_runtime_status |
— | read armd on-board policy runtime capabilities and live execution status; no lease needed |
run_onboard_policy |
policy_id, mode (shadow/live_sim, default shadow), max_seconds (10.0, ≤ 300), optional fps |
run an uploaded policy on armd in shadow or live_sim mode |
stop_onboard_policy |
— | stop an active on-board policy run on armd (/api/v1/action/policy/stop); requires this MCP server to hold the control lease (returns NO_LEASE if another client holds control; cannot stop another client's run) |
save_pose writes to the device (poses file) and is registered by default; set_keepout and set_collision_guard are hidden by default unless --allow-safety-config is passed.
Tools that need a capability return UNSUPPORTED with the message "Update rebot-armd" when armd is older.
recover never clears an E-stop or a fault armd marks not recoverable (including a COLLISION fault), so it does not need --allow-clear-fault.
save_pose, set_keepout and set_collision_guard write to the device; use them when the user asks.
Operator PIN: when armd enforces one, pass it with --operator-pin or $REBOT_OPERATOR_PIN (a
command-line value shows in the process list). The server unlocks on demand; no tool unlocks, locks or
shows the PIN. Without it, operator-only tools (detect, save_pose, ...) return OPERATOR_REQUIRED.
Against http://192.168.42.1 add --allow-insecure-auth (or REBOT_ALLOW_INSECURE_OPERATOR_AUTH=1);
on the device (127.0.0.1) it is not needed.
Collision guard: with the guard on, contact makes armd stop the arm and hold it. Running actions fail with COLLISION, motion commands are refused with COLLISION_HOLD, and the arm resumes by itself when the contact is gone. After repeated trips within a minute armd latches a COLLISION fault that a person clears in the cockpit. The guard is off by default and its thresholds are uncalibrated placeholders (not measured on a real arm). Both example templates wait with wait_until_clear() and retry the step once.
The limits in the table (speed ≤ 0.15 m/s, step ≤ 0.30 m, rotation ≤ 90 deg) are checked by the server's input schema before a call reaches armd; armd applies its own limits as well.
Lease and safety rules:
- Mode precedence:
--read-only>--sim-only>--allow-real-arm.--read-only: registers only the 16 lease-free tools (never acquires the control lease; includesdetectinference trigger,grasp_dry_run, ande_stop; not purely read-only queries); never acquires a lease at startup, lazy load, or reconnect; overrides--allow-clear-fault,--allow-preempt,--allow-safety-config,--sim-only, and--allow-real-arm.--sim-only: even when combined with--allow-real-arm, refuses motion, torque, lease acquisition/preemption, configuration writes (includingsave_pose), andupload_sandbox_pack/activate_sandboxunlesssafety_describe.device.followerismockorsim.- Default (without
--allow-real-arm): allows motion, lease acquisition, and write tools only whensafety_describe.device.followerismockorsim; real or unknown followers are restricted to read-only tools +e_stopwith zero lease calls, re-verified at startup, lazy load, reconnect, and tool dispatch.sandbox_mode("wasm"/"sim") is never used as follower identity.
- At startup the server tries a non-force lease (skipped under
--read-only,--no-auto-lease, or when the follower check refuses). If the web cockpit or another client holds it, the server keeps running without it and actuator tools returnLEASE_BUSY; each actuator call retries a non-force acquire. The server never sendsforce=trueby itself. - While the server holds the lease, its 150 ms heartbeat keeps it; the cockpit's non-force retry does not take it over.
- If the cockpit preempts (its confirm button), tools return
LEASE_LOST. The server does not re-acquire; control comes back only throughtake_control. - By default the agent cannot take control from the cockpit, clear faults, or change safety configuration:
take_controlhas noforceparameter,clear_faultis not listed, andset_keepout/set_collision_guardare hidden (read-only). After an E-stop or fault, error hints tell the agent to ask a person to clear it in the web cockpit.--allow-preemptaddstake_control(force=true). The server instructions tell the agent to use it only after the user explicitly confirms. Inside armd's cooldown it returnsPREEMPT_COOLDOWNwithremaining_ms.--allow-clear-faultadds theclear_faulttool.--allow-safety-configaddsset_keepoutandset_collision_guard.
- The cockpit takes the lease on its first control input, not when the page opens, and releases it
after 30 s without input only while torque is off. With no cockpit holding the lease,
take_controlsucceeds withoutforce. A cockpit with torque on keeps the lease: the user turns torque off in the cockpit (the lease is released after 30 s idle), or the server runs with--allow-preempt. While the server holds the lease, the cockpit shows observer mode and names the holder (the--client-idlabel). - After
release_control, or with--no-auto-lease, tools returnNO_LEASEuntiltake_control. - One motion tool runs at a time; a second call returns
BUSY.stopande_stoprun at any time. If the MCP client cancels a motion call, the server sendsstop. - On exit the session releases the lease; on an exception (including Ctrl-C)
safe_exit="error"parks the arm first. If the process is killed, armd's lease watchdog acts (see Arm control).
Errors come back as isError results whose text is JSON {code, message, hint, safety_state};
codes include PERMISSION_DENIED, LEASE_BUSY, LEASE_LOST, NO_LEASE, ESTOP_ACTIVE, FAULT_ACTIVE,
NOT_ARMED, WORKSPACE_VIOLATION, IK_UNREACHABLE, IK_BRANCH_FLIP, MOTION_BUSY,
MOTION_TIMEOUT (stop was sent), TRACKING_STALL, STOPPED, SUPERSEDED, BUSY,
CAMERA_UNAVAILABLE, SNAPSHOT_TIMEOUT, DETECTOR_UNAVAILABLE, UNSUPPORTED, OPERATOR_REQUIRED,
INVALID_PIN, and for sequences
SEQUENCE_NOT_FOUND, SEQUENCE_REF_MISSING, DATA_STALE, CALIBRATION_CHANGED, PLAN_STALE,
IN_USE, RECORDER_BUSY, RECORDER_NOT_OWNER.
Snapshots wait for the next IDR frame on the camera stream (default timeout 6 s), decoded with
PyAV or, without it, the ffmpeg binary. Box positions are normalised to the image; they are
only correct when the detector input has the same aspect ratio as the stream (not verified on
the device).
rebot_companion.kinematics has two models, both in the URDF base frame (x forward, y left,
z up, metres / radians):
- Full FK,
tcp_pose(q)/tcp_pose_from_joints(positions)/calibration.gripper_pose(positions): the URDF chainbase_link→joint1..joint6→end_joint→end_linkofreBot-DevArm_gripper.urdf(rebot-armdassets/, copy intests/fixtures/). Returns the SE(3) TCP pose, x axis = tool axis. Hand-eye calibration uses this FK, so J5 and J6 may take any value in the samples. Tests compare it with an independent URDF parser: < 0.1 mm, < 0.01 deg. - URDF joint5 = wrist swing (axis vertical at the park pose, motor J1..J5 = 0, J6 = pi/2; +0.2 rad moves the TCP ~36 mm in -y), joint6 = tool roll (about the tool axis; the TCP position does not change). The Web cockpit UI uses the same labels (J5 swing, J6 roll).
- Motor → URDF mapping: armd index 0..3 → URDF joint1..joint4 with
model = (motor - offset) / sign(WebtoModel/CFG.cart.sign/CFG.cart.off, defaults sign1,1,1,1, offset0; same as the Web?iksign=/?ikoff=overrides; the wizard takes--iksign/--ikoff). Index 4 → joint5 1:1; index 5 → joint6 with URDF joint6 = motor − pi/2 (kinematics.JointMap, defaultB601DM_JOINT_MAP;JointMap.from_schemareads armd'smodel_joint_mapfromGET /api/v1/observation/schema, which the MCP server and the hand-eye wizard use). Evidence: photos of the arm at the rest pose (motor J6 = pi/2), 2026-11-12: the jaws open left-right and the camera holder (end_link +z) is on top, which the URDF FK gives at joint6 = 0. Index 6 (gripper) is not part of the FK. - Planar FK/IK,
fk(q)/solve_ik(target, prev): line-by-line port of the rebot-armd Web cockpit (src/api/index.html,IK.fk/IK.solve), J1 yaw + J2/J3/J4 pitch chain, J5 = 0. Tests compare it against values computed by running the JS code with node (tools/gen_web_fixtures.mjs). With J5 = 0 its TCP position matches the full FK to < 0.2 mm (rounded Web constants, joint1 x offset of -0.084 mm ignored). solve_ik(target, prev)is the analytic position + pitch IK from the Web.ik.B601IkAdapterfills J1–J4 from the analytic IK (tool pointing down by default), J5 = 0, J6 = armd home (pi/2) or the current value (j6=None), J7 = gripper. armd rejects targets with any other length.
method |
Setup | Assumption | Uses | Result |
|---|---|---|---|---|
point (default) |
eye_to_hand | marker centre coincides with the TCP | positions only | T_cam_to_base (Horn closed form, same as the Web solveRigid) |
axxb |
eye_to_hand | marker rigid on the gripper, offset unknown | full poses | T_cam_to_base + T_marker_to_gripper |
axxb |
eye_in_hand | camera on the gripper, marker fixed in the scene | full poses | T_cam_to_gripper + T_marker_to_base |
axxb= Park & Martin: rotation by least squares on rotation logarithms, translation by stacked linear least squares, over all sample pairs. Its result matchescv2.calibrateHandEye(..., CALIB_HAND_EYE_PARK)in the tests.axxbneeds relative rotations about at least two non-parallel axes. With this arm, change both J1 yaw and wrist pitch (>= 15 deg) between samples; J5 swing and J6 roll add further rotation axes. Rotation about one axis only, or < 5 deg, raisesCalibrationError.- Residuals:
pointreports the 3D point error per sample;axxbreports per-sample marker position (m) and rotation (deg) prediction errors in the camera frame. RMSE and max error are printed and saved. The wizard warns when the RMSE is above 10 mm. - Marker orientation from the device has 0.01 deg resolution (
r_deg, 2 decimals).pointdoes not use it. - Accuracy depends on the camera intrinsics and
MARKER_SIZEon the device. Calibrate intrinsics first (Camera intrinsics).
# eye-to-hand, marker centre on the TCP (default)
uv run python examples/02_hand_eye_calib.py --arm-url http://<armd-host>:8765 --marker-id 0
# marker anywhere on the gripper
uv run python examples/02_hand_eye_calib.py --method axxb --arm-url http://<armd-host>:8765
# re-solve samples exported from the Web cockpit
uv run python examples/02_hand_eye_calib.py --from-web-export rebot_hand_eye_2026-11-01T10-00-00.jsonPose the arm by hand (torque off) or with teleop, hold it still and press Enter. Each capture
checks that the arm is not moving (|v| <= 0.02 rad/s, --vel-threshold, re-checked after
detection), triggers one detection, picks the marker id, computes the TCP pose with FK, rejects
samples closer than 10 mm to an existing one and appends to calib_samples.json (--resume
continues a session). s solves and prints the residual table, d solves and writes
calibration.json.
save_to_file() writes a superset of the Web cockpit export, so files from either side load
with HandEyeCalibration.load_result() (returns HandEyeResult(setup, transform)) and
HandEyeCalibration.load_samples() (returns samples to re-solve).
HandEyeResult.cam_to_base(joints): eye_to_hand returnsT_cam_to_base; eye_in_hand returnsT_base_gripper(joints) @ T_cam_to_gripper, withjointsthe armd positions when the image was taken. The pipeline reads them right before the trigger and fails the cycle if the arm moved during detection.HandEyeCalibration.load_from_file()returnsT_cam_to_basefor eye_to_hand files and raisesValueErrorfor eye_in_hand files (their transform isT_cam_to_gripper).- Legacy SDK files without
mode/setupare rejected byload_result().
The numbers in this example are illustrative. Web samples without R_cam are position-only
and can be solved with method="point" only. Their gripper rotation is recomputed from
joints with the FK.
rebot-gripper-calib measures the gripper on the real arm for armd's grasp (needs rebot-armd with the gripper calibration
API). The arm body does not move; the gripper moves at low speed. Keep fingers out of the jaws; Ctrl+C stops; nothing is
stored without confirmation.
REBOT_HOST=192.168.42.1 rebot-gripper-calib # --points 6 (default), --dry-run measures without storing- Shows the stored calibration and
observation.gripper_zero. - Zero check: the jaws close slowly to the mechanical stop; prints the offset from
closed_radand asks whether to store it. - Opening table: the gripper stops at each position from open to closed; enter the caliper opening at the jaw tips in mm
(
sskips a point,qaborts). - Checks that the openings are monotonic, prints the fit residuals (warns above 2 mm), the full opening and a suggested
max_grasp_width_m(full opening − 0.015 m), and asks whether to store the table.
armd uses the stored table for the width-based pre-open (pre_open: auto) and to cap the TOO_WIDE limit.
The detector's default intrinsics are placeholders (fx = fy = 600, cx = 320, cy = 180 at
640x360, no distortion). tools/calibrate_intrinsics.py estimates K and distortion with OpenCV:
uv sync --extra calib
# live: frames from rtsp://192.168.42.1:8554/live0, auto-capture when the board is still and the view is new
uv run python tools/calibrate_intrinsics.py --host 192.168.42.1 --board checkerboard --cols 9 --rows 6 --square 0.025
# ChArUco board
uv run python tools/calibrate_intrinsics.py --board charuco --cols 7 --rows 5 --square 0.04 --marker 0.03 --dict DICT_4X4_50
# offline: re-run on saved frames
uv run python tools/calibrate_intrinsics.py --images intrinsics_frames/20261109-101500- Print the board flat; measure the square size.
--cols/--rowsare inner corners (checkerboard) or squares (ChArUco). - Move the board across the whole image, near and far, tilted in all directions; the tool
captures a frame after the board is still for 5 frames and differs from earlier views
(default 20 views,
--target; frames are saved for offline re-runs). - The tool prints the reprojection RMS and writes
aruco-intrinsics.confwithCAMERA_WIDTH CAMERA_HEIGHT FX FY CX CY K1 K2 P1 P2 K3(OpenCV order) at the inference resolution (--infer-size, default 640x360). - With
rebot-vision: copy the values as lowercase keys (fx fy cx cy k1 k2 p1 p2 k3) into/userdata/rebot-teleop/vision.jsonand restart the app (/etc/init.d/K92rebot-teleop restart). With the camera's aruco-detector: merge the keys into/etc/aruco-detector.confand restart it; the distortion keys need aruco-detector >= 0.1.1 and the file is preserved across upgrades. JSON replies carry"undistorted": true/false.
Resolution assumption: calibration runs on the 1280x720 RTSP stream, the detector infers at 640x360 from the same sensor. The tool assumes the same field of view (no crop) and scales fx, fy, cx, cy by the width/height ratio (pixel-centre convention). This has not been verified on the device; check a measured marker distance against a tape measure.
rebot-record records teleoperation or scripted episodes from the host PC into a
LeRobot dataset (format codebase_version v3.0, as
written by lerobot 0.6.1; details in docs/lerobot_dataset.md).
It needs the record extra (PyAV, pyarrow), not lerobot.
uv sync --extra record
uv run rebot-record --armd 192.168.16.1 --camera 192.168.16.1 \
--repo-id user/pick_cup --task "pick the cup" --episodes 5 --episode-s 30Each episode: Enter starts it; Enter stops it early (otherwise it stops after --episode-s);
then Enter saves it, d discards it, q saves and quits. --no-prompt records back to back
(--reset-s pause between episodes). The dataset goes to
~/.cache/huggingface/lerobot/<repo-id> unless --root is given; the directory must be new.
| Feature | Source |
|---|---|
observation.state (7) |
armd positions (joints 1..6, gripper; rad) |
action (7) |
armd commanded_positions (falls back to positions on older armd) |
observation.velocity, observation.effort (7) |
velocities, torques, with --extras velocity,effort |
observation.images.recamera |
reCamera H.264 stream, decoded and re-encoded (libsvtav1 if PyAV has it, else h264; g=2, crf=30) |
The recorder does not take the control lease: it reads the armd observation WebSocket
(/api/v1/ws?obs_hz=2*fps) while a teleop app or program holds the lease. Alignment uses the
host receive time of every message (time.monotonic()): row k is due at T0 + k/fps and takes
the newest observation and the newest decoded camera frame received by then. armd's own
timestamp and the camera's ms tail are other clocks; they are stored per episode in
meta/rebot_episodes.jsonl with the observation and camera sample ages. Camera pipeline and
network delay are not compensated.
Python API: LeRobotRecorder(root, repo_id, fps=30, camera_url=..., armd_host=..., task=..., unit_mode="rad")
with start_episode(), stop_episode(), save(), discard(); start_episode(sample=False)
plus add_frame(state, action, image) records scripted steps at a fixed fps.
Use --unit-mode {rad,so101_norm,deg} (default rad) to normalize arm joints to [-100, 100]
and gripper openness to [0, 100] (so101_norm), saving unit_mode, profile_id, arm_dof
and gripper_joint metadata to meta/info.json.
Verified (tests/test_lerobot_recorder.py, synthetic observations and libx264 Annex-B frames
fed through the same PyAV decode path): file layout, indices, timestamps, stats and task
metadata; one mp4 frame per row; a lease-free run against the fake armd; the Enter-driven CLI.
LeRobotDataset(repo_id, root=...) loads the result and returns frames, actions and the task with
lerobot 0.6.1 (PyAV decoder) and 0.7.0 (torchcodec decoder) on Linux aarch64; this test runs
when REBOT_LEROBOT_PYTHON names a Python with lerobot[dataset] installed, else it is skipped.
Not yet run against a real armd and reCamera.
In the simulator. armd's sim follower and the simulated wrist camera of rebot-sim (in
rebot-armd, docs/simulation.md) stand in for the
arm and the reCamera: the simulator streams H.264 in the reCamera format at ws://127.0.0.1:8001/,
armd listens on 127.0.0.1:8765. In the rebot-armd checkout:
cd sim/mujoco && uv run rebot-sim --camera --objects cube,cup --seed 3 # terminal 1
ARMD_DETECTOR_URL=http://127.0.0.1:8090 cargo run --bin armd -- --follower sim \
--config kits/recamera-b601dm/profile/rebot-b601dm.json --log-dir off --blackbox-dir off # terminal 2Set ARMD_POSES, ARMD_KEEPOUT and ARMD_GRASP_SETUP to writable paths when /userdata does
not exist. Then record with --armd 127.0.0.1 --camera 127.0.0.1. The simulated camera runs at
15 fps by default (rebot-sim --fps, 1..30); at the recorder's 30 fps every second row repeats a
camera frame. Run on spark (Linux aarch64, 2026-11-11, rebot-armd b3ff997): one 3 s episode with
--no-prompt gave 91 rows, a 1280x720 observation.images.recamera video, 0 late ticks and 45
camera repeats. The stream is also decoded with rebot-companion's snapshot decoder in
rebot-armd's sim/mujoco/tests/test_camera.py.
Needs armd with capability teach (version 1). The device stores three kinds of joint-space data and
references them by stable ids (names are for display):
| Object | What | Stored on the device |
|---|---|---|
| Pose | one named joint configuration | poses.json (now with an id) |
| Sequence | ordered steps: pose, gripper, wait, replay (max 200) |
sequences.json |
| Episode | measured joint samples with armd-monotonic timestamps, one file per recording | episodes/<id>.parquet + <id>.json sidecar |
A pose or episode that a sequence references cannot be deleted (IN_USE). After a joint zero change
armd marks taught poses and recorded episodes stale and refuses them (DATA_STALE) unless the run
passes allow_stale.
from rebot import Arm
from rebot.teach import gripper_step, pose_step, wait_step
with Arm() as arm:
arm.save_sequence("pick_demo", [
pose_step("scan", speed_scale=0.3), # pose name -> pose_id when saved
gripper_step("open"),
wait_step(1.0),
pose_step("bin_a", speed_scale=0.3),
])
arm.create_dataset("pick") # recording needs an existing dataset (else DATASET_NOT_FOUND)
res = arm.run_sequence("pick_demo", repeat=3, record={"dataset": "pick", "task": "pick the cup"})
print(res.steps) # [{repeat_index, step_index, step_type, phase, t_s}, ...]
print(res.episodes) # ids of the episodes recorded by the run
with arm.record(dataset="pick", task="wave") as rec: # saved on exit, discarded on an exception
arm.move_to_pose("wave_1", speed_scale=0.3)
print(rec.episode_id, len(arm.episodes(dataset="pick")))run_sequence is one armd action (kind sequence): a failing step, stop, collision, fault, E-stop or
lease loss ends the whole run, also during a wait. It raises ActionFailed whose result.failed_step
names the step (armd's failed_step). The SDK waits up to 2 * expected_duration_s + 5 (armd's upper bound), without the 60 s
cap of single actions. With record, the run owns the recorder and stores one episode per repeat; an
aborted repeat's episode is discarded. arm.record() owns the recorder for this program; another
recording gives RECORDER_BUSY.
rebot-dataset (needs the record extra, not lerobot) moves episodes between the device and the PC:
# device dataset -> LeRobot v3.0 dataset (state/action, rad)
uv run rebot-dataset export --host 192.168.42.1 --dataset pick --out ./pick_v1 --fps 30
# PC LeRobot dataset -> device episodes (replayable, usable as replay steps)
uv run rebot-dataset push --host 192.168.42.1 --dataset-dir ./pick_v1 --episodes 0,2 [--dry-run]-
Episode import is operator-only on armd with an operator PIN:
pushreadsREBOT_OPERATOR_PIN(or--operator-pin) orREBOT_OPERATOR_TOKEN(--operator-token); overhttp://192.168.42.1add--allow-insecure-auth(orREBOT_ALLOW_INSECURE_OPERATOR_AUTH=1). Without credentials each episode reportsOPERATOR_REQUIRED. -
exportresamples each episode to--fpsby linear interpolation between measured samples. A gap between samples longer than 2 frame periods splits the episode into parts (--on-gap refusestops instead); parts shorter than 2 frames are dropped and listed underskipped. Episodes with outcomeabortedare skipped unless--include-aborted. The writer is the onerebot-recorduses.meta/rebot.jsonrecords per output episode: device episode id, part, joint zero offsets and revision, profile id, armd version, source, task, stale flag. -
pushreadsmeta/info.jsonunit_mode(rad,deg,so101_norm;--unitsoverrides) and the recordednormalization_bounds, converts to rad, matches the feature names against armd'sjoint_names(reorders a permutation; other names need--assume-armd-order), checks soft limits locally and POSTs/api/v1/episodes/import(multipartparquet+sidecar). armd validates again and refuses withIMPORT_INVALIDand areason. Joint zero provenance from an export is sent along.
Verified (tests/test_teach_sdk.py, tests/test_dataset_cli.py, fake armd implementing the teach
contract): every SDK call, step order and progress, stop during a wait, lease loss, DATA_STALE,
one episode per repeat, discard of an aborted repeat, export round trip, gap split / refuse, push
unit conversion and joint reordering. The exported dataset loads with LeRobotDataset in lerobot
0.6.1 and 0.7.0 (runs when REBOT_LEROBOT_PYTHON is set). Not yet run against a real armd with teach
support.
Lease client ids (the cockpit shows the holder): rebot.Arm rebot-app-<name> with
REBOT_APP_NAME set, else rebot-<pid>; rebot-policy rebot-policy-<pid>; rebot-teleop-leader
rebot-teleop-<pid>; rebot-mcp rebot-mcp (--client-id).
rebot-policy runs a policy on the host PC (GPU host for learned policies) and drives the arm
through armd's servo stream. armd's servo guard (speed cap, lead cap, blocked hold), collision
guard and faults apply as for any other client.
# scripted policies, no torch: replay a recorded episode, or a small sine on one joint
uv run --extra policy rebot-policy --armd 127.0.0.1 --policy replay:$HOME/.cache/huggingface/lerobot/user/pick_cup:0
uv run --extra policy rebot-policy --armd 127.0.0.1 --policy sine:1:0.05:4 --max-seconds 20
# a LeRobot policy (local directory saved by lerobot-train, or a Hub repo id), on the real arm;
# torch + lerobot are added for this run only, in a Python 3.12 environment
uv run --python 3.12 --extra policy --with 'lerobot[dataset]>=0.6.1,<0.8' rebot-policy \
--armd 192.168.16.1 --camera 192.168.16.1 --policy outputs/train/act/checkpoints/last/pretrained_model \
--fps 30 --max-seconds 60 --task "pick the cup" --i-am-at-the-arm --log run.jsonltorch and lerobot (0.6.1 or 0.7.0, Python >= 3.12, several GB) are not dependencies of
rebot-companion. Either add them per run with uv run --with as above (inside this repository
--python 3.12 makes the project environment use Python 3.12), or install rebot-companion into
the Python environment where lerobot is already installed (for example the training environment).
The runner imports them only for a learned policy.
| Option | Meaning |
|---|---|
--policy |
LeRobot pretrained directory or Hub repo id; onnx:<policy_dir> (or directory containing policy.json + model.onnx, using rebot-onnx-policy/v1 with --extra onnx; on SO-ARM101 policy.json must specify "unit_mode", whereas browser WASM defaults missing unit_mode to "rad", or pass explicit --action-units/--state-units with --override-unit-mode); replay:<dataset root>:<episode> (the episode's action column); sine:<joint>:<amp rad>:<period s> (joint 1..7 or a name, amp <= 0.5 rad); a scripted: prefix is accepted; any other <word>: prefix is refused (not looked up on the Hub). The run prints whether a learned policy came from a local directory or the Hub |
--fps |
policy steps per second. Default: the dataset fps for replay; for a learned policy the fps in its train_config.json (env.fps, dataset.fps, else the training dataset's meta/info.json from dataset.root or $HF_LEROBOT_HOME/<dataset.repo_id>), and --fps is required when none is found; 30 for sine. A different --fps is logged as a warning |
--servo-hz |
servo frame rate (default 50, armd's control rate) |
--max-seconds |
run length (default 60) |
--max-steps |
stop after this many policy steps (default: no limit) |
--action-units, --state-units |
units for policy actions / observations: auto (default, reads unit_mode from dataset/policy meta/info.json or policy.json, falls back to rad; on SO-ARM101, policy.json without unit_mode fails closed unless units are explicitly provided with --override-unit-mode), rad, so101_norm, or deg |
--override-unit-mode |
allow explicit --action-units or --state-units to override conflicting policy metadata unit_mode |
--task |
task text passed to the policy (language-conditioned policies) |
--device |
torch device (default cuda when available, else cpu) |
--no-park |
hold position at the end instead of parking |
--stall-s, --max-frame-age, --max-obs-age |
stop when the policy gives no target for this long (default 1 s), the newest camera frame is older (default 0.5 s), or the newest armd observation is older (default max(0.1 s, 3 observation periods) at the rate armd sends: min of the requested 50 Hz, timing.control_hz and the rate measured at start; checked before every servo frame and policy step) |
--log |
per-step JSON lines (observation age, camera age, inference ms, step lag, action, state) and a summary line |
--i-am-at-the-arm |
required when armd's follower (GET /api/v1/safety/describe device.follower) is not mock or sim, or unknown |
The run is refused before taking the lease when the schema does not give finite joint limits with
min < max or when policy action dimension does not match arm DOF (7 for B601-DM, 6 for SO-ARM101).
The dynamic gripper joint (schema.gripper_joint) is automatically exempted from the lead clip.
Observation, built like a rebot-record row: observation.state = armd positions (converted
to --state-units, float32);
observation.velocity / observation.effort = velocities / torques when the policy has these
inputs; the policy's single image input (for example observation.images.recamera) = the newest
decoded reCamera frame, RGB uint8, resized with PyAV to the policy's input height and width (the
recorder resizes with the same PyAV call before encoding). The action is the joint target, the
recorder's commanded_positions (converted from --action-units back to armd radians). Learned policies are loaded with lerobot's
PreTrainedConfig.from_pretrained, get_policy_class(type).from_pretrained and the saved
pre/post-processors (make_pre_post_processors), and stepped with predict_action (one action per
step; ACT-style policies return the next action of their chunk). Policies with more than one camera
or other inputs are refused.
rebot-onnx-policy/v1 packages (--policy onnx:<dir>) accept an optional "chunking" object in
policy.json: chunk_size (integer in 1..=128, chunk_size * action_dim <= 1024), replan_every
(integer in 1..=chunk_size, default chunk_size), and optional temporal_ensemble_k (finite f32
in 0.0..=100.0). When chunk_size > 1, replan_every * (1000 / fps) <= 1000 ms is enforced at
manifest parse (when fps is declared), at export, and at runner start against effective --fps
(single-step policies chunk_size == 1 are exempt). Model outputs must be flattened [1, K*D] (or
[K*D] in outputs.action.shape, row-major); unflattened [K, D] and [1, K, D] shapes are rejected.
The PC runner routes both single-step (chunk_size == 1) and chunked (chunk_size > 1) manifest
policies through off-lock plan_chunk_step and a single commit_gate(now) right before publishing with
one monotonic clock read: selects commit_period = floor((now - origin) / period), skips passed or
missing slots (chunk_size > 1), checks fresh source ages (clamp(round(2000/fps), 50, 200) ms joint;
vision/embedding + 0 ms) and cached ages (limit + replan_every * period), matches detector target
identity by track ID or label + box IoU >= 0.5 (no frame_id), averages overlapping predictions with
weights exp(-k * age) (oldest first, weight 1) when temporal_ensemble_k is set, drops the ring and
replans next period on expiry or provenance mismatch, and clears the ring on stop/E-stop, fault,
lease/epoch/mode change, or vision hold/stop. PC differences vs onboard armd: PC camera streams have
no detector model_generation, stop/lease events come from the SDK session, and PC loading does not
enforce armd's onboard 4 MiB / 8 MiB + 4 KiB pack byte limits. Without "chunking", single-step
behaviour is unchanged.
Timing: policy steps run at --fps; inference runs on a worker thread and the main loop waits for it
at most until the deadline or --stall-s, then stops, parks and releases the lease (a call that never
returns is abandoned; the warm-up call may take up to 120 s). A sender thread streams servo frames at
--servo-hz: each new target is reached by linear interpolation from the last sent frame (after clipping;
the measured position before the first frame) over one policy period, then held. When the policy ends (end of a replay, --max-steps) the stream
continues until the last segment has reached its target, plus one policy period, before the stop.
During that hold the camera freshness check still applies (camera_stale), and a hold that reaches
--max-seconds ends as max_seconds.
Every frame is clipped per joint to the intersection of the joint limits and, for joints 1..6,
measured position ± 0.95 × servo_max_lead_rad (armd schema, default 0.2 rad); the summary counts
clipped frames per joint and the observation.motion_limit reasons armd reported. A step that is
more than one period late is counted and the schedule restarts from it (no burst of catch-up steps).
Learned policies run one warm-up inference before the stream starts. --max-seconds is an absolute
deadline from the start of the stream, checked by the sender before every frame, so slow inference
does not extend the run. Timing options must be finite and > 0.
Stops: a joint measured so far beyond its limit that the intersection is empty, stale or malformed
armd observation (not 7 finite positions), E-stop, Fault, collision hold, servo blocked hold, torque off, lease loss, servo rejection
(for example MOTION_BUSY), connection loss, policy stall, stale camera frame, a non-finite or
wrong-sized action, policy exception, end of a replayed episode, --max-steps, --max-seconds, Ctrl+C or
SIGTERM. Then the stream ends, the arm holds (motion/stop) and parks (unload) unless
--no-park; no park after a Fault, E-stop, collision hold or lease loss (the summary says why).
No servo frame is sent once a stop is requested; each socket send is bounded to 1 s. If the
sender thread has not ended 2 s after a stop (sender_join_s, at least 1.5 × the send timeout), the runner sends the lease-free REST e-stop and does
not park. Ctrl+C during setup after torque-on was sent (arming, warm-up) also stops and parks the
arm; before that the lease is only released. Once a stop is in progress, further Ctrl+C / SIGTERM
are ignored (a note is printed) until stop, e-stop and park have finished. The runner never clears a fault. Exit code 0 after max_seconds, max_steps or the end of a replay, 130 after
Ctrl+C, else 1. Python API: PolicyRunner(ArmdClient(url), parse_policy(spec), camera).run()
returns a RunResult; a runner runs once, and a policy whose inference was abandoned by an earlier run
(stall or deadline) is refused until that call returns.
Verified (tests/test_policy_runner.py, fake armd): servo frames arrive in order at ~50 Hz without
dropped frames; interpolation between policy steps; lead clip (frames within the lead of the
measured position) and joint-limit clip; stop on fault, E-stop, collision hold, blocked hold, lease
preemption, servo rejection, policy stall, bad action and policy exception; park at the end and
--no-park; the operator flag for a non-mock follower; a replay round trip (recorder dataset ->
replay through the fake armd -> a second recorder run observes the same trajectory); the CLI over
HTTP. A randomly initialised ACT policy (lerobot 0.7.0, built for the recorder's synthetic features:
7-joint state and action, one 64x48 camera) runs 10 steps with images from an H.264 WebSocket
stream in the reCamera format; that test runs when lerobot imports or
REBOT_LEROBOT_PYTHON names a Python with lerobot[dataset], PyAV, pyarrow and scipy, else it is
skipped. The same lerobot calls exist in 0.6.1 (source read, not run).
In the simulator (setup as in Record a LeRobot dataset; armd reports
follower sim, so --i-am-at-the-arm is not needed; image policies take --camera 127.0.0.1):
on spark (2026-11-11, rebot-armd b3ff997) --policy replay:<dataset>:0 of a 3 s episode recorded
from the simulator ran 91 steps and 154 servo frames with 0 late, and parked;
--policy sine:1:0.05:4 --max-seconds 5 ran 150 steps and 250 servo frames with 0 late and
stopped with max_seconds. Not yet run against a real armd, with a learned policy in the
simulator, or with a trained policy.
Simulation worlds and custom end-effectors live in rebot_companion/scenes/ and load on
demand into rebot-sim without embedding scene meshes or sim dependencies into rebot/ or the
reCamera firmware package:
- Tier-0 / Tier-1 asset model: built-in scenes (such as
coffee_kiosk) work offline from native MuJoCo primitives (world.xml). Optional Tier-1 meshes, textures, or datasets download on demand into$REBOT_SCENE_CACHE(default~/.cache/rebot/scenes/<scene_id>/), followingsolution-assetsnaming (<stem>-<md5-first-8>.<ext>) with atomic.partwrites and SHA-256 verification. - Custom end-effectors, ONNX policies & browser WASM sandbox: pass local directories (
scene.json+world.xml,tool.json+tool.xml) or raw MuJoCo XML files torebot-sim --scene ... --tool ..., or hot-swap them at runtime viarebot-scene load(POST /sim/scene). For Agent-driven zero-backend prototyping and RK/arm pre-flight, upload scene/tool/rebot-onnx-policy/v1packages viarebot-scene uploadand switch betweenmode="wasm"(?sim=wasm) andmode="sim"viarebot-scene activate. Virtual I/O tools (suctionviamjEQ_WELD,screwdriver) expose/sim/ioand/api/v1/sandbox/io. Seedocs/agent_sandbox_workflow.md.
rebot-scene list # built-in scenes (coffee_kiosk, pcb_suction) & tools
rebot-scene info pcb_suction # stages, suggested poses, keepout & assets
rebot-scene init ./my_scene --kind scene # starter scene.json + world.xml
rebot-scene init ./my_gripper --kind tool # starter tool.json + tool.xml
rebot-scene init ./my_policy --kind policy --host 127.0.0.1:8765 # starter rebot-onnx-policy/v1; joint_names from armd (or --joint-names j1,...)
rebot-scene validate ./my_policy
rebot-scene upload ./my_policy --armd-url http://127.0.0.1:8765 # with an operator PIN on armd: --operator-pin / $REBOT_OPERATOR_PIN
rebot-scene activate --mode wasm --scene pcb_suction --tool suction --policy my_policy
rebot-scene status --armd-url http://127.0.0.1:8765
rebot-scene load --scene coffee_kiosk --tool wide_cup_gripper
rebot-scene io --set vacuum=true # drive virtual suction/IO on running rebot-sim
rebot-scene asset-hash mesh.stl --prefix rebot/scenes| Script | What it does | Moves the arm |
|---|---|---|
examples/01_atomic_api_demo.py |
reCamera trigger and armd state; --move runs torque on, home, J1 nudge, unload |
only with --move |
examples/02_hand_eye_calib.py |
interactive hand-eye calibration wizard (see above) | no (you pose the arm) |
examples/03_agent_orchestrator.py |
Stage 1 tool-calling pattern: JSON-schema tool definitions and a dispatcher | plan_and_execute_pick only, with --calib |
examples/scenes/coffee_kiosk/coffee_kiosk_fsm.py |
4-stage mobile coffee kiosk workflow using rebot.Arm (--no-vision compares fixed rules vs. detect+grasp) |
yes (run against armd --follower sim or real arm at speed_scale <= 0.5) |
examples/scenes/coffee_kiosk/train_and_eval_demo.py |
multi-seed coffee_kiosk stage evaluator and optional LeRobot v3.0 episode recorder (--record-dir) |
yes, unless --dry-run |
examples/scenes/pcb_suction/pcb_suction_fsm.py |
3-stage PCB suction pick/test/outfeed workflow over divider_wall using rebot.Arm and virtual vacuum I/O |
yes (run against armd --follower sim or real arm at speed_scale <= 0.5) |
examples/04_hardened_pick_place.py |
Stage 2 pick & place cycles through B601IkAdapter |
yes, unless --dry-run |
uv run python examples/01_atomic_api_demo.py --url http://192.168.42.1:8090 --arm-url http://<armd-host>:8765
uv run python examples/03_agent_orchestrator.py --calib calibration.json # or --dry-run without a calibration
uv run python examples/04_hardened_pick_place.py --dry-run # detect + workspace check, arm does not move
uv run python examples/04_hardened_pick_place.py --calib calibration.json --cycles 1Calibration handling in examples 03 and 04: the file is loaded with
HandEyeCalibration.load_result(), so eye_to_hand and eye_in_hand files both work. Without a
calibration file, both examples use a placeholder transform that is not a calibration: example 03
marks its positions as not real and refuses plan_and_execute_pick unless --dry-run is set;
example 04 exits with an error unless --dry-run is set.
Pipeline results: a cycle without an IK solver (dry run) ends with success=False,
stage="dry_run"; stage="completed" means the arm ran the whole cycle. Cycle steps: open the
gripper in place, approach (+80 mm) and grasp with the gripper open, close the gripper, lift,
place, open the gripper, then finish_action (default unload). The gripper is joint index 6
of armd's 7-joint vector: ik.GRIPPER_OPEN = -5.7 (open) .. ik.GRIPPER_CLOSED = 0.0
(closed); armd's gripper joint limit is -5.75 .. 0.10. Before any motion the pipeline rejects
targets farther than PipelineConfig.max_allowed_distance (default 0.80 m) from the base or
below z = -0.05 m.
This SDK and the MCP server move a real arm. Software limits reduce risk; they do not make the arm safe to stand next to.
- Keep people, hands and loose objects out of the arm's reach while it is torqued. Keep the
web cockpit or another E-stop path at hand;
ArmdClient.e_stop()and the MCPe_stoptool work without a lease. - rebot-armd is the component that enforces limits. In its source (commit
5aba3d5): joint position and velocity limits, a workspace check (floor, box and reach bounds) that rejects targets and Cartesian paths outside it withWORKSPACE_VIOLATION, Cartesian speed caps (linear ≤ 0.15 m/s, angular ≤ 1.0 rad/s), and a lease watchdog that parks the arm (or holds and latches a fault) when heartbeats stop while it is torqued. The values depend on the armd build and its configuration; check them on your armd. - This SDK adds client-side checks: MCP input limits (see the tools table), the servo step check (0.35 rad), the pipeline distance check, and the session's safe exit on errors.
- Start new code with low speeds, short moves and dry runs (
--dry-runin examples 03 and 04). - Do not run motion with a placeholder or unverified hand-eye calibration.
--allow-preempt,--allow-clear-fault, and--allow-safety-configlet an agent take control from a person at the cockpit, clear faults, and modify keep-out/collision-guard configuration. They are off by default.
uv sync --all-extras
uv run ruff check && uv run ruff format --check
uv run pytest -q
node tools/gen_web_fixtures.mjs ../rebot-armd-public/src/api/index.html # regenerate JS reference valuesThe tests use in-process fakes (armd: tests/fake_armd.py) and recorded fixtures; they need no
hardware. CI (.github/workflows/ci.yml) runs ruff and pytest with all extras on Python 3.10,
3.11, 3.12 and 3.13, and the rebot tests on Python 3.8 with only pytest and websockets
installed. tests/test_integration_armd.py runs only when ARMD_BIN points to an armd binary. See CONTRIBUTING.md and SECURITY.md.
- Model Context Protocol (MCP): Open standard for connecting AI agents to real-world tools;
- rebot-armd: Rust arm daemon with LeRobot Parquet recording;
- Seeed Studio: reCamera SG2002 smart sensor & reBot B601-DM arm platform;
- OpenCV: Camera calibration and computer vision algorithms.
MIT, see LICENSE. Copyright (c) 2026 Seeed Studio & Contributors.
tests/fixtures/reBot-DevArm_gripper.urdf is derived from the
reBot-DevArm URDF, which is licensed under
the CERN Open Hardware Licence Version 2 - Weakly Reciprocal (CERN-OHL-W-2.0).
{ "version": 1, "kind": "hand_eye_calibration", "setup": "eye_to_hand", // or "eye_in_hand" "method": "point_registration_horn", // or "axxb_park_martin" "assumption": "...", "units": {"length": "m", "angle": "deg"}, "created": "...", "marker_id": 0, "result": { "T_cam_to_base": [[...4x4...]], // "T_cam_to_gripper" for eye_in_hand; p_target = T @ p_cam "translation_m": [x, y, z], "euler_rpy_deg": [roll, pitch, yaw], "euler_convention": "R = Rz(yaw) Ry(pitch) Rx(roll)", "rmse_m": 0.0012, "max_error_m": 0.0021, "residuals_m": [...], "samples": 9, "solved_at": "...", "rot_residuals_deg": [...], "rot_rmse_deg": 0.3, // axxb only "T_marker_to_gripper": [[...]] // axxb only ("T_marker_to_base" for eye_in_hand) }, "samples": [{"joints": [...], "p_base": [...], "p_cam": [...], "R_cam": [[...]], "rpy_cam_deg": [...], "marker_id": 0, "T_base_gripper": [[...]], "T_cam_marker": [[...]], "tcp_pitch": 0.5, "ts": "..."}], "transform": {"translation": [...], "euler_deg": [...], "matrix": [[...]]} // legacy SDK block }