fix ADSB cardinal for broken mag direction#11076
Conversation
PR Compliance Guide 🔍(Compliance updated until commit 91144d6)Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit af27616
|
||||||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
97c8c7f to
9d5eb63
Compare
|
I requested the change to use COG on airplanes. This change to COG aligns with what is currently used for the home arrow on airplanes. It bypasses any potential compass issues which don't matter on airplanes. I had been originally testing ADSB with a GPS unit that was spitting out bad GPS headings, it was throwing off the FC compass - and therefore also throwing off ADSB. I have tested this, and this PR fixes the ADSB direction issues I was originally having with a fixed wing. Works great. Thanks @error414 ! |
9d5eb63 to
fba6de1
Compare
* apply good suggestion from qodo-merge-pro
fba6de1 to
91144d6
Compare
|
Today tested and it works like a charm QODO:
|
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
|
QODO
|


User description
Use same calculation for fixed wings as "direction to home". For fixed wing is used posControl.actualState.cog instead of osdGetHeading(), I have no idea why.
But some people reported that direction to ADSB aircraft is wrong, I have no able to reproduce the issue.
PR Type
Bug fix, Enhancement
Description
Fix ADSB cardinal direction calculation for broken magnetic heading
osdGetFlightDirection()functionImproved GPS environment validation for ADSB distance/bearing calculations
isEnvironmentOkForCalculatingADSBDistanceBearing()to support GPS fix estimationEnhanced ADSB info element to display status indicators
Code quality improvements and formatting consistency
Diagram Walkthrough
File Walkthrough
adsb.c
Enhance GPS validation and rename environment check functionsrc/main/io/adsb.c
enviromentOkForCalculatingDistaceBearing()toisEnvironmentOkForCalculatingADSBDistanceBearing()with improved logicUSE_GPS_FIX_ESTIMATIONifdefadsb.h
Update function declaration for GPS validationsrc/main/io/adsb.h
isEnvironmentOkForCalculatingADSBDistanceBearing()osd.c
Refactor direction calculation and add validation checkssrc/main/io/osd.c
osdGetFlightDirection()helper function for consistentdirection calculation
indicators
issues, 'H' for IMU heading problems
throughout ADSB sections
feature
ADSB.md
Document ADSB info element status indicatorsdocs/ADSB.md
IMU issues, 'G' for GPS issues, number for aircraft count
elements