mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-22 22:26:38 +00:00
put rest and sse to acceptance criteria. revise components. add system flows diagram
This commit is contained in:
@@ -43,6 +43,10 @@ class IFlightAPI(ABC):
|
||||
@abstractmethod
|
||||
def create_sse_stream(self, flight_id: str) -> SSEStream:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def convert_object_to_gps(self, flight_id: str, frame_id: int, pixel: Tuple[float, float]) -> ObjectGPSResponse:
|
||||
pass
|
||||
```
|
||||
|
||||
## Component Description
|
||||
@@ -367,6 +371,50 @@ UserFixResponse:
|
||||
|
||||
---
|
||||
|
||||
### `convert_object_to_gps(flight_id: str, frame_id: int, pixel: Tuple[float, float]) -> ObjectGPSResponse`
|
||||
|
||||
**REST Endpoint**: `POST /flights/{flightId}/frames/{frameId}/object-to-gps`
|
||||
|
||||
**Description**: Converts object pixel coordinates to GPS. Used by external object detection systems (e.g., Azaion.Inference) to get GPS coordinates for detected objects.
|
||||
|
||||
**Called By**:
|
||||
- External object detection systems (Azaion.Inference)
|
||||
- Any system needing pixel-to-GPS conversion for a specific frame
|
||||
|
||||
**Input**:
|
||||
```python
|
||||
ObjectToGPSRequest:
|
||||
pixel_x: float # X coordinate in image
|
||||
pixel_y: float # Y coordinate in image
|
||||
```
|
||||
|
||||
**Output**:
|
||||
```python
|
||||
ObjectGPSResponse:
|
||||
gps: GPSPoint
|
||||
accuracy_meters: float # Estimated accuracy
|
||||
frame_id: int
|
||||
pixel: Tuple[float, float]
|
||||
```
|
||||
|
||||
**Processing Flow**:
|
||||
1. Validate flight_id and frame_id exist
|
||||
2. Validate frame has been processed (has pose in Factor Graph)
|
||||
3. Call F13.image_object_to_gps(pixel, frame_id)
|
||||
4. Return GPS with accuracy estimate
|
||||
|
||||
**Error Conditions**:
|
||||
- `400 Bad Request`: Invalid pixel coordinates
|
||||
- `404 Not Found`: flight_id or frame_id not found
|
||||
- `409 Conflict`: Frame not yet processed (no pose available)
|
||||
|
||||
**Test Cases**:
|
||||
1. **Valid conversion**: Object at (1024, 768) → returns GPS
|
||||
2. **Unprocessed frame**: Frame not in Factor Graph → returns 409
|
||||
3. **Invalid pixel**: Negative coordinates → returns 400
|
||||
|
||||
---
|
||||
|
||||
### `get_flight_status(flight_id: str) -> FlightStatusResponse`
|
||||
|
||||
**REST Endpoint**: `GET /flights/{flightId}/status`
|
||||
|
||||
Reference in New Issue
Block a user