Policy Readiness

A policy that works on one arm can wiggle, lag or miss on another, and the cause is rarely the policy alone. solarian analyze-policy checks the whole chain, from calibration through how the arm follows chunks to the task succeeding. It writes a report that ends with a list of what to fix, each item naming the command that fixes it.

The checks are written for UMI-style policies, which plan a chunk of waypoints every second from an observation that is already a few hundred milliseconds old. See Latency & Synchronization for why that age matters.

Before you start

  • The arm, gripper and camera are calibrated, and calibrate-arm, calibrate-gripper and calibrate-camera-latency have written their latencies. The preflight stage checks each one, so a missing one shows up in the report.
  • The robot, the relay and the policy server are running.
  • The robot records traces with every episode, which it does unless conf/robot.yaml sets recording.trace: false.
  • For the vision model's verdicts, conf/controller.yaml configures agent.monitor (see AI Agentic Controller). Without one, you judge each trial yourself.

Describe the check in the skill's config

The command reads a check: block from the policy's skill config. Its tools are entries of your controller's tools. tool runs the policy and is started with config=<this file>. start_tool, view_tool and rest_tool move the arm and are started with the file's arm and gripper. rest_tool, ground unless you name another, moves the arm to where it rests with torque off: the command ends every run there, cuts the arm's and gripper's torque so their motors stop heating, and the next motion command takes it again.

conf/skills/cup_arrange_left_arm.yaml

# ... the policy server, arm, gripper and camera ...

check:
  tool: cup_arrange
  # Where each trial starts, and where the wrist camera sees the result.
  start_tool: home
  view_tool: home
  # Where the arm rests with torque off once the run ends.
  rest_tool: ground
  trials: 5
  # Seconds a trial may run before it is stopped.
  trial_s: 60
  # Always the same objects, so trials compare across days.
  object: the espresso cup and saucer
  # Asked of the wrist frame from view_tool.
  success: >-
    Is the espresso cup standing upright on the saucer, resting in it rather
    than on its rim, with its handle pointing to the left of the image?

Use a physical object that never changes, such as a 3D-printed one, so that a success rate from today compares with one from next week.

Run it

solarian analyze-policy skill=cup_arrange_left_arm

It opens the controller as run-controller does, and runs three stages. stages=tracking runs one stage, and 'stages=[preflight,tracking]' several: quoted, because zsh reads unquoted brackets as a file pattern and stops with no matches found.

  1. Preflight moves nothing. It checks that the joints are calibrated and that the latencies and speed limits have been measured. It also checks clock sync with the relay and whether the policy server answers, and notes which joints have tuned motor_params.
  2. Tracking moves the arm to start_tool, then sends about 25 seconds of synthetic chunks from wherever the policy runs. Like a UMI policy's, they arrive as a new 16-step plan every second, anchored 600 ms in the past, each 25 mm off the last. The path holds still, sweeps a lifted figure-eight with a wrist twist, then dashes between four corners and stops at each. No policy and no scene are involved, so this stage measures the arm and the link alone.
  3. Benchmark runs trials trials. Before each one you reset the scene and press Enter. The arm goes to start_tool, and the policy runs while the robot records, until it finishes or trial_s runs out. The arm then goes to view_tool, and the vision model answers success from the wrist frame. Add confirm=true to confirm or override each verdict.

Each stage's episode is recorded on the robot, and filed in the report's run.json.

Read the report

The report goes to reports/analyze-policy/<skill>/<time>/:

  • summary.md: what to do, the success rate with its 95% interval, a row per trial, and each check against its mark;
  • report.html: plots of every episode, with each chunk marked on the arm's trace;
  • metrics.json: every number, for compare.

The motion analysis reads the robot's recordings. When they are not visible from the controller host, the summary lists the episodes it could not find. Run the same analysis where they are:

solarian analyze-policy report=reports/analyze-policy/cup_arrange_left_arm/<time>

Five trials say less than they seem to: five successes out of five is consistent with a true success rate as low as 57%. That is why the report gives the interval, and why a change is better judged by the motion metrics than by the success count alone.

The marks

The tracking test is held to shape, tip ratio, rest jitter and late ticks. The policy trials are held to every mark except rest jitter, using the median over trials.

MarkAt mostWhat it says
Shape0.7Ringing on the worst joint, after its delay is shifted out, as a fraction of its fast commanded motion
Tip ratio2.5Fast tool-tip motion, measured over commanded
Rest jitter0.1°The worst joint's jitter while the command holds still
Late ticks2%Arm ticks that came more than 1.5 times the median tick after the one before
Observation age500 msHow old the observation each chunk is planned from is
Chunk disagreement15 mmHow far consecutive chunks differ where they overlap
Joint speed bound5%Ticks where a joint speed limit slowed the commanded path

Late ticks mean the arm's tick work is longer, or less even, than its period. A module whose tick overruns starts the next one at once, so the arm updates as fast as its work allows, and as unevenly as that work is. Lowering frequency alone does not help while the work is still longer than the new period. The report's Arm tick work section splits each tick: draining actions (a policy chunk lands here), the control step with its IK solve and joint write, and publishing observations with its joint read. Compare their total with the period, then take load off whichever phase dominates: other modules on the arm's bus, the rates of modules the task does not use, and video encoding while recording.

Shape is the number that separates a wiggle from a lag. A joint that follows late but cleanly has a shape near zero; one that rings on each new chunk has its ringing counted against it. On an EduLite A3 at the vendor position gain (loc_kp 40), the shoulder lift's shape was 1.4 and its tool tip moved 4.2 times as fast as commanded. At loc_kp 20 the shape was 0.57, the tip ratio 1.7, and cup arrange succeeded.

A failing tracking test points at the arm. A tracking pass with a policy failure points at the chunks: the policy changing its mind from one chunk to the next, or planning from an observation that is too old.

Tune the arm

When tracking fails on shape, tip ratio or rest jitter, and its ticks are not late, tune the motor gains. On the robot host:

solarian tune-arm tune=true

Place the arm where the task works. tune-arm runs the same tracking test with the module driven directly, then sweeps the gains the motors' bus declares on the joints that failed: for Robstride, loc_kp 40, 30, 20 and 15, then spd_kp 6 and 4. Between candidates the arm parks at its rest pose while the motors take the new gains with torque off. It writes the candidate with the lowest shape plus a lag penalty into each tuned joint's motor_params. Lowering a gain always lowers the shape and always adds lag, and the penalty stops the sweep from choosing an arm that is clean but late. See tune-arm.

Then run analyze-policy again.

Judge a change

When you try something that should make the motion smoother, run the report before and after it, and line the two up:

solarian analyze-policy 'compare=[<before folder>,<after folder>]'

It prints the success rate, both tests' shape and tip ratio, jerk, the largest jump at a new chunk, observation age and chunk disagreement side by side, and writes them to the after folder's compare.md.

Analyse any recorded episode

The same analysis runs on a single episode recorded any other way, such as a policy run from run-controller:

solarian analyze-episode session=recordings/robot/<robot>/<session> episode=2 arm=left_arm gripper=left_gripper

Was this page helpful?