mirror of
https://github.com/azaion/gps-denied-desktop.git
synced 2026-04-22 11:06:36 +00:00
2.0 KiB
2.0 KiB
State Estimator Component
Detailed Description
The State Estimator is the "Brain" of the system. It utilizes a Factor Graph (GTSAM) to fuse information from all sources:
- Relative factors from L1 (Frame
t-1 \to t). - Absolute pose factors from L3 (Frame
t \toWorld). - Prior factors (Altitude, Smoothness).
- User Inputs (Manual geometric constraints).
It handles the optimization window (Smoothing and Mapping) and outputs the final trajectory. It also manages the logic for "350m outlier" rejection using robust error kernels (Huber/Cauchy).
API Methods
add_frame_update
- Input:
timestamp: float,l1_data: L1Result,l3_data: L3Result | None,altitude_prior: float - Output:
EstimatedState - Description:
- Adds a new node to the graph for time
t. - Adds factor for L1 (if tracking valid).
- Adds factor for L3 (if global match found).
- Adds altitude prior.
- Performs incremental optimization (iSAM2).
- Returns optimized state
{ lat, lon, alt, roll, pitch, yaw, uncertainty_covariance }.
- Adds a new node to the graph for time
- Test Cases:
- Sequence with drift -> L3 update snaps trajectory back to truth.
- Outlier L3 input (350m off) -> Robust kernel ignores it, trajectory stays smooth.
add_user_correction
- Input:
timestamp: float,uav_pixel: tuple,sat_coord: LatLon - Output:
void - Description: Adds a strong "Pin" constraint to the graph at the specified past timestamp and re-optimizes.
- Test Cases:
- Retroactive fix -> Updates current position estimate based on past correction.
get_current_state
- Input:
void - Output:
EstimatedState - Description: Returns the latest optimized pose.
Integration Tests
- Full Graph Test: Feed synthetic noisy data. Verify that the output error is lower than the input noise (fusion gain).
Non-functional Tests
- Stability: Ensure graph doesn't explode (numerical instability) over long sequences (2000+ frames).