Copter: adsb handling simply logs error to dataflash
This commit is contained in:
parent
4ef53427f2
commit
e6f8d812d3
@ -42,6 +42,21 @@ void Copter::adsb_update(void)
|
||||
*/
|
||||
void Copter::adsb_handle_vehicle_threats(void)
|
||||
{
|
||||
// handle clearing of threat
|
||||
if (adsb.get_is_evading_threat() && !adsb.get_another_vehicle_within_radius()) {
|
||||
adsb.set_is_evading_threat(false);
|
||||
Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_ADSB, ERROR_CODE_FAILSAFE_RESOLVED);
|
||||
gcs_send_text(MAV_SEVERITY_CRITICAL, "ADS-B threat cleared");
|
||||
return;
|
||||
}
|
||||
|
||||
// handle new threat
|
||||
if (!adsb.get_is_evading_threat() && adsb.get_another_vehicle_within_radius()) {
|
||||
adsb.set_is_evading_threat(true);
|
||||
Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_ADSB, ERROR_CODE_FAILSAFE_OCCURRED);
|
||||
gcs_send_text(MAV_SEVERITY_CRITICAL, "ADS-B threat!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // #ADSB_ENABLED
|
||||
|
@ -352,6 +352,7 @@ enum FlipState {
|
||||
#define ERROR_SUBSYSTEM_FAILSAFE_EKFINAV 17
|
||||
#define ERROR_SUBSYSTEM_BARO 18
|
||||
#define ERROR_SUBSYSTEM_CPU 19
|
||||
#define ERROR_SUBSYSTEM_FAILSAFE_ADSB 20
|
||||
// general error codes
|
||||
#define ERROR_CODE_ERROR_RESOLVED 0
|
||||
#define ERROR_CODE_FAILED_TO_INITIALISE 1
|
||||
|
Loading…
Reference in New Issue
Block a user