18 lines
869 B
Python
18 lines
869 B
Python
"""Keep arm-specific touch samples and fitted tool offsets separate."""
|
|
|
|
|
|
def check_sample_arm(data, arm):
|
|
recorded = data.get('arm')
|
|
if recorded != arm:
|
|
raise SystemExit(f'样本属于 {recorded or "未标注的"} 臂,当前选择 {arm}。'
|
|
'不能混用;请使用匹配的 --arm,或 capture 新建标定会话。')
|
|
if any(sample.get('arm', recorded) != arm for sample in data.get('samples', [])):
|
|
raise SystemExit('样本中混入不同机械臂的数据,拒绝采集/求解/验证。')
|
|
|
|
|
|
def check_calibration_arm(camera, arm):
|
|
recorded = camera.get('calibration_arm')
|
|
if recorded != arm:
|
|
raise SystemExit(f'触点偏移标定属于 {recorded or "未标注的"} 臂,当前选择 {arm}。'
|
|
'请用当前臂重新 solve,不能复用另一臂的触点偏移。')
|