-
-
Notifications
You must be signed in to change notification settings - Fork 147
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 for GPS Data in Table/Graph/Exports #606
Allow for GPS Data in Table/Graph/Exports #606
Conversation
[OLD] Status: If you want to help developing this feature please post here. |
@LinusThorsell how do you know the data is out of sync of the other data? Any easy way to see that? |
This comment has been minimized.
This comment has been minimized.
@McGiverGim If you have a better log file then feel free to test it and confirm or deny my assumptions! (there is also another issue that the GPS heading value is not being properly parsed right now I think, but that is not priority 1 at the moment.) |
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.
I didn't touch the Blackbox since a long time ago, and I don't understand totally your code but I thing you are doing one thing wrong:
- The blackbox have two kind of data. One is directly read from the log. Let's call it direct data. The other is "calculated" based on the direct data because the firmware does not write it.
- You are storing the data of the GPS, and later you are calculating it. I think this complicates the process, is better to store the data in the "standard" chunk and do nothing with the calculated fields.
I think your problem comes from here, you are not taking into account the size of the chunk in all the places, but better we can start cleaning the code with my suggestions and continue from here.
There we go, implemented all the suggestions you had @McGiverGim I think that the changes i pushed should make it work in theory, and it is almost working. What is currently working: What is left to figure out: But the current issue is that the values that the application reads from the frame is incorrect, for example the gps_numSat is reading the gps_ground_course frame data. Anyone got any ideas for how this could happen and what the fix is? |
I'm out of the computer. I will try to give another try tomorrow. |
This comment has been minimized.
This comment has been minimized.
Update: Functionality is completed. Only things that I require assistance with before I am happy to merge:
Things I am going to finish tomorrow:
However, the code in its current state should be fully functional, so feel free to test it out. Will update the PR once I am happy to merge! Pleasure working with you guys! |
Please rebase the PR |
This comment has been minimized.
This comment has been minimized.
@LinusThorsell this is AMAZING! Congratulations! I can see that the GPS altitude being reported here is absolute altitude. Whereas the flight code, after some recent changes, shows 'relative to home point' altitude in the OSD, and logs that value in the debugs, after the home point is set. So now we have to decide whether we are interested in absolute, or relative, altitude. In most cases I think it is best to see 'relative to takeoff point' altitude. It's a lot easier to interpret and compare to our debugs. What do you guys think? If we know the home point, we can transmit absolute altitude to the log, and do the subtraction of the home altitude in the log explorer. Or, in firmware, we can report absolute altitude until armed, then relative altitude. |
Here is a graph showing the GPS Altitude from this PR in cyan, and the smoothed GPS altitude and Baro altitude from the debugs. Data is from the file above. The offset is just because we zero the value to home point in the debug. Altitude values from this PR are PERFECT !!!! NB: Having the GPS values in the log itself will make it much easier for us to set up position hold things since we can see the raw data. |
After line 355, in graph_config.js, adding this will scale
and likewise this would scale
and, finally,
Altitude seems OK. |
Changed GPS Ground Course to GPS Heading Changed GPS numSat to GPS Sat Count Changed gps heading to return from 180 to -180 degrees.
This comment has been minimized.
This comment has been minimized.
@McGiverGim @haslinghuis @ctzsnooze @blckmn I am happy with the feature as it is now. The only issue I know of is that there are still two GPS Altitude fields, I just changed one of them to reported altitude until we have a better solution. What do you guys think of that? Feel free to look over the changes and test the code. I'm giving it my personal LGTM! |
This comment has been minimized.
This comment has been minimized.
@LinusThorsell Re: "The only issue I know of is that there are still two GPS Altitude fields".... My first thought was to leave the name of the 'stock' GPS Altitude field - the one every GPS user will see 'normally' in their logs as "GPS Altitude". However, it may be worth re-naming, since the value displayed is currently a 'raw', non-zeroed, absolute or "Above Seal Level" (ASL) GPS value, updated at whatever frequency the GPS unit sends data. And while the Altitude debug also reports a value with the name "GPS Altitude", that value is the resampled GPS value from position.c. It is 'zeroed' when the GPS system sets its It would be good if, in a separate PR, we would parse the GPS 'H' fields, even if we don't graph them, since they would provide the offset value required for zeroing the ASL value. Hence perhaps it would be best if we could re-name the 'stock' or everyday GPS Altitude value to Once we have GPS 'H' field parsing, the log viewer could, possibly, provide a derived field called |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Fixed the scaling in the most recent commit! |
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.
Great work! I think it's ready.
Please squash the commits.
@ctzsnooze commits will be squashed upon merging. |
Do you want to test this code? Here you have an automated build: |
Great work for your first PR @LinusThorsell, the next step is to draw a map with the gps path :P |
PR for Issue #602
Opening PR to discuss changes required for this feature to be completed.