-
Notifications
You must be signed in to change notification settings - Fork 18k
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
AP_AHRS: give clearer prearm messages #24243
Conversation
So there are 2 completely different use cases here.
|
there are many more ways to get the inconsistency than just sufficient GPS.... and its easy for a user upgrading from older firmware to mess up AHRS_TYPE when moving to EKF3....so AHRS_TYPE issues have come mainly from normal users...so the not using AHRS type message is 100% needed and its exactly clear that you are not using the selected AHRS type....anyway this PR only deals with the filter inconsistency messages |
#24243 is much better (I've added comments), but users will still be confused by: DCM/EKF2/EKF3 - they should not need to care about this. IMO this bleeding of developer interests into the UI for end users is very unfortunate. As a user/pilot I am still very confused about what it actually means if EKF is complaining about Roll/Pitch or Yaw. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In essence adding "Wait or check sensors" is great, but "R/P" not so great. By looking at the code that triggers this
const float rp_diff_rad = primary_quat.roll_pitch_difference(ekf2_quat);
I figured using "difference" vs "inconsistent" - 2 characters would be saved which gives us the full word "roll/pitch" back
libraries/AP_AHRS/AP_AHRS.cpp
Outdated
@@ -2277,7 +2277,7 @@ bool AP_AHRS::attitudes_consistent(char *failure_msg, const uint8_t failure_msg_ | |||
// check roll and pitch difference | |||
const float rp_diff_rad = primary_quat.roll_pitch_difference(ekf2_quat); | |||
if (rp_diff_rad > ATTITUDE_CHECK_THRESH_ROLL_PITCH_RAD) { | |||
hal.util->snprintf(failure_msg, failure_msg_len, "EKF2 Roll/Pitch inconsistent by %d deg", (int)degrees(rp_diff_rad)); | |||
hal.util->snprintf(failure_msg, failure_msg_len, "EKF2: R/P inconsistent. Wait or check sensors"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second part is great. Sorry to say but R/P doesn't help a non developer pilot. My reaction would be "WTF is R/P" if I get this message while on the field getting ready to fly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also - does a pilot/user really know or care that it is EKF2 (or 3 or DCM) - answer no and it only confuses them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about: "EKF2: Roll/Pitch difference. Wait or check sensors"
using "difference" instead of "inconsistent" saves 2 characters and gets it into 50 characters".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not a roll to pitch difference which gets implied.....inconsistent is more accurate....alternatively... Atittude inconsistent instead of Roll/Pitch although yaw is considered attitude also...I think the commit language is best as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you used "EKF3: Attitude off by 10 deg. Wait/check sensors" you could also use the same message for Yaw (which is also attitude) - so you could save about 45 bytes of flash by reusing the string.
Actually if you used "%s: Attitude off by %d deg. Wait/check sensors" and pass "EKF3"/"EKF2"/"DCM" as a parameter you save even more, by replacing all the messages with this one string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even for me as someone who somehow knows what happens inside the EKF would be confused by R/P, Roll/Pitch would be way better.
libraries/AP_AHRS/AP_AHRS.cpp
Outdated
@@ -2286,7 +2286,7 @@ bool AP_AHRS::attitudes_consistent(char *failure_msg, const uint8_t failure_msg_ | |||
primary_quat.angular_difference(ekf2_quat).to_axis_angle(angle_diff); | |||
const float yaw_diff = fabsf(angle_diff.z); | |||
if (check_yaw && (yaw_diff > ATTITUDE_CHECK_THRESH_YAW_RAD)) { | |||
hal.util->snprintf(failure_msg, failure_msg_len, "EKF2 Yaw differs from current AHRS by %d deg", (int)degrees(yaw_diff)); | |||
hal.util->snprintf(failure_msg, failure_msg_len, "EKF2: Yaw inconsistent, Wait or check sensors"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with Roll/Pitch - "EKF2: Yaw difference. Wait or check sensors"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
libraries/AP_AHRS/AP_AHRS.cpp
Outdated
@@ -2313,7 +2313,7 @@ bool AP_AHRS::attitudes_consistent(char *failure_msg, const uint8_t failure_msg_ | |||
primary_quat.angular_difference(ekf3_quat).to_axis_angle(angle_diff); | |||
const float yaw_diff = fabsf(angle_diff.z); | |||
if (check_yaw && (yaw_diff > ATTITUDE_CHECK_THRESH_YAW_RAD)) { | |||
hal.util->snprintf(failure_msg, failure_msg_len, "EKF3 Yaw differs from current AHRS by %d deg", (int)degrees(yaw_diff)); | |||
hal.util->snprintf(failure_msg, failure_msg_len, "EKF3: Yaw inconsistent, Wait or check sensors"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"EKF3: Yaw difference. Wait or check sensors"
libraries/AP_AHRS/AP_AHRS.cpp
Outdated
@@ -2329,7 +2329,7 @@ bool AP_AHRS::attitudes_consistent(char *failure_msg, const uint8_t failure_msg_ | |||
// check roll and pitch difference | |||
const float rp_diff_rad = primary_quat.roll_pitch_difference(dcm_quat); | |||
if (rp_diff_rad > ATTITUDE_CHECK_THRESH_ROLL_PITCH_RAD) { | |||
hal.util->snprintf(failure_msg, failure_msg_len, "DCM R/P differs from current AHRS by %d deg", (int)degrees(rp_diff_rad)); | |||
hal.util->snprintf(failure_msg, failure_msg_len, "DCM: R/P inconsistent. Wait or check sensors"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"DCM: Roll/Pitch difference. Wait or check sensors"
for consistency with EKF2 and EKF3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, disagree with your suggestion
libraries/AP_AHRS/AP_AHRS.cpp
Outdated
@@ -2344,7 +2344,7 @@ bool AP_AHRS::attitudes_consistent(char *failure_msg, const uint8_t failure_msg_ | |||
primary_quat.angular_difference(dcm_quat).to_axis_angle(angle_diff); | |||
const float yaw_diff = fabsf(angle_diff.z); | |||
if (check_yaw && (yaw_diff > ATTITUDE_CHECK_THRESH_YAW_RAD)) { | |||
hal.util->snprintf(failure_msg, failure_msg_len, "DCM Yaw differs from current AHRS by %d deg", (int)degrees(yaw_diff)); | |||
hal.util->snprintf(failure_msg, failure_msg_len, "DCM: Yaw inconsistent, Wait or check sensors"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DCM: Yaw difference. Wait or check sensors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and again
We should aspire to bring users to a level of higher understanding not dumb down the interface to the lowest level. I agree these messages could be better, but we can make them better by adding more information not by removing what is already there. Think of these messages like the engine low temperature light in your car. Most people don't care or pay much attention. The blue light goes out after a bit once the engine has got up to temperature, all good. However some engines will break if you run them too hard when there cold, some drivers like to look after there engines and let them warm up before going for a drive. Unlike car manufactures we don't have the benefit of knowing what sort of car our warning light will be fitted in. So we have to provide as much information as possible (as I say we could do better here) and leave it to the user to ignore or not based on there use case. |
I think we (including me) should work on a big "errors and warnings" wiki page that gives instructions to the user on what they can do in these situtations. I think that it's going to be very difficult to provide enough advice to the user in just 54 characters no matter how hard we try. |
In 50 characters? How about user friendly messages, with an "ADVANCED_MESSAGES_ENABLE" setting that displays these detailed messages, in addition to the user message? |
Great example. The mechanic connects the engine diagnostics to a computer in the workshop to get the full picture. (just like a developer reviewing a log file after a flight) The "light" is the dumbed down UI for the user. That is EXACTLY what we need! Specifically: "Check engine" - there is a check engine light. The ArduPilot messages need to tell the pilot/user
|
@rmackay9 > I think we (including me) should work on a big "errors and warnings" wiki page that gives instructions to the user on what they can do in these situtations. I think that it's going to be very difficult to provide enough advice to the user in just 54 characters no matter how hard we try. there already exists that page....it needs updating...and perhaps automation...https://ardupilot.org/plane/docs/common-prearm-safety-checks.html |
That page only refers to pre-arms @Hwurzburg - are you suggesting to make it more general? |
prearms are the only thing that prevents a user from flying ...in flight messages are almost always just informational and most the user can do nothing about while flying....yaw resets, lane switches, etc......and the normal feedback messages like transitions being complete and waypoints being crossed....if there are any that need user intervention and are unclear, we could add a page for them...aside from watchdogs, which we have a page for, I cant think of user actionable inflight messages off hand that are not clear |
Maybe I didn't think my analogy through enough. This message is not the warning light, it is a hint about extra information the mechanic needs. The warning light is the vehicle refusing to arm.
In most cases I disagree that we should tell users that to do, the action is often not clear to ArduPilot, if it was then we would do it automatically. There are some exceptions, like the pre-arm that you need to reboot after compass calibration, where there is a single action that will resolve. However this EKF stuff is a prime example of a issue that could be caused by a number of things. We should provide as much information about the issue as possible. The advice on how to resolve should be elsewhere, we probably could do a better job at documenting such things, maybe some flow charts or similar. I guess in that context the what they should do becomes "go and have a look at this flow chart". Maybe some sort of metadata could be provided to the GCS as we do for params and logs. There could be a regex for the pre-arm and a link to a page giving more information. |
In my mind I've linked this to the "Lane Switch" message PR #24181 - it's basically the same thing - the user experience for a non-developer is being muddied with information designed to help developers - generally causing confusion. |
Excellent idea! The metadata could also be harvested directly into he wiki - right @Hwurzburg ? If you get something started I would be happy to contribute. |
I am discussing with Peter already...see the description box of the PR |
fyi...there are over 280 prearm/arming failure messages..just in the ARMING modules ...most are not cryptic....only the cryptic ones need be metadata tagged and searchable in the wiki there are probably a hundred more in the various other modules |
Who defines "cryptic"? I'm thinking there are messages you (or even I) might think are obvious that others might need more explanation. |
anyone who provides end user support as support engineers or admins the RCG or Facebook groups or monitors the help channels would have exposure to users complaining: "what do I do when I get this?" |
36a52c8
to
16e0286
Compare
Flash reduction via refactor is good but scope creep...I will leave that to someone else... |
I don't see how adding "AHRS" helps at all. For those that don't know what that is, it's just babble. For those who do know, they will already know this is about AHRS. I'd suggest dropping "with current AHRS", but either way I think it's better than what we get now. |
then EKF or DCM will be similarly lost...but if they get these messages and they don't resolve themselves they will have to learn what AHRS and EKF mean....to relay the issue at the least to more knowledgeable people...any search of the wiki for EKF |
I agree that adding "AHRS" won't help most users. They will just wonder, "What's an EKF vs an AHRS?". We also need to be careful that the mesasges don't become too long because then the message will wrap and won't be clearly visible on the MP HUD. |
libraries/AP_AHRS/AP_AHRS.cpp
Outdated
@@ -2277,7 +2277,7 @@ bool AP_AHRS::attitudes_consistent(char *failure_msg, const uint8_t failure_msg_ | |||
// check roll and pitch difference | |||
const float rp_diff_rad = primary_quat.roll_pitch_difference(ekf2_quat); | |||
if (rp_diff_rad > ATTITUDE_CHECK_THRESH_ROLL_PITCH_RAD) { | |||
hal.util->snprintf(failure_msg, failure_msg_len, "EKF2 Roll/Pitch inconsistent by %d deg", (int)degrees(rp_diff_rad)); | |||
hal.util->snprintf(failure_msg, failure_msg_len, "EKF2 Roll/Pitch inconsistent with current AHRS. Wait or check sensors"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hal.util->snprintf(failure_msg, failure_msg_len, "EKF2 Roll/Pitch inconsistent with current AHRS. Wait or check sensors"); | |
hal.util->snprintf(failure_msg, failure_msg_len, "%s Roll/Pitch inconsistent with current AHRS. Wait or check sensors", "EKF2"); |
etc elsewhere.
This will let the compiler re-use the format string, actually saving bytes on this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.... could potentially be
hal.util->snprintf(failure_msg, failure_msg_len, "EKF2 Roll/Pitch inconsistent with current AHRS. Wait or check sensors"); | |
hal.util->snprintf(failure_msg, failure_msg_len, "%s %s inconsistent with current AHRS. Wait or check sensors", "EKF2", "Roll/Pitch"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look like it was done in this PR.
This branch shows what I meant; feel free to cherry-pick the patch :-)
That branch saves 224 bytes vs master, whereas this one costs 80-odd bytes,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay done....credit given...thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Co-authored-by: Peter Barker <[email protected]>
@@ -2257,6 +2257,11 @@ void AP_AHRS::getCorrectedDeltaVelocityNED(Vector3f& ret, float& dt) const | |||
ret.z += GRAVITY_MSS*dt; | |||
} | |||
|
|||
void AP_AHRS::set_failure_inconsistent_message(const char *estimator, const char *axis, float diff_rad, char *failure_msg, const uint8_t failure_msg_len) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my patch, but I could've used snprintf_failure_inconsistent_message
here
We agreed on the dev call that we can merge once Henry has confirmed he's completed testing. |
this comes up over and over....
two alternatives for improvement....the latter commit being suggested by Tim T. and I think I agree....at least it gives the user directions on how to resolve it...
but this is about as clear as you can make it unfortunately since the inconsistency can be from many sources
whichever the group decides on I will remove the other/squash
@peterbarker we need to discuss TIm's idea of automating this page also : https://ardupilot.org/plane/docs/common-prearm-safety-checks.html....I sent you a metadata format proposal
edit: Peter and I have talked at length....there are 3 options:
#3 is a very large effort
#2 is many days of python work and testing plus the C++ effort (which Peter is unable to do with his current load)
#1 is done, but any other nagging messages can be added and expanded...
inflight error messages are another topic and beyond scope here