mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 12:13:34 +08:00
implemented Kahan summation algorithm for adding process noise to delta
angle- and delta velocity bias variance - the contribution of process noise per iteration for these states can be so small that it gets lost if using standard floating point summation Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
@@ -1722,3 +1722,11 @@ void Ekf::save_mag_cov_data()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float Ekf::kahanSummation(float sum_previous, float input, float &accumulator) const
|
||||
{
|
||||
float y = input - accumulator;
|
||||
float t = sum_previous + y;
|
||||
accumulator = (t - sum_previous) - y;
|
||||
return t;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user