(base) shimazueiichi@shimadzueiichinoMacBook-Pro r2r2r-scripts % cd ~/r2r2r-scripts && python3 dynamic_tracking_limits/drag_teaching/record_teach_demo.py measure
[RTD   ] 到達許容差は本線 run_pick_place.py の stage 値を使います（区間ごと。一律 8.0° は 2026-10-19 にやめた）:
[RTD   ]   HOME                       2.5°  ← rpp.TOL_HOME（stage1_to_home / HOME 復帰）
[RTD   ]   APPROACH_PICK              2.0°  ← rpp.TOL_APPROACH（approach 系）
[RTD   ]   PICK                       3.0°  ← rpp.TOL_PICK_PLACE（stage4_pick）
[RTD   ]   APPROACH_PICK (lift)       3.0°  ← rpp.TOL_LIFT_BACK（lift の残差 2.19° を吸収）
[RTD   ]   APPROACH_PLACE             3.0°  ← rpp.TOL_APPROACH_PLACE（stage7）
[RTD   ]   PLACE                      3.0°  ← rpp.TOL_PICK_PLACE（stage8_place）
[RTD   ]   APPROACH_PLACE (retreat)   3.0°  ← rpp.TOL_LIFT_BACK（stage10_lift_back）
[RTD   ] 到達を待つ最大時間 = clamp(2.0 + max|Δ|/20*3.0, 8.0, 30.0) 秒（本線と同じ wr._compute_arrival_timeout）
[RTD   ] measure: 上カメラで検出します（repeat=5 interval=0.3s）
[CAM] 接続中カメラ一覧:
  index=0  name=FaceTime HDカメラ
  index=1  name=Iriun Camera
  index=2  name=‎iPhone14 Pro MAXのカメラ
[CAM] 上カメラ(iPhone)  index=2
[CAM] 横カメラ(Iriun)   index=1
[DETECT] resolved top index: 2
[Mac] マット四隅検出中... (10フレーム)
[Mac] ✓ マット四隅検出: 10/10 フレーム成功
[Mac] ✓ 動的homography計算完了
[Mac] ✓ マット範囲: X=[329, 1719] Y=[0, 926]
[06f] TEMPLATES_DIR overridden to: /Users/shimazueiichi/r2r2r-scripts/dynamic_tracking_limits/place/templates
[06f] ROTATION_ANGLES_DEG overridden to: [0, 15, 30, 45, 60, 75]
[06f] SCALES overridden to: [0.85, 1.0, 1.15]
[テンプレ] loading white box templates from: /Users/shimazueiichi/r2r2r-scripts/dynamic_tracking_limits/place/templates
[テンプレ] glob '/Users/shimazueiichi/r2r2r-scripts/dynamic_tracking_limits/place/templates/*.png' → 8 file(s)
[テンプレ]   - white_box_20260520_163829_004.png
[テンプレ]   - white_box_20260520_163838_005.png
[テンプレ]   - white_box_20260520_163846_006.png
[テンプレ]   - white_box_20260520_163905_009.png
[テンプレ]   - white_box_20260520_163912_010.png
[テンプレ]   - white_box_20260520_163918_011.png
[テンプレ]   - white_box_20260520_163923_012.png
[テンプレ]   - white_box_20260520_163929_013.png
[テンプレ] 計 8 枚 (day165=8, auto=0)
[06f] WARN: 輪郭中心とテンプレ中心の距離が閾値超 |Δ|=106.5px > 60px → 輪郭捨てて fallback
[06f] DETECT: center=(1513,553) source=template_fallback score=0.646 angle=0° scale=0.85 size=(167x156) template=white_box_20260520_163838_005.png (eval 5.16s)
[DETECT][1/5] box Unity=(-0.220,+0.189) score=0.6458257436752319
  赤ブロック pixel=(438, 701) → Unity=(0.2650, 0.2538)
[DETECT][1/5] block Unity=(+0.265,+0.254) score=null
[06f] WARN: 輪郭中心とテンプレ中心の距離が閾値超 |Δ|=105.7px > 60px → 輪郭捨てて fallback
[06f] DETECT: center=(1513,553) source=template_fallback score=0.645 angle=0° scale=0.85 size=(167x156) template=white_box_20260520_163838_005.png (eval 5.26s)
[DETECT][2/5] box Unity=(-0.220,+0.189) score=0.6451206207275391
  赤ブロック pixel=(584, 570) → Unity=(0.2000, 0.1914)
[DETECT][2/5] block Unity=(+0.200,+0.191) score=null
[06f] WARN: 輪郭中心とテンプレ中心の距離が閾値超 |Δ|=105.7px > 60px → 輪郭捨てて fallback
[06f] DETECT: center=(1513,553) source=template_fallback score=0.646 angle=0° scale=0.85 size=(167x156) template=white_box_20260520_163838_005.png (eval 5.22s)
[DETECT][3/5] box Unity=(-0.220,+0.189) score=0.645586371421814
  赤ブロック pixel=(584, 569) → Unity=(0.2000, 0.1909)
[DETECT][3/5] block Unity=(+0.200,+0.191) score=null
[06f] WARN: 輪郭中心とテンプレ中心の距離が閾値超 |Δ|=105.7px > 60px → 輪郭捨てて fallback
[06f] DETECT: center=(1513,553) source=template_fallback score=0.644 angle=0° scale=0.85 size=(167x156) template=white_box_20260520_163838_005.png (eval 5.07s)
[DETECT][4/5] box Unity=(-0.220,+0.189) score=0.6442099809646606
  赤ブロック pixel=(584, 569) → Unity=(0.2000, 0.1909)
[DETECT][4/5] block Unity=(+0.200,+0.191) score=null
[06f] WARN: 輪郭中心とテンプレ中心の距離が閾値超 |Δ|=105.7px > 60px → 輪郭捨てて fallback
[06f] DETECT: center=(1513,553) source=template_fallback score=0.644 angle=0° scale=0.85 size=(167x156) template=white_box_20260520_163838_005.png (eval 5.07s)
[DETECT][5/5] box Unity=(-0.220,+0.189) score=0.6444384455680847
  赤ブロック pixel=(585, 570) → Unity=(0.1996, 0.1914)
[DETECT][5/5] block Unity=(+0.200,+0.191) score=null
[RTD   ] measure: block = (+200.0, +191.4) mm
[RTD   ] measure: box   = (-219.8, +188.8) mm  score=0.6451206207275391
[RTD   ] 確認画像: /Volumes/KIOXIA/r2r2r-data/mecharm_calibration/teach_poses_20261109/measure_20261109_092616.jpg
[RTD   ] homography のもとになった四隅と、測り直した四隅の差: 最大 0.36px（上限 15.0px・やり直し 1 回）
[RTD   ] ブロックのばらつき: 1.4px = 0.66mm（5 枚・上限 4.0mm）
[RTD   ] 元の検出と測り直しの差: 0.49mm（上限 3.0mm）
[RTD   ] 保存しました: /Volumes/KIOXIA/r2r2r-data/mecharm_calibration/teach_poses_20261109/measure_20261109_092616.json
[RTD   ] 次は Pi で教示 → daemon 起動 → recorder.py --top --no-side 常駐 → run --teach <file> --execute
