Tracker: update how current_loc gets location

Get position from EKF but fall back to GPS if that fails
This commit is contained in:
stefanlynka 2016-07-14 17:12:17 +09:00 committed by Randy Mackay
parent a693f9ead6
commit 16c9023cf0
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ void Tracker::update_tracker_position()
{
// update our position if we have at least a 2D fix
// REVISIT: what if we lose lock during a mission and the antenna is moving?
if (gps.status() >= AP_GPS::GPS_OK_FIX_2D) {
if (!ahrs.get_position(current_loc) && (gps.status() >= AP_GPS::GPS_OK_FIX_2D)) {
current_loc = gps.location();
}
}