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

Cannot start EKF2 on External Vision without a Barometer #14101

Closed
marcelino-pensa opened this issue Feb 4, 2020 · 4 comments
Closed

Cannot start EKF2 on External Vision without a Barometer #14101

marcelino-pensa opened this issue Feb 4, 2020 · 4 comments

Comments

@marcelino-pensa
Copy link

marcelino-pensa commented Feb 4, 2020

Describe the bug
EKF2 does not start if there is no incoming barometer data, even with SYS_HAS_BARO = 0. This seems like a bug to me unless this is expected behavior for some reason.

To Reproduce
I am running on a snapdragon flight using Px4 1.8, but it seems like this is a bug on master too (at least it seems so by looking at the code).

  • Do not start the barometer when starting px4
  • Use EKF2 enabling External Vision and disabling the barometer:
param set EKF2_AID_MASK 24
param set EKF2_HGT_MODE 3
param set SYS_MC_EST_GROUP 2
param set SYS_HAS_BARO 0
  • Launch px4, EKF2 does not start

Expected behavior
I would expect EKF2 to start if SYS_HAS_BARO is set to 0. I know that EKF2 does not start because when I enable the barometer back again, the following log shows up:

pxh> INFO  [ecl/EKF] EKF aligned, (EV height, IMU buf: 26, OBS buf: 16)
INFO  [ecl/EKF] EKF commencing external vision position fusion
INFO  [ecl/EKF] EKF commencing external vision yaw fusion

Drone (please complete the following information):

  • Snapdragon flight

Additional context
It seems like the problem is in line 177 of ecl/ekf.cpp. If there are not enough initial barometer measurements, the function initialiseFilter() returns false, which in turn does not allow EKF2 to execute.

@LorenzMeier
Copy link
Member

Many thanks for the detailed report. However, this is really a feature request for a very specific use case. Could you please send a pull request with the required changes instead? Open source projects are always open to accept new features that match coding standards and quality, but the way this works is that we have to rely on the people who need those to implement and test them.

https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests

@marcelino-pensa
Copy link
Author

Thanks for the prompt response, @LorenzMeier! I am willing to make the changes and test, but I am planning to do so on v1.8.0, since this is the one I am currently using in our project. I'm not sure if that helps at all, since this would require tests on master too.
I guess that the sole existence of this issue (even if we close it) can provide some guidance to other people who might encounter the same problem in the future (with recommendations on how to fix it too).
BTW, the correction needs to be done on ECL repository, not on Firmware. Would it make sense to movie this issue there?

@stale
Copy link

stale bot commented May 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label May 13, 2020
@bresch
Copy link
Member

bresch commented May 13, 2020

Same as PX4/PX4-ECL#800. EKF2 currently needs baro and mag data to initialize even if it doesn't use those.

@bresch bresch closed this as completed May 13, 2020
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

4 participants