mag_cal: fix mag bias estimate to mag cal

- since last_us is set to 0 every time the bias is not observable, the
  total time was also reset -> needed 30 consecutive seconds in mag 3D
  to be declared "stable"
- after landing, the mag_aligned_in_flight flag is reset. Using this for
  bias validity makes it invalid before we have a chance to save it to
  the calibration.
This commit is contained in:
bresch
2023-07-11 11:33:53 -04:00
committed by Daniel Agar
parent 69aa8689c0
commit 2f52926972
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ void Magnetometer::SensorCorrectionsUpdate(bool force)
bool Magnetometer::set_offset(const Vector3f &offset)
{
if (Vector3f(_offset - offset).longerThan(0.01f)) {
if (Vector3f(_offset - offset).longerThan(0.005f)) {
if (offset.isAllFinite()) {
_offset = offset;
_calibration_count++;