Skip to content

Commit

Permalink
AP_NavEKF3: fix setOriginLLH check
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Aug 12, 2020
1 parent c8fcb60 commit d90d748
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libraries/AP_NavEKF3/AP_NavEKF3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,10 +1187,9 @@ bool NavEKF3::setOriginLLH(const Location &loc)
if (!core) {
return false;
}
if (_sources.getPosXYSource() != AP_NavEKF_Source::SourceXY::EXTNAV) {
// we don't allow setting of the EKF origin unless we are
// flying in non-GPS mode. This is to prevent accidental set
// of EKF origin with invalid position or height
if (_sources.getPosXYSource() == AP_NavEKF_Source::SourceXY::GPS) {
// we don't allow setting of the EKF origin if using GPS to prevent
// accidental setting of EKF origin with invalid position or height
gcs().send_text(MAV_SEVERITY_WARNING, "EKF3 refusing set origin");
return false;
}
Expand Down

0 comments on commit d90d748

Please sign in to comment.