| 5 | import type { CameraDiagnostics, CameraPose } from "@shared/index.js"; |
| 6 | |
| 7 | export interface CameraDriver { |
| 8 | readonly kind: "sim" | "visca"; |
| 9 | |
| 10 | start(): void; |
| 11 | stop(): void; |
| 12 | |
| 13 | /** |
| 14 | * Absolute move (mount-frame degrees + raw zoom units). Fire-and-forget: |
| 15 | * the implementation queues/throttles; the latest call wins. Optional |
| 16 | * per-axis speeds (deg/s) — used by "carrot" pursuit to glide: a goal |
| 17 | * slightly ahead, at a speed matched to arrive exactly when the next goal |
| 18 | * lands, never decelerates. |
| 19 | */ |
| 20 | gotoAbsolute(pose: CameraPose, speeds?: { panDps?: number; tiltDps?: number }): void; |
| 21 | |
| 22 | /** Continuous jog. Components in [-1, 1] of max speed; 0 = stop that axis. */ |
| 23 | jog(pan: number, tilt: number, zoom: number): void; |
| 24 | |
| 25 | /** |
| 26 | * Closed-loop velocity pursuit, deg/s per axis. Used while tracking — a |
| 27 | * continuous drive glides where streamed absolute moves stutter (each |
| 28 | * absolute move runs at max speed and hard-stops). |
| 29 | */ |
| 30 | trackRate(panDps: number, tiltDps: number): void; |
| 31 | |
| 32 | /** Command zoom alone (tracking-time zoom updates). */ |
| 33 | setZoom(zoomUnits: number): void; |
| 34 | |
| 35 | /** |
| 36 | * Pin focus at infinity (manual mode + drive to the far stop) — autofocus |
| 37 | * has nothing to lock onto when a long lens points at open sky and hunts |
| 38 | * the image soft. false = back to autofocus. |
| 39 | */ |
| 40 | setFocusInfinity(on: boolean): void; |
| 41 | |
| 42 | /** |
| 43 | * Trigger a single autofocus sweep on the current subject, then hold |
| 44 | * (one-push AF). Used once the plane is zoomed in and vision-centered: the |
| 45 | * lens isn't parfocal, so the infinity far-stop goes soft at high zoom — |
| 46 | * focusing on the actual plane is the only reliable way to stay sharp. |
| 47 | */ |
| 48 | onePushAutofocus(): void; |
| 49 | |
| 50 | /** Stop all motion. */ |
| 51 | stopMotion(): void; |
| 52 | |
| 53 | /** Last pose reported by the camera (inquiry / integrator), or null. */ |
| 54 | getPose(): CameraPose | null; |
| 55 | |
| 56 | /** |
| 57 | * Best-estimate CURRENT pose: the last report dead-reckoned forward by the |
| 58 | * commanded velocity (position replies stall around drives on the real |
| 59 | * camera). Use this for limit guards and control-loop error terms. |
| 60 | */ |
| 61 | getPoseEstimate(): CameraPose | null; |
| 62 | |
| 63 | diagnostics(): CameraDiagnostics; |
| 64 | } |
no outgoing calls
no test coverage detected