Persist rover observation configuration and calibrate Insta360 panorama

This commit is contained in:
DCCONSTRUCTIONS
2026-10-09 18:17:54 +03:00
parent c43b097a3a
commit b4dab01f2a
36 changed files with 1271 additions and 50 deletions
+19 -16
View File
@@ -41,26 +41,29 @@ type PairState struct {
Revocations []CoreBinding `json:"revocations,omitempty"`
}
type Pairing struct {
Monitor *Monitor
Sensors *Sensors
DeviceEnrollment *DeviceEnrollment
mu sync.Mutex
path string
store *Store
state PairState
now func() time.Time
inventory func() Inventory
version string
lastSeen int64
connection string
listenError string
failureWindow int64
failures int
clients map[string]*http.Client
RoverConfiguration *RoverConfigurationStore
Monitor *Monitor
Sensors *Sensors
DeviceEnrollment *DeviceEnrollment
mu sync.Mutex
path string
store *Store
state PairState
now func() time.Time
inventory func() Inventory
version string
lastSeen int64
connection string
listenError string
failureWindow int64
failures int
clients map[string]*http.Client
}
func OpenPairing(store *Store, dir, version string, inventory func() Inventory) (*Pairing, error) {
p := &Pairing{store: store, path: filepath.Join(dir, "core-binding.json"), now: time.Now, inventory: inventory, version: version, connection: "offline", clients: make(map[string]*http.Client), state: PairState{Schema: PairSchema, Phase: "unpaired"}}
id, name := store.Public()
p.RoverConfiguration = OpenRoverConfiguration(dir, id, name)
data, e := os.ReadFile(p.path)
if os.IsNotExist(e) {
return p, nil