kopia lustrzana https://github.com/pjalocha/esp32-ogn-tracker
Add conversion table from OGN aircraft-type to ArduPilot emitter_type
rodzic
1394569fdd
commit
dcd915f9fd
|
@ -251,14 +251,19 @@ class OGN_Packet // Packet structure for the OGN tracker
|
||||||
MAV->ver_velocity = 10*DecodeClimbRate(); // [cm/s]
|
MAV->ver_velocity = 10*DecodeClimbRate(); // [cm/s]
|
||||||
MAV->flags = 0x1F; // all valid except for Squawk, not simulated
|
MAV->flags = 0x1F; // all valid except for Squawk, not simulated
|
||||||
MAV->altitude_type = 1; // GPS altitude
|
MAV->altitude_type = 1; // GPS altitude
|
||||||
static char Prefix[4] = { 'R', 'I', 'F', 'O' }; // prefix for Random, ICAO, Flarm and OGN address-types
|
const static char Prefix[4] = { 'R', 'I', 'F', 'O' }; // prefix for Random, ICAO, Flarm and OGN address-types
|
||||||
MAV->callsign[0] = Prefix[Header.AddrType]; // create a call-sign from address-type and address
|
MAV->callsign[0] = Prefix[Header.AddrType]; // create a call-sign from address-type and address
|
||||||
Format_Hex((char *)MAV->callsign+1, ( uint8_t)(Header.Address>>16)); // highest byte
|
Format_Hex((char *)MAV->callsign+1, ( uint8_t)(Header.Address>>16)); // highest byte
|
||||||
Format_Hex((char *)MAV->callsign+3, (uint16_t)(Header.Address&0xFFFF)); // two lower bytes
|
Format_Hex((char *)MAV->callsign+3, (uint16_t)(Header.Address&0xFFFF)); // two lower bytes
|
||||||
MAV->callsign[7] = 0; // end-of-string for call-sign
|
MAV->callsign[7] = 0; // end-of-string for call-sign
|
||||||
MAV->squawk = 0; // what shall we put there for OGN ?
|
MAV->squawk = 0; // what shall we put there for OGN ?
|
||||||
MAV->tslc = 1; // 1sec for now but should be more precise
|
MAV->tslc = 1; // 1sec for now but should be more precise
|
||||||
MAV->emiter_type = 0; // could be more precise
|
const static uint8_t EmitterType[16] = // conversion table from OGN aircraft-type
|
||||||
|
{ 0, 9, 2, 7, // unknown, glider, towplane, helicopter
|
||||||
|
11, 3, 9, 11, // parachute, drop plane, hang-glider, para-glider
|
||||||
|
2, 3, 15, 10, // powered aircraft, jet aircraft, UFO, balloon
|
||||||
|
10, 14, 2, 19 }; // airship, UAV, ground vehiele, fixed object
|
||||||
|
MAV->emiter_type = EmitterType[Position.AcftType]; // convert from the OGN
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t ReadAPRS(const char *Msg) // read an APRS position message
|
int8_t ReadAPRS(const char *Msg) // read an APRS position message
|
||||||
|
|
Ładowanie…
Reference in New Issue