mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-22 18:36:40 +00:00
initial structure implemented
docs -> _docs
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
from .base import FactorGraphOptimizerBase
|
||||
from .factor_graph_optimizer import FactorGraphOptimizer
|
||||
|
||||
__all__ = ["FactorGraphOptimizerBase", "FactorGraphOptimizer"]
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional
|
||||
import numpy as np
|
||||
|
||||
from models.core import Pose, GPSPoint
|
||||
from models.results import OptimizationResult, RefinedFrameResult
|
||||
from models.processing import RelativePose
|
||||
|
||||
|
||||
class FactorGraphOptimizerBase(ABC):
|
||||
@abstractmethod
|
||||
async def initialize_graph(self, flight_id: str) -> bool:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def add_odometry_factor(
|
||||
self,
|
||||
flight_id: str,
|
||||
from_frame: int,
|
||||
to_frame: int,
|
||||
relative_pose: RelativePose,
|
||||
) -> bool:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def add_gps_prior(
|
||||
self,
|
||||
flight_id: str,
|
||||
frame_id: int,
|
||||
gps: GPSPoint,
|
||||
covariance: np.ndarray,
|
||||
) -> bool:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def optimize(
|
||||
self, flight_id: str, max_iterations: int = 100
|
||||
) -> OptimizationResult:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_optimized_poses(
|
||||
self, flight_id: str
|
||||
) -> list[RefinedFrameResult]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_pose(
|
||||
self, flight_id: str, frame_id: int
|
||||
) -> Optional[Pose]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def marginalize_old_poses(
|
||||
self, flight_id: str, keep_last_n: int
|
||||
) -> bool:
|
||||
pass
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
from typing import Optional
|
||||
import numpy as np
|
||||
|
||||
from .base import FactorGraphOptimizerBase
|
||||
from models.core import Pose, GPSPoint
|
||||
from models.results import OptimizationResult, RefinedFrameResult
|
||||
from models.processing import RelativePose
|
||||
|
||||
|
||||
class FactorGraphOptimizer(FactorGraphOptimizerBase):
|
||||
async def initialize_graph(self, flight_id: str) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
async def add_odometry_factor(
|
||||
self,
|
||||
flight_id: str,
|
||||
from_frame: int,
|
||||
to_frame: int,
|
||||
relative_pose: RelativePose,
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
async def add_gps_prior(
|
||||
self,
|
||||
flight_id: str,
|
||||
frame_id: int,
|
||||
gps: GPSPoint,
|
||||
covariance: np.ndarray,
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
async def optimize(
|
||||
self, flight_id: str, max_iterations: int = 100
|
||||
) -> OptimizationResult:
|
||||
raise NotImplementedError
|
||||
|
||||
async def get_optimized_poses(
|
||||
self, flight_id: str
|
||||
) -> list[RefinedFrameResult]:
|
||||
raise NotImplementedError
|
||||
|
||||
async def get_pose(
|
||||
self, flight_id: str, frame_id: int
|
||||
) -> Optional[Pose]:
|
||||
raise NotImplementedError
|
||||
|
||||
async def marginalize_old_poses(
|
||||
self, flight_id: str, keep_last_n: int
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user