mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-22 23:46:37 +00:00
initial structure implemented
docs -> _docs
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
from .flight_requests import FlightCreateRequest
|
||||
from .flight_responses import (
|
||||
FlightResponse,
|
||||
FlightDetailResponse,
|
||||
FlightStatusResponse,
|
||||
DeleteResponse,
|
||||
UpdateResponse,
|
||||
BatchUpdateResponse,
|
||||
)
|
||||
from .batch_requests import BatchMetadata, BatchResponse
|
||||
from .user_fix_requests import UserFixRequest, UserFixResponse, ObjectGPSResponse
|
||||
|
||||
__all__ = [
|
||||
"FlightCreateRequest",
|
||||
"FlightResponse",
|
||||
"FlightDetailResponse",
|
||||
"FlightStatusResponse",
|
||||
"DeleteResponse",
|
||||
"UpdateResponse",
|
||||
"BatchUpdateResponse",
|
||||
"BatchMetadata",
|
||||
"BatchResponse",
|
||||
"UserFixRequest",
|
||||
"UserFixResponse",
|
||||
"ObjectGPSResponse",
|
||||
]
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class BatchMetadata(BaseModel):
|
||||
start_sequence: int
|
||||
end_sequence: int
|
||||
batch_number: int
|
||||
|
||||
|
||||
class BatchResponse(BaseModel):
|
||||
accepted: bool
|
||||
sequences: list[int]
|
||||
next_expected: int
|
||||
message: Optional[str] = None
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
from pydantic import BaseModel
|
||||
from ..core.gps_point import GPSPoint
|
||||
from ..core.camera_parameters import CameraParameters
|
||||
from ..flight.geofences import Geofences
|
||||
|
||||
|
||||
class FlightCreateRequest(BaseModel):
|
||||
name: str
|
||||
description: str
|
||||
start_gps: GPSPoint
|
||||
rough_waypoints: list[GPSPoint]
|
||||
geofences: Geofences
|
||||
camera_params: CameraParameters
|
||||
altitude: float
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel
|
||||
from ..core.gps_point import GPSPoint
|
||||
from ..core.camera_parameters import CameraParameters
|
||||
from ..flight.waypoint import Waypoint
|
||||
from ..flight.geofences import Geofences
|
||||
|
||||
|
||||
class FlightResponse(BaseModel):
|
||||
flight_id: str
|
||||
status: str
|
||||
message: Optional[str] = None
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class FlightDetailResponse(BaseModel):
|
||||
flight_id: str
|
||||
name: str
|
||||
description: str
|
||||
start_gps: GPSPoint
|
||||
waypoints: list[Waypoint]
|
||||
geofences: Geofences
|
||||
camera_params: CameraParameters
|
||||
altitude: float
|
||||
status: str
|
||||
frames_processed: int
|
||||
frames_total: int
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class FlightStatusResponse(BaseModel):
|
||||
status: str
|
||||
frames_processed: int
|
||||
frames_total: int
|
||||
current_frame: Optional[int] = None
|
||||
current_heading: Optional[float] = None
|
||||
blocked: bool = False
|
||||
search_grid_size: Optional[int] = None
|
||||
message: Optional[str] = None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class DeleteResponse(BaseModel):
|
||||
deleted: bool
|
||||
flight_id: str
|
||||
|
||||
|
||||
class UpdateResponse(BaseModel):
|
||||
updated: bool
|
||||
waypoint_id: str
|
||||
|
||||
|
||||
class BatchUpdateResponse(BaseModel):
|
||||
success: bool
|
||||
updated_count: int
|
||||
failed_ids: list[str] = []
|
||||
errors: Optional[dict[str, str]] = None
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel
|
||||
from ..core.gps_point import GPSPoint
|
||||
|
||||
|
||||
class UserFixRequest(BaseModel):
|
||||
frame_id: int
|
||||
uav_pixel: tuple[float, float]
|
||||
satellite_gps: GPSPoint
|
||||
|
||||
|
||||
class UserFixResponse(BaseModel):
|
||||
accepted: bool
|
||||
processing_resumed: bool
|
||||
message: Optional[str] = None
|
||||
|
||||
|
||||
class ObjectGPSResponse(BaseModel):
|
||||
gps: GPSPoint
|
||||
accuracy_meters: float
|
||||
frame_id: int
|
||||
pixel: tuple[float, float]
|
||||
|
||||
Reference in New Issue
Block a user