diff --git a/scripts/dispatcher.py b/scripts/dispatcher.py index 01ed6a7..2540d5c 100644 --- a/scripts/dispatcher.py +++ b/scripts/dispatcher.py @@ -296,13 +296,24 @@ def run_one_stitch(stitch: sqlite3.Row): rows = [] ply_paths = [r["output_ply"] for r in rows if r["output_ply"]] - if len(ply_paths) < 2: + if len(ply_paths) == 0: set_stitch_status(stitch_id, status="error", - error=f"Pas assez de PLY disponibles ({len(ply_paths)})", + error="Aucun PLY disponible", finished_at=_now_iso()) return out_ply = f"{worker['frames_dir']}/stitch_{stitch_id}.ply" + + # Single PLY — no alignment needed, pass through directly. + if len(ply_paths) == 1: + rc, _, err = ssh(worker["ssh_alias"], f"cp {shlex.quote(ply_paths[0])} {shlex.quote(out_ply)}") + if rc != 0: + set_stitch_status(stitch_id, status="error", error=f"cp failed: {err[:200]}", finished_at=_now_iso()) + return + set_stitch_status(stitch_id, status="done", output_ply=out_ply, finished_at=_now_iso()) + print(f" → stitch #{stitch_id} passthrough (1 PLY) → {out_ply}") + _maybe_create_cross_auv_stitch(stitch_id) + return deploy_stitch_script(worker) cmd = (