AP_NavEKF3: replace location_offset() and get_distance() function calls with Location object member function calls

This allows removing duplicated code
This commit is contained in:
Dr.-Ing. Amilcar do Carmo Lucas 2019-02-25 01:16:24 +01:00 committed by Peter Barker
parent 79ee52917f
commit 390e0fa601
1 changed files with 2 additions and 2 deletions

View File

@ -325,7 +325,7 @@ bool NavEKF3_core::getLLH(struct Location &loc) const
if (filterStatus.flags.horiz_pos_abs || filterStatus.flags.horiz_pos_rel) {
loc.lat = EKF_origin.lat;
loc.lng = EKF_origin.lng;
location_offset(loc, outputDataNew.position.x, outputDataNew.position.y);
loc.offset(outputDataNew.position.x, outputDataNew.position.y);
return true;
} else {
// we could be in constant position mode because the vehicle has taken off without GPS, or has lost GPS
@ -338,7 +338,7 @@ bool NavEKF3_core::getLLH(struct Location &loc) const
return true;
} else {
// if no GPS fix, provide last known position before entering the mode
location_offset(loc, lastKnownPositionNE.x, lastKnownPositionNE.y);
loc.offset(lastKnownPositionNE.x, lastKnownPositionNE.y);
return false;
}
}