CmvrControlStation/docs/superpowers/plans/2026-09-30-tcp-calibration.md

3.8 KiB

TCP calibration migration implementation plan

Goal: fill existing navigation slot 13 with phone-equivalent fixed-point TCP calibration, using verified robot feedback and local QSettings persistence explicitly approved by the user.

Initial migration scope: retain Qt 5.12.4 / MinGW 7.3 / C++14, existing .pro fixes and certificate. Reuse current checkout because the user builds this exact project in Qt Creator. No robot motion, controller writes, new navigation or dependency installation in that phase.

Verified design:

  • Current TCP panel is createCalibrationEntryPage in mainwindow.cpp; no TCP .ui/class/CRUD exists. Keep its stack position. Dynamic internal widget follows panel/sectionTitle/mutedLabel/primaryButton and mechanical-arm tables; no global stylesheet changes.
  • phone scripts/handeye_calibration_gui.py solve_tcp_offset: >=4 base-to-flange poses, metres and ZYX Euler radians, Rz Ry Rx; stacked [R,-I] least squares. RMS mm, save blocked above 2mm. Orientation is manual, never claimed calibrated.
  • Existing getPose ignores requested flange on vendor backends; getPoseMatrix is unimplemented. Reuse RobotClient worker/channel and getRobotState, require verified AUBO vendor, validate stopped/connected/finite feedback. Derive flange with phone robot_backend.py transform chain from explicit user-confirmed active server TCP offset. Never use telemetry display cache or simulated samples.
  • No TCP save RPC/config fields. User explicitly selected local QSettings, separate local tool names and controller frames. Persist per endpoint and device. Do not make local selection change motion/controller settings.

Tasks / verification:

  • Numerical module + tests: known pivot solution, rank/conditioning, invalid finite inputs, duplicate poses, noisy/high-error sets, Euler and flange/tool conversions. Compare Python phone solver.
  • Additive worker request/result with request token; false/demo/disconnected/vendor unsupported/state errors return explicit failure. UI ignores late results after reset/device/session changes.
  • Local tool store tests: namespace isolation, restart reload, bad data, duplicate name/update, current selection, sync failure reporting.
  • Populate existing TCP page: tool name/list, manual orientation, active server TCP offset confirmation, 4+ sample rows, capture/overwrite, solve/clear/save/reload, residuals and RMS, local tool preview; log via MainWindow and use QMessageBox.
  • UI tests with injected result signals (no hardware) for capture flow, source/tool changes, late responses, errors, invalid RMS, round-trip save/reload. Offscreen render inspect.
  • Build existing Debug target, review changes, report precise limitations (local persistence, manually confirmed active TCP, AUBO pose adapter, hardware not tested).

User-requested follow-up: remove vendor/connection banner; return saved TCPs to the current robot's speed-control selector and actually use offsets for movement. This supersedes the initial phase's no-motion UI scope (no hardware commands are run during development).

  • Preserve per-endpoint/per-device QSettings storage and connect save/update/delete to the same robot's tool selector.
  • Generic calibration UI with clear separation of the profile being edited and the profile selected for motion.
  • Bounded local-tool jogging via verified MoveL(base,tcp) with fresh feedback and rigid-transform compensation; cancellable on release/context/stop/timeout.
  • Invalidate active-TCP confirmation before ordinary named MoveL and mutable ArmService RPCs.
  • Numerical/state-machine tests, robot-isolated UI/store tests and real loopback gRPC integration using MainWindow/RobotClient. Document finite-step and vendor-adapter limits.
  • Build the complete app to an alternate filename because the user's original executable is running; preserve the process.