Skip to content

Commit

Permalink
EKF: Allow use of large GPS position observation noise when using oth…
Browse files Browse the repository at this point in the history
…er aiding sources (PX4#403)
  • Loading branch information
priseborough authored Mar 27, 2018
1 parent 8a01243 commit 1bb4c17
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions EKF/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,16 @@ void Ekf::controlGpsFusion()

// calculate observation process noise
float lower_limit = fmaxf(_params.gps_pos_noise, 0.01f);
float upper_limit = fmaxf(_params.pos_noaid_noise, lower_limit);
_posObsNoiseNE = math::constrain(_gps_sample_delayed.hacc, lower_limit, upper_limit);
if (_control_status.flags.opt_flow || _control_status.flags.ev_pos) {
// if we are using other sources of aiding, then relax the upper observation
// noise limit which prevents bad GPS perturbing the position estimate
_posObsNoiseNE = fmaxf(_gps_sample_delayed.hacc, lower_limit);
} else {
// if we are not using another source of aiding, then we are reliant on the GPS
// observations to constrain attitude errors and must limit the observation noise value.
float upper_limit = fmaxf(_params.pos_noaid_noise, lower_limit);
_posObsNoiseNE = math::constrain(_gps_sample_delayed.hacc, lower_limit, upper_limit);
}
_velObsVarNE(1) = _velObsVarNE(0) = sq(fmaxf(_gps_sample_delayed.sacc, _params.gps_vel_noise));

// calculate innovations
Expand Down

0 comments on commit 1bb4c17

Please sign in to comment.