修正朝上判断、接触高度与过期姿态目标

朝上判断误用平台轴、接触高度报旋转前数值、多点对准复用缓存姿态,且多点会话被复核入口拒绝;
现按修正计划改正并接通 autocal-multipoint-1.0 只读复核,缺失帧源如实报告而不补零。

离线验证:新回归在 dc5a6f8 上失败、此处通过,panel_check 通过,两截图点接触高度复现
19.0510 / 21.5781 mm;实机项未做,详见 .scratch/autocal-motion-fix/verification.md。
This commit is contained in:
ykcheungab
2026-10-15 06:52:28 +08:00
parent 5339624ffa
commit bcc55a3b97
29 changed files with 2179 additions and 209 deletions
+54 -6
View File
@@ -100,8 +100,26 @@ def main() -> int:
)
# ---- locale completeness ---------------------------------------------
from orisys_autocal import preferences as prefs_mod
from orisys_autocal.preferences import load_preferences
# Redirect the preference store into the app's own (gitignored) outputs before
# any window exists. This check opens and closes real windows, and closing one
# writes the whole in-memory document back: a check that dials in a press-axis
# zero would otherwise leave that fabricated measurement on the operator's
# machine, and every later run would start from it.
from orisys_app_shared import paths as paths_mod
from orisys_app_shared import prefs as prefs_pkg
scratch = APP_ROOT / "outputs" / "panel_check"
scratch.mkdir(parents=True, exist_ok=True)
scratch_prefs = scratch / "preference.json"
if scratch_prefs.exists():
scratch_prefs.unlink()
paths_mod.preference_path = lambda: scratch_prefs
prefs_pkg.store.preference_path = lambda: scratch_prefs
prefs_mod.preference_path = lambda: scratch_prefs
prefs = load_preferences()
for language in ("zh_CN", "en_US"):
set_locale(language)
@@ -162,9 +180,12 @@ def main() -> int:
print(f" {width}x{height}: the device setup fits")
# ---- the permanent shell ----------------------------------------
# The workspace is five pages: three run screens, the sensor page and the
# calibration-record review. (Multi-point replaced the old surface/points
# pair, so this list is the one workspace.TABS declares.)
checker.that(
window.workspace.page_keys()
== ["axes", "sequence", "finger", "sensor", "surface", "points"],
== ["axes", "sequence", "finger", "sensor", "records"],
f"unexpected tab set: {window.workspace.page_keys()}",
)
checker.that(
@@ -295,16 +316,25 @@ def main() -> int:
window.axis_readout.return_button.parent() is window.axis_readout,
"the return button is not in the always-visible rail",
)
# The mapping page is the third tab of the device setup, and the service
# already holds the mapping it shows.
# The mapping page is the third tab of the device setup, the press-axis
# relation the fourth, and the service already holds the mapping shown.
checker.that(
window.device_setup.tabs.count() == 3,
f"the device setup has {window.device_setup.tabs.count()} tabs, expected 3",
window.device_setup.tabs.count() == 4,
f"the device setup has {window.device_setup.tabs.count()} tabs, expected 4",
)
checker.that(
window.device_setup.tabs.tabText(2) == t("setup.tab_axes"),
f"the third setup tab is {window.device_setup.tabs.tabText(2)!r}",
)
checker.that(
window.device_setup.tabs.tabText(3) == t("setup.tab_press"),
f"the fourth setup tab is {window.device_setup.tabs.tabText(3)!r}",
)
checker.that(
window.device_setup.press_page.press()["calibrated"] is False,
f"the press page starts calibrated: "
f"{window.device_setup.press_page.press()}",
)
# With no controller, a move must be refused with a reason and the execute
# button must say so rather than appearing to work.
disconnected = window.poller.service.check_axes_move({"x": 1.0})
@@ -537,6 +567,24 @@ def main() -> int:
"the finger screen solved no pose from its point list",
)
if solve is not None:
# The shipped machine has no measured press-axis zero, so the press
# role must come back held: a geometric contact height is not a
# controller coordinate until somebody has measured the relation.
held_targets, held_roles = solve
checker.that(
"z" not in held_targets and held_roles == ("z",),
f"an uncalibrated press axis was commanded anyway: "
f"{sorted(held_targets)} held={held_roles}",
)
print(" press: an uncalibrated press axis is held, not commanded")
# Entering the bench's zero — a dialled-in number, as the operator
# would — turns the same height into a coordinate and the move into
# five axes.
page = window.device_setup.press_page
page.zero_spin.setValue(2.0)
page.calibrated_check.setChecked(True)
app.processEvents()
solve = finger.solved_pose()
targets, held = solve
checker.that(
"z" in targets and not held,
@@ -668,7 +716,7 @@ def main() -> int:
try:
window.poller.shutdown()
except Exception: # noqa: BLE001 - a shutdown must not mask the result
except Exception: # noqa: BLE001,S110 - a shutdown must not mask the result
pass
window.close()
app.processEvents()