ProjectsRobot learning

Teleoperation deck, episode recorder and a patched servo driver

The robot-side tooling behind the demonstrations. A browser control deck with gamepad teleoperation and layered stops, a recorder that writes episodes for training, and eight fixes to the vendor's servo driver, each with a measurement.

In progressAug 2026 to nowPage updated

Project facts
Robot
Hiwonder JetRover. Mecanum base, 5-joint arm and gripper, lidar, depth camera, IMU
Compute
Jetson Orin NX 16 GB
Teleoperation
A browser deck over rosbridge, driven by gamepad, keyboard or on-screen sticks
Recording
rosbag2 episodes with a sidecar file for task, outcome and feature map
Tests
362 automated test cases, plus a 36-check script run on the robot
Built with
ROS 2 Humble, Python, JavaScript, rosbag2, Flask
When
Aug 2026 to now
Status
In progress
Code
Private repository. I can walk through it on request.
Page updated
On this page

Why this exists

A policy is only as good as its demonstrations, and the robot’s stock software could not record honest ones. A survey of the running robot found that two of its basic state signals are not measurements at all.

  • The arm’s joint states are the commands, played back. The vendor’s stack stores each position it sends and republishes that value. Nothing reads the servos. Once I could measure them, an arm parked in its start pose read 505, 503 and 763 on three joints where the echo said 500, 500 and 765.
  • The base’s position is integrated from commanded velocity. The controller board sends no wheel data to the computer. A stalled or lifted robot still “drives” in its odometry.

Recording actions next to states that are copies of those actions teaches a policy nothing. So before any learning there was infrastructure to build: a way to drive the robot safely, a way to record what happened, and a driver that reports what the servos really did.

The control deck

The deck is a page served by the robot. It talks to ROS through rosbridge, shows the camera through a rate-limited proxy, and needs no build step: plain JavaScript modules.

The control deck: a camera view, lidar, odometry and attitude panels, and two on-screen sticks with a speed limit

The Drive tab, in the deck's safe-test mode, where the controls publish to test topics and the robot does not move. Commanded and actual velocity are shown side by side.Recorded

The control deck’s Arm tab: six joint sliders, saved poses, and a notice that the arm’s position is unknown

The Arm tab against a simulated robot, after the arm was stopped in the middle of a move. The deck does not pretend to know where the arm is: the sliders stay off until a pose is chosen.Recorded
  • Base. Velocity commands are capped at 0.20 m/s and 0.50 rad/s and sent at 15 Hz while moving. A stop is three zero commands and then silence.
  • Arm and gripper. Joint targets in servo pulses, and a grip mode where the gamepad’s right trigger sets the gripper target at 15 Hz. That trigger is what closed the gripper in every grasping demonstration.
  • Enabling. Only a click turns drive on, and an input that is already held has to pass through neutral first, so a stuck key or a resting thumb cannot start the robot.

Stopping

Teleoperation over a network has to assume the link will fail. The deck stops in layers, and I measured what each layer does and does not catch.

  • In the browser. Drive switches off when the window loses focus, the tab is hidden, the link drops, or the robot stops answering a ping for 2.5 s. Nothing is sent while disconnected.
  • E-stop. A button, the space bar, Escape, or a gamepad button. It sends five zero commands on both velocity topics, switches drive off, locks the arm, and triggers the servos’ own stop, twice. Only a pointer click releases it.
  • On the robot. A watchdog node zeroes the base when commands stop arriving for 0.5 s. On the second velocity topic, where silence is normal, it stops the base when a publisher disappears while the last command was not zero.

That second guard, tested in an isolated ROS domain:

Case Result
A steady 4 s hold Left alone
A clean exit while driving Stopped 69 ms later
A node that sent its own stop and then exited Left alone
A node killed without warning Stopped 17.7 s later, when the middleware’s lease ran out
A node that hangs Not caught

The last two rows are the honest part. Graph-based detection is only as fast as the middleware’s liveness timeout, and it cannot see a publisher that is alive but stuck. A deadline on the message stream would catch both; that is what the first guard does on the topic where a steady stream is expected.

Recording episodes

The recorder is a ROS node that writes rosbag2 episodes, controlled from the deck.

  • It stores raw messages as they arrive, with no resampling: by default 20 topics, among them the compressed camera image, lidar, IMU, transforms, the measured servo positions, both velocity topics, the servo commands and the gripper force.
  • An episode starts with a task description and ends with an outcome and notes. Marks can be dropped during it.
  • It stops by itself after 15 minutes, when free disk space falls under 5 GB, or when the clock jumps by more than 2 s.
  • Next to each bag it writes a sidecar file: task, outcome, marks, stop reason, message counts per topic, camera intrinsics, and a map of state and action features with their units, so an episode can be converted for training without guessing.

The grasping demonstrations themselves use a separate recorder, written later for that experiment, which aligns both cameras, the joints and the force window at 30 Hz. It is described on the force-aware grasping page.

The servo driver: eight defects

All of this depends on the vendor’s driver for the servo controller board. Seven of the defects below were in it. The eighth I introduced while fixing the sixth.

Defect Fix
D1 A servo read waited forever. One missed reply froze the base and arm commands Every read has a 100 ms deadline, and reads run apart from motor commands
D2 Replies were never matched to requests, and a full one-slot queue dropped the new reply Stale replies are drained first; a reply must match in length, command and servo id
D3 Asking for voltage or torque called functions that do not exist and crashed the node The right functions are called; a failed read reports failure
D4 The torque switch had its two codes swapped. It dropped the arm once The codes are swapped back, and every switch is confirmed by reading it back
D5 The gripper stops short of its target against its own friction and keeps pushing: 74 to 78 °C after every restart, against a limit of 85 °C The driver reads where the gripper stopped and holds it there. A grasp is eased to a holding grip and relaxed at 75 °C
D6 Nothing published measured positions A topic with all six measured positions at 30 Hz, only while something subscribes
D7 Any malformed message killed the node. The board holds the last wheel speed, so a crash while driving meant a runaway base Every callback is guarded, any exit zeroes the motors, and the driver respawns
D8 Mine, from D6. The position polling took the bus lock again within microseconds, so waiting commands lost every time: more than half were dropped and the rest arrived up to half a second late The polling steps aside before each read whenever a command is waiting

Measured on the robot with the stack running, 16 November 2026:

What Result
One servo read 3.7 ms median
Measured positions 30.0 Hz, all six servos in every message
Driver CPU when idle 12.0 %, against 16.7 % for the vendor’s
Respawn after a forced kill New process in 2.0 s
Gripper temperature after a restart 33 to 34 °C, flat for 5 minutes

And for D8, on a fake board on the loaded robot, 120 commands at 60 Hz while positions are polled:

Before After
Commands that reached the bus 56 of 120 120 of 120
Wait, median 199 ms 10 ms
Wait, longest 468 ms 20 ms

Tests

362 automated test cases cover the logic that can be tested without the robot: 227 in Python for the deck’s services, 40 for the driver against a fake controller board, and 95 in JavaScript for teleoperation, the arm stop, the gamepad and the link handling. A 36-check script then verifies the driver on the robot itself.

Limits

  • The supervised first-motion checkout of the deck is not finished: its later steps are still to do.
  • The arm’s E-stop is proven down to the packet on the serial line, and on an arm that was standing still. It has not been proven on a moving arm.
  • The deck’s autonomy mode runs in dry run. Nothing moves.
  • Long grasps settle near the gripper’s 75 °C guard after about five minutes, so a long hold still needs force control and not a position offset.