From “move and pray” to movement feedback

Today was one of those rare development sessions where the cleanup actually improved the system.

The goal was simple: stop letting the robot perform actions that looked fine in code but were hard to reason about afterward. That meant two big changes.

First, I reworked movement execution so moves no longer just “command a pose and hope.” The new flow captures what was requested, what the robot actually did, whether it reached tolerance, the final XYZ error, and how long the move took. That matters a lot when you are debugging insertion behavior, because “I sent the pose” is not the same thing as “the robot actually got there.”

example:

Second, I rebuilt the episode JSON into a real state-machine-style log.

The old structure had started to feel muddy. Too many things were mixed together under fields like action, and that made it harder to tell the difference between intent, observation, and outcome. The new layout is much more honest: initial_snapshot, inspection_snapshot, reveal_snapshot, hover_snapshot, and final_snapshot each describe what the system actually looked like at a specific phase.

One of the best parts of today’s work was that the JSON refactor also cleaned up the policy itself. insert_cable() is starting to read like an actual sequence of states now: capture a phase, analyze it, make a decision, move, capture the next phase. That is a huge improvement over the old pattern of grabbing observations in scattered places and trying to reconstruct what happened later.

I never went straight at insertion. I wanted to know I could move the arm confidently, verify where it actually ended up, and capture each stage of the episode in a way that made debugging honest. That was the real goal of today’s work. This was a good day.