Browse Source

EKF: Don't use GPS to set position noise when not using GPS

master
Paul Riseborough 9 years ago
parent
commit
064a0e4dbc
  1. 10
      EKF/vel_pos_fusion.cpp

10
EKF/vel_pos_fusion.cpp

@ -89,8 +89,13 @@ void Ekf::fuseVelPosHeight() @@ -89,8 +89,13 @@ void Ekf::fuseVelPosHeight()
// observation variance - user parameter defined
// if we are in flight and not using GPS, then use a specific parameter
if (!_control_status.flags.gps && _control_status.flags.in_air) {
R[3] = fmaxf(_params.pos_noaid_noise, 0.5f);
if (!_control_status.flags.gps) {
if (_control_status.flags.in_air) {
R[3] = fmaxf(_params.pos_noaid_noise, _params.gps_pos_noise);
} else {
R[3] = _params.gps_pos_noise;
}
} else {
float lower_limit = fmaxf(_params.gps_pos_noise, 0.01f);
@ -258,5 +263,4 @@ void Ekf::fuseVelPosHeight() @@ -258,5 +263,4 @@ void Ekf::fuseVelPosHeight()
makeSymmetrical();
limitCov();
}
}

Loading…
Cancel
Save