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

GPS & baro fusion problem #14141

Closed
matejbone opened this issue Feb 12, 2020 · 9 comments
Closed

GPS & baro fusion problem #14141

matejbone opened this issue Feb 12, 2020 · 9 comments

Comments

@matejbone
Copy link

Hi!

I have a question regarding EKF2 fusion.

PX4 is set up to use GPS as a primary source for EKF2_HGT_MODE.
Reported altitude is OK until the GPS receiver is jammed. In that case, fusion creates a problem, because it merges invalid position from GPS and baro and from that point on fused altitude is incorrect. Px4 thinks it's flying way higher than it actually is.

Is there a way in the parameters to set up in case of invalid GPS to use baro as a primary source. Could I set PX4 to turn off fusion when GPS signal is invalid? I think that is feeding info in the Kalman filter even when it's invalid and from that point on fused altitude does not return to GPS reported one.
Flight1
bokeh_plot (4)

Flight2
I tried using EKF2_GPS_V_GATE and EKF2_GPS_P_GATE more restrictively but without any luck.
bokeh_plot (2)

Thanks!

@julianoes
Copy link
Contributor

Good question. Let me ping @bresch and @CarlOlsson hoping that they have answers.

@CarlOlsson
Copy link
Contributor

Unfortunately I don't have experience with GPS as primary height source. @matejbone Just curious, why don't you want to use baro as primary height source?

@matejbone
Copy link
Author

I tried to use GPS, because after a long flight 2+ hours I had in mind that barometric pressure would change and that would affect the approaching height.

How do I adjust weight between both? Is there a parameter?

@CarlOlsson
Copy link
Contributor

How do I adjust weight between both? Is there a parameter?

No the EKF only uses one of them at the time. Here is some super old issue regarding baro offset estimation PX4/PX4-ECL#44

@julianoes
Copy link
Contributor

FYI @RomanBapst @jkflying

@jkflying
Copy link
Contributor

jkflying commented Feb 14, 2020

Use baro as primary height source. The offset will be re-estimated using GPS if available, so you shouldn't have drift.

There were some ideas from @kamilritz about doing multiple height source fusion (vision, lidar, baro & GPS all together) but this would require a big rework of the EKF.

@matejbone
Copy link
Author

OK thanks for the help to all!

I will try to use baro and see what happens if GPS is jammed.

@RomanBapst
Copy link
Contributor

RomanBapst commented Feb 17, 2020

Use baro as primary height source. The offset will be re-estimated using GPS if available, so you shouldn't have drift.

@jkflying Can you remind me where we are doing this? I was under the impression that we don't compensate for baro drift.

@jkflying
Copy link
Contributor

Hmm, it seems we only do that if we don't use baro as primary.

https://github.com/PX4/ecl/blob/81c6d6655f6e409cac549ed8537b22996b413028/EKF/control.cpp#L1083-L1092

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

No branches or pull requests

5 participants