Files
gps-denied-desktop/components/failure_recovery_coordinator/base.py
T
Oleksandr Bezdieniezhnykh abc26d5c20 initial structure implemented
docs -> _docs
2025-12-01 14:20:56 +02:00

69 lines
1.5 KiB
Python

from abc import ABC, abstractmethod
from typing import Optional
import numpy as np
from models.recovery import (
SearchSession,
ConfidenceAssessment,
UserAnchor,
UserInputRequest,
)
from models.core import GPSPoint
from models.satellite import TileCandidate
class FailureRecoveryCoordinatorBase(ABC):
@abstractmethod
async def start_search_session(
self,
flight_id: str,
frame_id: int,
estimated_center: GPSPoint,
) -> SearchSession:
pass
@abstractmethod
async def expand_search(
self, session_id: str
) -> Optional[list[TileCandidate]]:
pass
@abstractmethod
async def assess_confidence(
self, flight_id: str, frame_id: int
) -> ConfidenceAssessment:
pass
@abstractmethod
async def request_user_input(
self,
flight_id: str,
frame_id: int,
uav_image: np.ndarray,
candidates: list[TileCandidate],
) -> UserInputRequest:
pass
@abstractmethod
async def process_user_anchor(
self, flight_id: str, anchor: UserAnchor
) -> bool:
pass
@abstractmethod
async def is_recovery_needed(
self, confidence: ConfidenceAssessment
) -> bool:
pass
@abstractmethod
async def get_active_session(
self, flight_id: str
) -> Optional[SearchSession]:
pass
@abstractmethod
async def cancel_session(self, session_id: str) -> bool:
pass