Ping-pong ball balancing for the Asimov 1

Your Asimov 1 keeps a ping-pong ball on a table-tennis paddle held in its right hand, using only its head camera. Print a holder, calibrate, run one command.

What the robot sees: Albert, an Asimov 1, balancing with albert_v3_final (57 s of a 60 s run). Faces blurred.

Try it in your browser first: the simulator ยท Real runs (head camera, joints, actions): the dataset

What you need

  • An Asimov 1 with menlo-sdk set up (menlo setup), and a gantry or a rope to hang it from for the first runs.
  • A table-tennis paddle with red rubber and a white 40 mm ping-pong ball.
  • Two printouts for the calibration (A4, at 100 %): the camera-calibration stencil albert/calibration_spots_A4.pdf (9 spots to mark on the paddle) and, optionally, the checkerboard data/checkerboard_9x6.png.
  • The paddle holder, 3D-printed from hardware/paddle_holder.stl: PETG, PLA+ or PA12, lying on its flat face, 6 walls or 100 % infill. It plugs into the right wrist cup, held by 4 x M4 x 10 screws through the cup's threads; the paddle's handle is held with 3 zip ties (4.8 mm) over a 1-2 mm rubber strip.
  • A Mac (Apple silicon or Intel; Linux works too) on the robot's Wi-Fi, with uv (brew install uv). uv installs Python 3.12 and everything else.

Quick start on your Mac (5 minutes, no robot)

uvx --from huggingface_hub hf download cetiennec/asimov-pingpong-balance --local-dir asimov-pingpong && cd asimov-pingpong
uv sync --extra albert                                     # about 1 minute
tools/get_asimov_model.sh                                  # Menlo's robot model, next to this folder
uv run python -m albert.run_policy --sim --hand --duration 60 --video demo.mp4
open demo.mp4

This runs the whole pipeline on a simulated Albert: rendered head camera, ball detector, ball predictor, policy, arm. --hand puts the ball back when it falls, rolling, the way a person would; expect a few drops at first, then long catches (about 50 s of balancing in 60 s). demo.mp4 shows the run from outside and through the head camera.

On your robot, from your Mac

  1. Connect. Run uv run menlo setup once to save your robot. In Asimov Manager โ†’ Asimov Edge parameters, set udp-state-host to your Mac's IP address: the robot streams its joint states to one computer only. Check with uv run python -m albert.status (read-only: mode, faults, temperatures, and a photo from the head camera).
  2. Mount the paddle. Print the holder, plug it into the right wrist cup, screw it in, zip-tie the paddle, red side up.
  3. Calibrate (about 30 minutes the first time, 5 after a fall): flat pose, camera, latency. Step by step: docs/calibration.md.
  4. First run, hanging from the gantry (rope taut, E-Stop in reach):
    uv run python -m albert.run_policy --supported --gantry --duration 60 --log logs/first.csv
    
    The arm goes to its starting pose, the head looks at the paddle and the blade is levelled. Put the ball on the blade: balancing starts by itself and waits again whenever the ball falls. At the end the robot is handed back to Menlo's balance controller.
  5. Standing on its own. Leave out --gantry: the legs are held in a stance that keeps the robot upright under joint control. Start with the rope taut and lower it until slack when the script asks.

Everything runs on the Mac: the camera stream and the joint states come over Wi-Fi, the arm targets go back at 50 Hz. For steadier timing you can later run the same scripts on the robot's own computer, started from the Mac (albert/ONBOARD.md).

Each run writes a log (logs/<name>.csv, 50 Hz), the camera detections, the robot recording and the raw head camera. uv run python -m tools.session_stats logs/first.csv sums it up.

Safety, built in. The robot is never left limp: on a normal end, Ctrl+C, an error, a dropped ssh session or a lean beyond the watchdog's limit, the arm glides to its rest pose and the robot is handed to Menlo's balance controller. Scripts that wait for you keep the robot's setpoints alive.

Controllers

albert_v3_final (default) PPO policy trained in a simulation matched to Albert: its measured arm, its camera's noise and latency, leaning on the gantry or standing, with pushes, flicks and shoves
albert_v4 the same, fine-tuned on Albert's arm as measured on 2026-11-22: --ckpt outputs/albert_v4/best.pt
MPC a model-predictive controller, no training: often smoother on a real arm, worth a try if the paddle oscillates. --controller mpc (how it works)

On Albert (60 s runs, the ball put back by hand after a fall):

date controller balancing in 60 s longest catch
2026-11-20 albert_v2A, standing on its own 57 s 46 s
2026-11-22 albert_v3_final 57.2 s 56.3 s
2026-11-22 albert_v4 45.5 s 31.3 s
2026-11-23 MPC, on the gantry 56.9 s 55.6 s
2026-11-23 MPC 59.8 s 59.8 s

Results depend a lot on the calibration of the day: the same policy kept the ball 6 to 57 s on the same afternoon.

Without a robot

uv run python -m albert.run_policy --sim --hand --duration 30               # the full pipeline, simulated
uv run python -m albert.run_policy --sim --freestand --truth-ball           # standing without support
uv run python -m tools.eval_albert outputs/albert_v3_final/best.pt mpc      # success rates in the robot-matched sim

Use a policy in your own code:

from asimov_pp.ppo import load_policy
policy = load_policy("outputs/albert_v3_final/best.pt")   # numpy, ~7 us per call
action = policy(obs)   # 40 observations (ball on the blade, gravity, gyro, arm joints, last actions) -> 5 arm joint steps

How it works

head camera (~22 fps) --> ball detector: white ball on the red blade, in the blade's region only
                             |  ray from the calibrated camera, intersected with the blade (arm model + IMU)
joints + IMU (200 Hz) ----> Kalman predictor: each frame replayed at its capture time (~105 ms old);
                             |  predicts where the ball is now from the blade's tilt and motion
                             v
               policy or MPC --> 5 right-arm joint targets, 50 Hz --> motors

The policies were trained with PPO in MuJoCo on a curriculum (balance, then disturbances), in a simulation matched to the real robot: the arm's delay, gains and friction identified on Albert, the camera's jitter, outliers and dropped frames, and the body's lean on the gantry and standing. To retrain, see train_albert.sh (CPU only, about 1 h on 32 cores).

Files

albert/ everything that runs on the robot: run_policy.py, the calibrations (*.json are Albert's), onboard.sh, safety
asimov_pp/ the simulation: MuJoCo model, environment, ball predictor, PPO
outputs/ the policies: best.pt, the training arguments, logs
hardware/ the paddle holder (paddle_holder.stl, and paddle_holder.py to change it)
docs/ calibration, ball detector, MPC
tools/ robot-matched evaluation, session statistics, arm identification, dataset export

Menlo's robot model is not included: tools/get_asimov_model.sh fetches it from menloresearch/asimov-1.

Limitations

  • No walking while balancing: menlo-sdk's joint control turns Menlo's walking policy off.
  • A fall shifts the camera: recalibrate it (step 5 of the calibration) after any fall.
  • Trained on one robot. If yours differs a lot, identify its arm and retrain (calibration step 8), or use the MPC.

Inspired by zecice/so101-pingpong-balance (SO-101 arm). MIT license.

Downloads last month

-

Downloads are not tracked for this model. How to track
Video Preview
loading

Dataset used to train cetiennec/asimov-pingpong-balance

Space using cetiennec/asimov-pingpong-balance 1