Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EKF3: allow alt from other sources when using ExtNav #15602

Merged
merged 3 commits into from
Oct 20, 2020

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Oct 19, 2020

This PR allows the EKF's altitude source to come from another source (baro, rangefinder, etc) when using external nav as the horizontal position source. This is useful especially for users of the T265 which can lose its position and altitude estimate due to high vibration. Because multicopter Z-axis vibrations tend to be particularly high, the camera normally loses its altitude estimate first. Allowing the user to rely on barometer is generally a safer option.

This PR is part of the EKF position source PR: #14803. I've extracted it here to simplify the other PR.

This has been tested in SITL and extensively on a real vehicle. Below is a screen shot of a SITL test in which EK3_ALT_SOURCE = 0 (Baro) but the vicon is enabled. We see that a glitch in the External Nav's Z-axis position has no impact on the EKF's altitude.
ek3-alt-source-baro

This is the same test again but with EK3_ALT_SOURCE = 4 (ExtNav) and the EKF's altitude is affected by a glitch in the External Nav's Z-axis position.
ek3-alt-source-extnav

The ExtNav altitude can also be used with GPS (or other horizontal position source). I tested this in SITL as well and it worked as expected.

this non-functional change slightly reduces the number of places we set these variables
also allows using ExtNav alt when not using it for XY position
removes redundant and incorrect setting of activeHgtSource from ExtNav
which was always being overwritten by the correct value later in selectHeightForFusion
tridge
tridge previously requested changes Oct 20, 2020
libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp Outdated Show resolved Hide resolved
@tridge
Copy link
Contributor

tridge commented Oct 20, 2020

need to pass CI

@rmackay9 rmackay9 dismissed tridge’s stale review October 20, 2020 00:53

Resolved Tridge's request to consolidate the timeouts

@rmackay9
Copy link
Contributor Author

I've retested this after making the requested changes and it all works so I'll merge this after it passes travis.

@rmackay9 rmackay9 merged commit e4ccd21 into ArduPilot:master Oct 20, 2020
@rmackay9 rmackay9 deleted the ekf-viso-alt-source branch October 20, 2020 08:11
@rmackay9
Copy link
Contributor Author

Merged, thanks for the reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants