AP_ADSB: sanity check data via valid_flags before forwarding to avoidance lib

This commit is contained in:
Tom Pittenger 2016-08-01 12:47:18 -07:00
parent 5c0b5f5cd1
commit f7c2df8e91
1 changed files with 9 additions and 1 deletions

View File

@ -447,7 +447,15 @@ void AP_ADSB::update_vehicle(const mavlink_message_t* packet)
}
} // if buffer full
push_sample(vehicle); // note that set_vehicle modifies vehicle
const uint16_t required_flags_avoidance =
ADSB_FLAGS_VALID_COORDS |
ADSB_FLAGS_VALID_ALTITUDE |
ADSB_FLAGS_VALID_HEADING |
ADSB_FLAGS_VALID_VELOCITY;
if (vehicle.info.flags & required_flags_avoidance) {
push_sample(vehicle); // note that set_vehicle modifies vehicle
}
}
/*