-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Allow arming without GPS #7320
Allow arming without GPS #7320
Conversation
I don't see the point in allowing arming and then imposing a 3 second "grace period" to allow the fix to be established. The pilot could just wait the extra 3 seconds before arming. The current state requires the pilot to explicitly allow arming without a fix by consciously changing a setting. This change allows arming without the pilot deciding that's what they want - not in favor of this. Also remember that no everybody has or uses an OSD. So relying on that for critical decision making is a bad idea. Also many users don't have beepers and those that do may mot be audible in flight (might be using DSHOT beacon). I'm concerned we're trying to address to many edge cases with GPS Rescue and deviating from it's actual mission - Rescue. For rescue to work the user needs to have a valid GPS fix. Having it be optional and relying on the user understanding (somehow) that they may or may not have a valid state is starting defeat the purpose. |
This is actually a bug fix, I should have explained it better. The existing code allows for arming with 0 sats, and then as soon as a fix arrives, home point is set (not necessarily where you started flying). A grace period is needed to avoid this.
You're right, it might not be a good idea to have this feature always enabled. Adding a parameter to explicitly enable this behaviour would cover those cases. Something (not tied with min_sats please) like gps_rescue_arming = gps_fix_required / gps_rescue_auto_disable (default = gps_fix_required).
In the current code the parameter gps_rescue_min_sats can be set to 0. This exists as some people want to be able to fly with rescue disabled in case there is no GPS. But the resulting behaviour of setting min_sats to 0 is so random as you don't know wether the home point will be updated, or if sanity check will stop doing its job. My proposal pursues to maintain the same functionality in a much saner/understandable way (imho). |
I'm not too sure about the three seconds too, but I'm for this PR. I think is a very needed feature that fixes some weaknesses of the GPS Rescue. |
Actually, the discussion on the three seconds thing is making me think that what is really broken is the current code. The home point should use the last valid fix if it was received within the last 3 seconds before arming, this way I think all the corner cases are covered. And for people not wanting to wait for a gps fix, GPS Rescue won't be available from the beginning. |
Exactly. I think this is the correct way. And +1 for the parameter to let take off without fix (and without rescue). |
0dd9ef9
to
c816ba3
Compare
Refactored the PR according to the above comments, much clearer now. Thanks for the feedback! |
c5bc24b
to
6902300
Compare
6902300
to
d3e41c0
Compare
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 me is good, but I have not tested it ;)
I tested this change yesterday in a low sat environment and seems to work fine. |
src/main/io/gps.c
Outdated
// | ||
static void GPS_calculateDistanceFlown(bool initialize) | ||
void GPS_calculateDistanceFlownVerticalSpeed(bool initialize) |
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 should be static
. And reordering the functions will get you out of having to put a forward declaration into the header file.
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.
TBH the fact that this function takes bool initialize
as an argument is messy.
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.
src/main/fc/core.c
Outdated
@@ -279,7 +279,7 @@ void updateArmingStatus(void) | |||
|
|||
#ifdef USE_GPS_RESCUE | |||
if (gpsRescueIsConfigured()) { | |||
if (!gpsRescueConfig()->minSats || STATE(GPS_FIX) || ARMING_FLAG(WAS_EVER_ARMED)) { | |||
if (gpsRescueConfig()->allowArmingWithoutFix || STATE(GPS_FIX)) { |
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 should still check ARMING_FLAG(WAS_EVER_ARMED)
- otherwise it will make it possible for the pilot to land / disarm in an inaccessible location and then not being able to get out of there again if there is no GPS reception.
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.
Well spotted! This condition was unnecessary in my former PR, but as I changed the proposal I forgot bringing this condition back. Worth noting that as a consequence of this condition, the parameter "gps_allow_arming_without_fix" will only be useful for the first arming.
d3e41c0
to
007e14f
Compare
@TonyBlit I've been testing this today. The GPS Rescue not available message is very annoying. I understand the we must show this warning, but all the time makes this change not too useful. Maybe show it only 3 or 4 secund after take off? With this, and some type of beep, I think it will be enough for the pilot to decide if continue flying out land until GPS available... |
You're right, it's very annoying. I was afraid of hiding the message after a few seconds to avoid confusion with the normal "not available" message, which is hidden when gps coverage is recovered. Maybe a different message can be shown for a few seconds, for instance "RESC DISABLED". To meet the 11 char limit, it could just be "RESC OFF!!!" |
True, to me is ok and very descriptive... |
As this is already merged I'll open a new PR, hopefully later today. Thanks for the feedback! |
A bit of context before explaining this PR:
This PR allows arming the quad without a GPS Fix, then:
Notes:
I've not been able to test this change on the field (yet), so I'm submitting the PR just to check if there is any concern preventing the PR to be accepted. Testing is so time consuming for me that I prefer to defer it until the PR is greenlighted.