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
Fix GNSS new data #12725
Fix GNSS new data #12725
Conversation
f5317fa
to
c3710a0
Compare
src/main/io/gps.c
Outdated
@@ -1955,7 +1955,7 @@ void onGpsNewData(void) | |||
|
|||
lastTimeUs = timeUs; | |||
|
|||
if (!(STATE(GPS_FIX) && gpsSol.numSat >= GPS_MIN_SAT_COUNT)) { | |||
if (!(STATE(GPS_FIX) || gpsSol.numSat >= GPS_MIN_SAT_COUNT)) { |
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.
// not (A or B) = (not A) and (not B)
// not (A and B) = (not A) or (not B)
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.
Good old DeMorgan… https://en.m.wikipedia.org/wiki/De_Morgan%27s_laws
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.
Good catch!
But lets think about this.
The intent is, while flying home, to not interrupt the rescue unless the GPS data is such that the quad would likely be going completely haywire.
So long as the GPS reports a 3D fix, regardless of the satellite count, it is probably sufficient to keep flying home.
However just having a 3D fix, and ignoring the sat count, would not be a sufficient requirement for determining a valid home point.
So we would need to look at this in relation to the rescue process itself.
The test for arming in GPS Rescue mode, if a valid home point is required, should be the presence of both a 3D fix and at least min satellites.
The test for continuing the rescue should be only that we have a 3D 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.
Agree, we should remove the second part of the condition here ... 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.
Yes I think we only require the 3D fix check here.
This comment has been minimized.
This comment has been minimized.
f8d7f0a
to
30a7d6a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
AUTOMERGE: (FAIL)
|
30a7d6a
to
107eae8
Compare
This comment has been minimized.
This comment has been minimized.
107eae8
to
2ab4e3e
Compare
This comment has been minimized.
This comment has been minimized.
Initialize next_fix
2ab4e3e
to
bb59a7d
Compare
This comment has been minimized.
This comment has been minimized.
77b3750
to
7e5d756
Compare
This comment has been minimized.
This comment has been minimized.
7e5d756
to
fd8752b
Compare
This comment has been minimized.
This comment has been minimized.
The original change ([Fix gps new data) was to fix the gating for sending data to GPS rescue. The PR added a a version info poll message and changed the PR name to that. That seems something different than the original fix. The version info isn't currently processed--is the intent to add parsing the return message and saving and/or doing something with the info? That would be cool, I'd like to use that for the GPS status info I'm working on. I was planning on adding a version info poll at some point. Also a lot of discussion in the discord #imu-development channel on using version info to select which protocol version of config commands to use (to support M10). |
Yes - you are right. I will revert second commit and open a new PR as I was following along the discord channel to keep fixes and improvements separated.
That is the intent. |
fd8752b
to
bb59a7d
Compare
Do you want to test this code? Here you have an automated build: |
@ZzyzxTek @haslinghuis @KarateBrot @ledvinap @KarateBrot ... I think this PR now makes just a small change, and a useful one. The GPS code should keep receiving data even if sat count is low, so long as the unit provides a 3D fix the data should be usable. If the data is not usable, or there is no 3D fix, a sanity check will handle that. If everyone is OK with the PR as it is, please approve so we can merge it. |
Fix gps new data Initialize next_fix
Fix gps new data Initialize next_fix
Fixes gating for sending data in
onGpsNewData