mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_NavEKF3: constrain vertical error
this prevents a floating point exception with external AHRS
This commit is contained in:
parent
1e75bb971e
commit
59fa794818
@ -824,7 +824,7 @@ void NavEKF3_core::calcOutputStates()
|
||||
// Coefficients selected to place all three filter poles at omega
|
||||
const float CompFiltOmega = M_2PI * constrain_float(frontend->_hrt_filt_freq, 0.1f, 30.0f);
|
||||
float omega2 = CompFiltOmega * CompFiltOmega;
|
||||
float pos_err = outputDataNew.position.z - vertCompFiltState.pos;
|
||||
float pos_err = constrain_float(outputDataNew.position.z - vertCompFiltState.pos, -1e5, 1e5);
|
||||
float integ1_input = pos_err * omega2 * CompFiltOmega * imuDataNew.delVelDT;
|
||||
vertCompFiltState.acc += integ1_input;
|
||||
float integ2_input = delVelNav.z + (vertCompFiltState.acc + pos_err * omega2 * 3.0f) * imuDataNew.delVelDT;
|
||||
|
Loading…
Reference in New Issue
Block a user