Skip to content

autotest: add Copter EKF Replay wind and airspeed subtest#32063

Merged
tpwrules merged 2 commits intoArduPilot:masterfrom
tpwrules:pr/ek3-wind-airspeed-replay
Feb 2, 2026
Merged

autotest: add Copter EKF Replay wind and airspeed subtest#32063
tpwrules merged 2 commits intoArduPilot:masterfrom
tpwrules:pr/ek3-wind-airspeed-replay

Conversation

@tpwrules
Copy link
Contributor

@tpwrules tpwrules commented Jan 31, 2026

Tests that fusion of wind estimation and airspeed data is correctly replayed by the EKF. The test that wind estimation is working is already handled by BaroWindCorrection.

Adding airspeed to Copter is easier than migrating everything to Plane. Technically fusion of airspeed data is not supported on copters and the ARSPD_USE parameter explicitly recommends against it. But it exists and works, and this test includes a check that it has continued to work. So if we break that later, the test will start to fail and we can decide what to do.

Tested that breaking airspeed fusion changes EKF replay.

Note that this still doesn't check sideslip.

Some tests do throttle control and need it zeroed, and some others leave
it non-zeroed. Clear all the time for all tests for simplicity.
Tests that fusion of wind estimation and airspeed data is correctly
replayed by the EKF. The test that wind estimation is working is already
handled by `BaroWindCorrection`.

Adding airspeed to Copter is easier than migrating everything to Plane.
Technically fusion of airspeed data is not supported on copters and the
`ARSPD_USE` parameter explicitly recommends against it. But it exists
and works, and this test includes a check that it has continued to work.
So if we break that later, the test will start to fail and we can decide
what to do.
@tpwrules tpwrules requested a review from peterbarker January 31, 2026 19:43
Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

self.arm_vehicle()
self.takeoffAndMoveAway()

# make sure airspeed was fused at some point after some flying
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# make sure airspeed was fused at some point after some flying
# make sure airspeed is being fused

# make sure airspeed was fused at some point after some flying
m = self.assert_receive_message('EKF_STATUS_REPORT')
if m.airspeed_variance == 0:
raise NotAchievedException("never fused airspeed")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise NotAchievedException("never fused airspeed")
raise NotAchievedException("not fusing airspeed")

@tpwrules
Copy link
Contributor Author

tpwrules commented Feb 1, 2026

I observed that the airspeed_variance field doesn't update when fusion is off, it retains its previous value. So at an instant in time it's not really an indicator that fusion is actively happening.

If you have a stanza to make sure it's changing for five seconds or whatever then I could put it in there. Or know what flag to check. But it would be weird since both the functions before and after the check are the ones that fly the drone; if it had no momentum it wouldn't be moving at the time of the check and fusion wouldn't be active.

@tpwrules tpwrules merged commit 3b7558a into ArduPilot:master Feb 2, 2026
50 checks passed
@tpwrules tpwrules deleted the pr/ek3-wind-airspeed-replay branch February 2, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments