Conversation
Updated YAML description Set defaults
shellixyz
left a comment
There was a problem hiding this comment.
Please fix the formatting:
- 4 spaces indentation
- space between
)and{, around math operators and= - choose between snake case and camel case for function and argument names, please don't use both or full lowercase
src/main/io/adsb.c
Outdated
|
|
||
| *dist = sqrtf(sq(dLat) + sq(dLon)) * DISTANCE_BETWEEN_TWO_LONGITUDE_POINTS_AT_EQUATOR; | ||
| *bearing = 9000.0f + RADIANS_TO_CENTIDEGREES(atan2_approx(-dLat, dLon)); // Convert the output radians to 100xdeg | ||
| if (*bearing < 0){ |
There was a problem hiding this comment.
You could probably use wrap_36000 there
There was a problem hiding this comment.
cool - will get all these done first thing tomorrow
src/main/io/adsb.c
Outdated
|
|
||
| void adsbNewVehicle(uint32_t avicao, int32_t avlat, int32_t avlon, int32_t avalt) | ||
| { | ||
| uint32_t avdist; int32_t avdir; uint8_t avupdate = 1; |
There was a problem hiding this comment.
One line for each variable declaration please
src/main/io/adsb.c
Outdated
|
|
||
| void GPS_distance_cm_bearing(int32_t currentLat1, int32_t currentLon1, int32_t destinationLat2, int32_t destinationLon2, uint32_t *dist, int32_t *bearing) | ||
| { | ||
| #define DISTANCE_BETWEEN_TWO_LONGITUDE_POINTS_AT_EQUATOR 1.113195f // MagicEarthNumber from APM |
There was a problem hiding this comment.
This should be defined elsewhere. It is already defined in navigation_private.h. Perhaps it should be moved in navigation.h
There was a problem hiding this comment.
If OK I would like to leave here - Once I have fully understood the navigation code I think we can remove and migrate to use existing - but it is quite complex and will take some time..
src/main/io/adsb.c
Outdated
| } | ||
| avdist /= 100; avdir /= 100; | ||
| #if defined(USE_NAV) | ||
| avalt -= getEstimatedActualPosition(Z)+GPS_home.alt; |
There was a problem hiding this comment.
Space around + for readability
src/main/io/adsb.c
Outdated
| void adsbNewVehicle(uint32_t avicao, int32_t avlat, int32_t avlon, int32_t avalt) | ||
| { | ||
| uint32_t avdist; int32_t avdir; uint8_t avupdate = 1; | ||
| if (STATE(GPS_FIX) && gpsSol.numSat >= 5){ |
src/main/io/osd.c
Outdated
| for (int i = 0; i <= adsblen; i++) { | ||
| buff[i] = SYM_BLANK; | ||
| } | ||
| buff[adsblen]='\0'; |
src/main/io/osd.c
Outdated
| adsblen=1; | ||
| buff[0] = SYM_ADSB; | ||
| if ((adsb.dist > 0) && (adsb.dist < osdConfig()->adsb_range)){ | ||
| osdFormatDistanceStr(&buff[1], adsb.dist*100); |
There was a problem hiding this comment.
Please replace &buff[1] with buff + 1
src/main/io/osd.c
Outdated
| int dir = osdGetHeadingAngle(adsb.dir + 11); | ||
| unsigned arrowOffset = dir * 2 / 45; | ||
| buff[adsblen-1]=SYM_ARROW_UP + arrowOffset; | ||
| osdFormatDistanceStr(&buff[adsblen], adsb.alt*100); |
There was a problem hiding this comment.
&buff[adsblen] -> buff + adsblen
src/main/fc/settings.yaml
Outdated
| description: "Distance outside which adsb aircraft are NOT displayed. In meters" | ||
| default_value: 20000 | ||
| field: adsb_range | ||
| min: 0 |
There was a problem hiding this comment.
Default min is 0 so this is not needed but it won't hurt
src/main/fc/settings.yaml
Outdated
| type: bool | ||
| default_value: OFF | ||
| - name: osd_adsb_range | ||
| description: "Distance outside which adsb aircraft are NOT displayed. In meters" |
There was a problem hiding this comment.
ADSB should be uppercased
|
@shellixyz thanks for the review. Appreciated question - There is wiki and docs - is there a preference? Both seem to be active and used. |
|
This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. |
|
Automatically closing as inactive. |
ADSB support for uAvionix pingRX tiny ADSB (and others).
OSD displays the nearest ADSB equipped aircraft.
OSD adsb data flashes as warning if within set distance for proximity warning of other aircraft
Wiki page prepared with full details:
(updated and with missing files added from original PR: #6192)
GUI PR #1294