mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-23 00:16:37 +00:00
fix issues
This commit is contained in:
@@ -59,6 +59,27 @@ class IFlightProcessor(ABC):
|
||||
def validate_flight_continuity(self, waypoints: List[Waypoint]) -> ValidationResult:
|
||||
pass
|
||||
|
||||
# API Delegation Methods (called by F01)
|
||||
@abstractmethod
|
||||
def queue_images(self, flight_id: str, batch: ImageBatch) -> BatchQueueResult:
|
||||
"""Delegates to F05 Image Input Pipeline."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def handle_user_fix(self, flight_id: str, fix_data: UserFixRequest) -> UserFixResult:
|
||||
"""Delegates to F11 Failure Recovery Coordinator."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def create_client_stream(self, flight_id: str, client_id: str) -> StreamConnection:
|
||||
"""Delegates to F15 SSE Event Streamer."""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def convert_object_to_gps(self, flight_id: str, frame_id: int, pixel: Tuple[float, float]) -> GPSPoint:
|
||||
"""Delegates to F13 Coordinate Transformer."""
|
||||
pass
|
||||
|
||||
# Processing Orchestration
|
||||
@abstractmethod
|
||||
def process_frame(self, flight_id: str, frame_id: int) -> FrameResult:
|
||||
@@ -576,6 +597,129 @@ ValidationResult:
|
||||
|
||||
---
|
||||
|
||||
## API Delegation Methods
|
||||
|
||||
These methods are called by F01 Flight API and delegate to specialized components. This maintains F02 as the single coordinator for all operations.
|
||||
|
||||
### `queue_images(flight_id: str, batch: ImageBatch) -> BatchQueueResult`
|
||||
|
||||
**Description**: Queues image batch for processing. Delegates to F05 Image Input Pipeline.
|
||||
|
||||
**Called By**:
|
||||
- F01 Flight API (upload_image_batch endpoint)
|
||||
|
||||
**Input**:
|
||||
```python
|
||||
flight_id: str
|
||||
batch: ImageBatch
|
||||
```
|
||||
|
||||
**Output**:
|
||||
```python
|
||||
BatchQueueResult:
|
||||
accepted: bool
|
||||
sequences: List[int]
|
||||
next_expected: int
|
||||
message: Optional[str]
|
||||
```
|
||||
|
||||
**Processing Flow**:
|
||||
1. Validate flight exists and is in valid state
|
||||
2. Delegate to F05 Image Input Pipeline → queue_batch()
|
||||
3. Return result to F01
|
||||
|
||||
---
|
||||
|
||||
### `handle_user_fix(flight_id: str, fix_data: UserFixRequest) -> UserFixResult`
|
||||
|
||||
**Description**: Handles user-provided GPS fix. Delegates to F11 Failure Recovery Coordinator.
|
||||
|
||||
**Called By**:
|
||||
- F01 Flight API (submit_user_fix endpoint)
|
||||
|
||||
**Input**:
|
||||
```python
|
||||
flight_id: str
|
||||
fix_data: UserFixRequest:
|
||||
frame_id: int
|
||||
uav_pixel: Tuple[float, float]
|
||||
satellite_gps: GPSPoint
|
||||
```
|
||||
|
||||
**Output**:
|
||||
```python
|
||||
UserFixResult:
|
||||
accepted: bool
|
||||
processing_resumed: bool
|
||||
message: Optional[str]
|
||||
```
|
||||
|
||||
**Processing Flow**:
|
||||
1. Validate flight exists and is blocked
|
||||
2. Delegate to F11 Failure Recovery Coordinator → apply_user_anchor()
|
||||
3. F11 emits UserFixApplied event (F02 subscribes and resumes processing)
|
||||
4. Return result to F01
|
||||
|
||||
---
|
||||
|
||||
### `create_client_stream(flight_id: str, client_id: str) -> StreamConnection`
|
||||
|
||||
**Description**: Creates SSE stream for client. Delegates to F15 SSE Event Streamer.
|
||||
|
||||
**Called By**:
|
||||
- F01 Flight API (create_sse_stream endpoint)
|
||||
|
||||
**Input**:
|
||||
```python
|
||||
flight_id: str
|
||||
client_id: str
|
||||
```
|
||||
|
||||
**Output**:
|
||||
```python
|
||||
StreamConnection:
|
||||
stream_id: str
|
||||
flight_id: str
|
||||
client_id: str
|
||||
last_event_id: Optional[str]
|
||||
```
|
||||
|
||||
**Processing Flow**:
|
||||
1. Validate flight exists
|
||||
2. Delegate to F15 SSE Event Streamer → create_stream()
|
||||
3. Return StreamConnection to F01
|
||||
|
||||
---
|
||||
|
||||
### `convert_object_to_gps(flight_id: str, frame_id: int, pixel: Tuple[float, float]) -> GPSPoint`
|
||||
|
||||
**Description**: Converts object pixel to GPS. Delegates to F13 Coordinate Transformer.
|
||||
|
||||
**Called By**:
|
||||
- F01 Flight API (convert_object_to_gps endpoint)
|
||||
|
||||
**Input**:
|
||||
```python
|
||||
flight_id: str
|
||||
frame_id: int
|
||||
pixel: Tuple[float, float]
|
||||
```
|
||||
|
||||
**Output**:
|
||||
```python
|
||||
GPSPoint:
|
||||
lat: float
|
||||
lon: float
|
||||
```
|
||||
|
||||
**Processing Flow**:
|
||||
1. Validate flight and frame exist
|
||||
2. Validate frame has been processed (has pose)
|
||||
3. Delegate to F13 Coordinate Transformer → image_object_to_gps(flight_id, frame_id, pixel)
|
||||
4. Return GPSPoint to F01
|
||||
|
||||
---
|
||||
|
||||
## Processing Orchestration Methods
|
||||
|
||||
### `process_frame(flight_id: str, frame_id: int) -> FrameResult`
|
||||
|
||||
Reference in New Issue
Block a user