ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11.03k stars 17.58k forks source link

Rover: Bad AHRS displayed on MP HUD when vehicle doesn't have GPS lock #7417

Open rmackay9 opened 6 years ago

rmackay9 commented 6 years ago

In Rover-3.2 (and lower) users nearly always see the "Bad AHRS" and "Bad GPS Health" messages during startup. It's disconcerting to users and makes them think that something is wrong with the system, when in fact, it's booting up normally but is still in the initialisation phase.

Re the "Bad AHRS" message, I don't think the AHRS is actually "Bad", it simply doesn't have GPS lock yet.

I think we should make a few changes:

rmackay9 commented 6 years ago

This PR resolves the "Bad GPS Health" message but not the "Bad AHRS" message. https://github.com/ArduPilot/ardupilot/pull/7421

peterbarker commented 6 years ago

On Thu, 14 Dec 2017, Randy Mackay wrote:

I think we should make a few changes:

Another option might to stay in an "initialising" mode. That's previously been suggested on a dev call.

rmackay9 commented 6 years ago

I think the issue with the AHRS health is actually within DCM. I think DCM itself returns "unhealthy" when it doesn't have a GPS. Rover currently uses DCM until the EKF is fully initialised I think. I haven't checked this theory in depth yet though, it's just a hunch.

rmackay9 commented 6 years ago

The "Bad GPS Health" issue has been fixed by this commit. https://github.com/ArduPilot/ardupilot/commit/a8da459bafd943c2cdeedfca18ad8ad084350d36

@peterbarker, by the way, I noticed we have an "initialising" mode in Rover it seems. https://github.com/ArduPilot/ardupilot/blob/master/APMrover2/defines.h#L47. I guess it tells the user that some stage of the initialisation is done.

amilcarlucas commented 3 years ago

Hasn't this been fixed recently?

rmackay9 commented 3 years ago

@amilcarlucas, no I'm afraid not.

peterbarker commented 3 years ago

@rmackay9 we no longer emit "Bad AHRS" (I think that's now "Need 3D Fix"?), and "Bad GPS Health" was also changed years ago?

What's the new, modern bad behaviour that needs to be sorted?

rmackay9 commented 3 years ago

ok, so "Bad AHRS" has become, "Unhealthy AHRS". I suspect this message is displayed by MP based on some bit in the extended system status. image

This can be reproduced by doing this:

nicolasgallardo commented 3 years ago

@peterbarker is there any update on this? I am trying to run @rmackay9 's wheel encoder example found here https://ardupilot.org/rover/docs/wheel-encoder.html on ardurover 4.1.0 but as mentioned above Unhealthy AHRS prevents the switch to AUTO.

rmackay9 commented 3 years ago

@nicolasgallardo,

It sounds like the issue you're facing is with getting wheel encoders working so it's probably best to raise this in the Rover support forums. This issue (7417) is really about the disconcerting "Unhealthy AHRS" message itself, not the underlying problem of the AHRS perhaps not having a position estimate in some situations.

By the way, the wheel encoder instructions on the wiki are for 4.0. For 4.1 the EK3_SRC_VELXY parameter should be set to "Wheel Encoder" and some of the other EK3SRC*** parameters will need to be set as well.

peterbarker commented 3 years ago

@rmackay9 that sounds like it might now be a MissionPlanner issue, esp. in light of this patch in master from @IamPete1 :

commit c1a831bbf49fda1013ad046b60baa2e0c185c75d
Author: Peter Hall <iampete@hotmail.co.uk>
Date:   Sat Feb 13 00:26:15 2021 +0000

    GCS_MAVLink: sensor flags, only mark AHRS as enabled once initialised

Should we close this issue now?

peterbarker commented 3 years ago

It is unknown as to whether this is still an issue, and whether it is a problem with ArduPilot or with MissionPlanner.

IamPete1 commented 3 years ago

We still get "Unhealthy AHRS" for the period of time between the EKF setting origin and starting using the GPS.

rmackay9 commented 1 year ago

After a bit more debugging (see branch here) the issue appears to be:

One potential solution is to change AP_AHRS to always use the EKF for Rovers. This can be done by adding, " || APM_BUILD_TYPE(APM_BUILD_Rover)" to this line.

#if APM_BUILD_COPTER_OR_HELI || APM_BUILD_TYPE(APM_BUILD_ArduSub) || APM_BUILD_TYPE(APM_BUILD_Rover)
    // Copter and Sub force the use of EKF
    _ekf_flags |= AP_AHRS::FLAG_ALWAYS_USE_EKF;
#endif

.. and disabling the fallback-to-dcm logic here by removing, "_vehicle_class == VehicleClass::GROUND)) {"