Skip to article

Teleoperation and session replay

Checked 2026-11-01

Result: a checked joint mapping lets the leader control the follower, and a saved session can be replayed without the leader.

Prepare two buses

Use separate serial adapters for leader and follower, 1–6 joint pairs, saved nonempty limits, ordinary position mode and unit resolution. The leader may use factory firmware; the follower requires Extension v9.

Each bus must contain exactly its configured IDs. Disable leader torque beforehand: the tool never writes to the leader. Follower settings must be locked with no deferred Legacy write. Prepare profiles and, if required, a gravity model using the configuration guide.

Configure the file

macOS / Linux
cp tools/teleoperation/example.json tools/teleoperation/controller.local.json
Windows PowerShell
Copy-Item tools/teleoperation/example.json tools/teleoperation/controller.local.json

Set distinct leaderPort and followerPort, baud rate and all joints pairs. The source example contains one pair; expand it for the actual arm. Give each follower a profile, with paths relative to the controller file.

{"leaderId": 1, "followerId": 1, "mapping": "angle", "direction": 1}

This is one joints array entry, not a complete file. Mapping options:

Field Meaning
mapping: "angle" Preserve count displacement from the saved-limit midpoint; assumes compatible encoder scales and gearing
mapping: "range" Scale each half of leader travel to the corresponding follower half, useful for different grippers
direction 1 or −1
leaderMiddle, followerMiddle Optional centers only for range, strictly inside the respective limits

The limit midpoint can differ from reference count 2048. Matching calibration poses therefore do not guarantee matching targets when limits are asymmetric. Targets are capped to follower limits.

Preview and start

This command reads both buses and previews mapping without changing settings:

macOS / Linux
npm run teleoperate -- tools/teleoperation/controller.local.json
Windows PowerShell
npm.cmd run teleoperate -- tools/teleoperation/controller.local.json

Compare reported positions and targets with the physical setup and check each pair’s direction. Support both mechanisms and leave space for the follower to approach the leader pose. Then explicitly start control:

macOS / Linux
npm run teleoperate -- tools/teleoperation/controller.local.json --run
Windows PowerShell
npm.cmd run teleoperate -- tools/teleoperation/controller.local.json --run

Requested hz ranges from 1–60 Hz and defaults to 60; actual rate depends on the bus, computer, feedback and logging. Missed periods are skipped rather than sent in catch-up bursts. Do not run another controller on the same bus.

Check: no stale-frame or feedback errors, correct direction and expected travel limits. Normal completion and Ctrl+C retain powered hold. With a gravity model, completion waits for rest; without one, the process can exit while the motor continues toward the last target. The tool does not automatically move the arm into a parking pose.

Replay without the leader

Logs are saved in logs/motion/. Select SESSION.ndjson containing preflight leader limits and mapping followed by command events. Keep the same joint mapping in the current controller file. Replay opens only the follower:

macOS / Linux
npm run replay -- tools/teleoperation/controller.local.json SESSION.ndjson
Windows PowerShell
npm.cmd run replay -- tools/teleoperation/controller.local.json SESSION.ndjson
macOS / Linux
npm run replay -- tools/teleoperation/controller.local.json SESSION.ndjson --run
Windows PowerShell
npm.cmd run replay -- tools/teleoperation/controller.local.json SESSION.ndjson --run

The first command previews; the second moves. Replay uses recorded leader positions and limits, current follower limits, current profiles and current gravity. It does not replay historical gains or efforts. Recorded pauses remain; processing delays stretch time rather than issuing catch-up bursts.

A log record expressing an intended command does not prove motor acceptance. When reviewing a failed session, compare intended commands, actual transmission and feedback.


Documentation home · Source revision: a995f77. Extension 9.0.