Skip to content

home(calibrate=): forced end-stop referencing on the waldoctl ABC; StatusBuffer/loop_stats/homing-progress conformance - #34

Merged
Jepson2k merged 3 commits into
mainfrom
feat/calibrate
Sep 2, 2026
Merged

Jepson2k merged 3 commits into
mainfrom
feat/calibrate

Conversation

@Jepson2k

@Jepson2k Jepson2k commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

home() gains a calibrate flag, declared on the waldoctl RobotClient ABC (Jepson2k/waldoctl feat/calibrate) and implemented here:

  • Uncalibrated (first home after power-on): home() runs the firmware's end-stop referencing sequence — each joint seeks its limit switch — and ends at the home position. Unchanged behavior.
  • Calibrated: home() is a planned, collision-checked return to the home position (the existing fast-path). home(calibrate=True) re-runs the referencing sequence instead.

This is the industrial calibrate-vs-home split (KUKA "mastering", ABB "calibration", with "home" as a named pose) and covers the forced-re-reference need behind #33 without changing home()'s default. The referencing sequence is firmware-driven and ignores the collision world; the docstrings say so.

Also in this PR — the RobotClient conformance gaps that CI's ty has been blind to because waldoctl shipped without py.typed (the waldoctl branch adds the marker):

  • StatusBuffer now satisfies waldoctl's Protocol: enabled is broadcast on the wire from ControllerState.enabled (the controller-accepts-motion flag), and the members parol6 has no data for (torques, torques_ext, warnings, link_health, homing, freedrive, mode) hold their documented empty values.
  • loop_stats() returns waldoctl's LoopStatsResult; the loop timer now also computes p50/p90 periods, and the fieldbus/RT fields report 0/False.
  • Homing progress is real, not empty: HomeCommand publishes its step (signalling → waiting for the firmware to clear the homed bits → waiting for every joint) and the per-joint homed bits ride the status wire, so StatusBuffer.homing carries active, sequence_step, and one (HomingJointState, HomingPhase) enum pair per joint — the shape Waldo Commander's status consumer already mirrors for par6. The dict view is rebuilt only when the step or bits change and is empty while idle.

Wire compatibility: HomeCmd.calibrate and the new trailing status fields (enabled, homing_step, joints_homed) are defaulted, so older clients and status producers keep working.

Tests: a planner unit test pins the contract (HOME(calibrate=True) yields an InlineSegment even when referenced); the integration test drives home(calibrate=True) through the real client/server path and asserts the firmware drops the homed flag mid-sequence — which a substituted planned return move never does — and that homing reports SEEKING joints while it runs and is empty afterwards.

🤖 Generated with Claude Code

https://claude.ai/code/session_0158QrPR5eVhd31AvFpxJKr6

Jepson2k and others added 3 commits September 1, 2026 12:55
calibrate() always runs the firmware's referencing sequence (each joint
seeks its limit switch to re-derive joint zero), even when the robot
already reports itself referenced. home() keeps its existing semantics:
a planned, collision-checked return to standby, falling back to the
referencing sequence only on an uncalibrated robot. This matches the
industrial mastering/calibration-vs-home-pose split and aligns parol6
with par6's calibrate behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0158QrPR5eVhd31AvFpxJKr6
…oop_stats conform to waldoctl

home(calibrate=True) always runs the firmware referencing sequence; plain
home() keeps its fast-path once referenced. The flag lives on the waldoctl
RobotClient ABC rather than a backend-only command.

StatusBuffer now satisfies waldoctl's Protocol: `enabled` is broadcast
from ControllerState.enabled, and the members parol6 has no data for
(torques, warnings, link_health, freedrive, mode) hold their documented
empty values. Homing progress is real: HomeCommand publishes its step and
the per-joint homed bits ride the status wire, so StatusBuffer.homing
carries active, sequence_step, and one (HomingJointState, HomingPhase)
pair per joint — the enum shape the waldoctl Homing mirror expects —
rebuilt only on change and empty while idle. loop_stats() returns
waldoctl's LoopStatsResult, with p50/p90 periods computed by the timer.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0158QrPR5eVhd31AvFpxJKr6
…ller

The published homing step is derived from the live HomeCommand (any cancel
path clears action_current), so a stop, e-stop, jog, or reconnect mid-
referencing no longer leaves homing reporting active. HomeCommand writes
its HomeState value once per tick instead of scattered literals. A
hardware e-stop press now sets enabled=False like the digital one, so the
status flag and motion gating agree with the physical switch.

StatusCache scans Homed_in once for both the aggregate homed flag and the
per-joint bits (list-backed, no numpy scalar boxing on the 100Hz path);
the client compares the decoded bit list before rebuilding the homing
view. loop_stats() unpacks the struct instead of copying fields by hand.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0158QrPR5eVhd31AvFpxJKr6
@Jepson2k Jepson2k changed the title Add CALIBRATE: forced end-stop referencing, split from HOME home(calibrate=): forced end-stop referencing on the waldoctl ABC; StatusBuffer/loop_stats/homing-progress conformance Sep 2, 2026
@Jepson2k
Jepson2k merged commit 881fc3c into main Sep 2, 2026
13 checks passed
@Jepson2k Jepson2k mentioned this pull request Sep 2, 2026
@Jepson2k
Jepson2k deleted the feat/calibrate branch September 2, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant