mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-23 05:46:38 +00:00
fix: P0+P1 audit — memory leak, hardcoded camera/GPS, lifespan init, background processing, batch validation, ABC interfaces
This commit is contained in:
@@ -155,19 +155,28 @@ async def test_ac4_user_anchor_fix(wired_processor):
|
||||
flight = "ac4_anchor"
|
||||
graph = wired_processor._graph
|
||||
|
||||
# Inject initial pose
|
||||
# Inject two poses
|
||||
graph._init_flight(flight)
|
||||
graph._flights_state[flight]["poses"][0] = Pose(
|
||||
frame_id=0, position=np.zeros(3),
|
||||
orientation=np.eye(3), timestamp=datetime.now(),
|
||||
)
|
||||
graph._flights_state[flight]["poses"][1] = Pose(
|
||||
frame_id=1, position=np.zeros(3),
|
||||
orientation=np.eye(3), timestamp=datetime.now(),
|
||||
)
|
||||
|
||||
gps = GPSPoint(lat=49.5, lon=31.0)
|
||||
ok = graph.add_absolute_factor(flight, 0, gps, np.eye(2), is_user_anchor=True)
|
||||
# First GPS sets origin
|
||||
origin = GPSPoint(lat=49.0, lon=30.0)
|
||||
graph.add_absolute_factor(flight, 0, origin, np.eye(2), is_user_anchor=True)
|
||||
|
||||
# Second GPS — 0.5° north
|
||||
gps2 = GPSPoint(lat=49.5, lon=31.0)
|
||||
ok = graph.add_absolute_factor(flight, 1, gps2, np.eye(2), is_user_anchor=True)
|
||||
assert ok is True
|
||||
|
||||
traj = graph.get_trajectory(flight)
|
||||
assert traj[0].position[1] > 50000 # ~55 km north of origin
|
||||
assert traj[1].position[1] > 50000 # ~55 km north of origin
|
||||
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user