diff --git a/dwarfctl/cmd/dwarfctl/main.go b/dwarfctl/cmd/dwarfctl/main.go index 4e0ba08..5c131e5 100644 --- a/dwarfctl/cmd/dwarfctl/main.go +++ b/dwarfctl/cmd/dwarfctl/main.go @@ -408,15 +408,15 @@ func cmdAstro() *cobra.Command { c.AddCommand( &cobra.Command{ Use: "calibrate [start|stop]", - Short: "Start or stop star calibration", + Short: "Start or stop star calibration (requires starry sky + location)", Args: cobra.ExactArgs(1), Run: func(_ *cobra.Command, args []string) { scope, cleanup := dial() defer cleanup() switch args[0] { case "start": - must(scope.StartCalibration()) - fmt.Println("calibration started") + must(scope.StartCalibrationWithLocation(2.3522, 48.8566)) + fmt.Println("calibration started (lon=2.35 lat=48.85)") case "stop": must(scope.StopCalibration()) fmt.Println("calibration stopped") diff --git a/dwarfctl/internal/api/client.go b/dwarfctl/internal/api/client.go index be678ac..b6d55ab 100644 --- a/dwarfctl/internal/api/client.go +++ b/dwarfctl/internal/api/client.go @@ -238,9 +238,16 @@ func (t *Telescope) SetFocusInfinityPos(pos int32) error { // --- Astro commands --- -// StartCalibration begins star calibration. +// StartCalibration begins star calibration. Requires lon/lat and a starry sky. +// This is the ONLY way to home motors and get absolute positioning. func (t *Telescope) StartCalibration() error { - _, err := t.sendEmpty(CmdAstroStartCalibration) + _, err := t.send(CmdAstroStartCalibration, &pb.ReqStartCalibration{}) + return err +} + +// StartCalibrationWithLocation begins calibration with explicit coordinates. +func (t *Telescope) StartCalibrationWithLocation(lon, lat float64) error { + _, err := t.send(CmdAstroStartCalibration, &pb.ReqStartCalibration{Lon: lon, Lat: lat}) return err }