Copter: disambiguate the various causes of "Bad GPS Pos"

I've seen a fair number of user questions where they are confused by
"Bad GPS Pos" on their GCS/not being allowed to arm.  This change splits
the remaining causes of this fault into separate messages.

Hopefully this increases the odds of the user self diagnosing...
This commit is contained in:
Kevin Hester 2014-02-26 16:56:10 -08:00 committed by Randy Mackay
parent 9e7021cc20
commit 5fb3b031f1
1 changed files with 19 additions and 3 deletions

View File

@ -411,10 +411,26 @@ static bool pre_arm_gps_checks(bool display_failure)
{
float speed_cms = inertial_nav.get_velocity().length(); // speed according to inertial nav in cm/s
// ensure GPS is ok and our speed is below 50cm/s
if (!GPS_ok() || gps_glitch.glitching() || speed_cms == 0 || speed_cms > PREARM_MAX_VELOCITY_CMS) {
// check GPS is not glitching
if (gps_glitch.glitching()) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Bad GPS Pos"));
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: GPS Glitch"));
}
return false;
}
// ensure GPS is ok
if (!GPS_ok()) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Need 3D Fix"));
}
return false;
}
// check speed is below 50cm/s
if (speed_cms == 0 || speed_cms > PREARM_MAX_VELOCITY_CMS) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Bad Velocity"));
}
return false;
}