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

Commander: preflight check fixes #14022

Merged
merged 3 commits into from
Jan 25, 2020
Merged

Conversation

bkueng
Copy link
Member

@bkueng bkueng commented Jan 24, 2020

Fixes some serious bugs around preflight checks:

  • fix prearm flag to preflightCheck
    This was inverted, i.e. set to false in most cases, whereas it should be true.
    As a consequence, both powerCheck and airspeed.confidence checks were not executed.
  • fix commander: run preflight checks on GCS connection
    Regression from 6dec451, leading to preflight failures not being reported at all. Only after a failed arming attempt the messages would be sent. And for GPS check failures, in case they are set to optional (default), arming would be possible, but switching to position would be rejected w/o error.
    We need to run the preflight checks periodically, but this at least restores the previous behavior.

This was inverted, i.e. set to false in most cases, whereas it should be
true.

As a consequence, both powerCheck and airspeed.confidence checks were not
executed.
Regression from 6dec451, leading to
preflight failures not being reported at all. Only after a failed arming
attempt the messages would be sent. And for GPS check failures, in case
they are set to optional (default), arming would be possible, but switching
to position would be rejected w/o error.

We need to run the preflight checks periodically, but this at least restores
the previous behavior.
@dagar dagar self-requested a review January 24, 2020 18:40
@dagar dagar added the bug label Jan 24, 2020
@dagar
Copy link
Member

dagar commented Jan 24, 2020

fix commander: run preflight checks on GCS connection
Regression from 6dec451, leading to preflight failures not being reported at all. Only after a failed arming attempt the messages would be sent. And for GPS check failures, in case they are set to optional (default), arming would be possible, but switching to position would be rejected w/o error.
We need to run the preflight checks periodically, but this at least restores the previous behavior.

I need to check some of the history here, but I recall one case where a flaky connection was breaking QGC airspeed cal with the preflight checks being triggered each reconnect.

@dagar
Copy link
Member

dagar commented Jan 24, 2020

  • fix prearm flag to preflightCheck
    This was inverted, i.e. set to false in most cases, whereas it should be true.
    As a consequence, both powerCheck and airspeed.confidence checks were not executed.

Let me check the details, but I believe this was intentional. In the case of airspeed the check can't run continuously because it will falsely trigger on the ground in a gust of wind. The "prearm" portion is one last chance at arming to catch a large bias in airspeed.

I don't know any reason why we should wait until actually trying to arm before checking system_power. I'm wondering if it might falsely trigger in bench scenarios, jumping between usb power, etc.

@dagar
Copy link
Member

dagar commented Jan 24, 2020

We need to run the preflight checks periodically, but this at least restores the previous behavior.

Huh? We're really not running these periodically? That needs to be fixed.

@LorenzMeier
Copy link
Member

@dagar These need indeed to be run periodically until the system is ready to arm. Because you need to reflect the current system readiness to the operator.

@LorenzMeier LorenzMeier merged commit db49e5a into master Jan 25, 2020
@LorenzMeier LorenzMeier deleted the commander_preflight_check_fixes branch January 25, 2020 10:17
@dagar
Copy link
Member

dagar commented Jan 25, 2020

@dagar These need indeed to be run periodically until the system is ready to arm. Because you need to reflect the current system readiness to the operator.

Yes I know, I was just surprised that isn't already the case.

The current state in master is to run them periodically until they pass once and the vehicle enters ARMING_STATE_STANDBY. Let's also get them to run periodically after the initial pass.

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

Successfully merging this pull request may close these issues.

3 participants