HomePosition: Add minimum position change needed to be recognised as new home position

This commit is contained in:
Konrad
2024-04-17 13:42:25 +02:00
committed by KonradRudin
parent 1c213fa760
commit 664a0f2cda
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -34,6 +34,8 @@
#include "HomePosition.hpp"
#include <math.h>
#include <lib/geo/geo.h>
#include "commander_helper.h"
@@ -83,7 +85,8 @@ bool HomePosition::hasMovedFromCurrentHomeLocation()
}
}
return (home_dist_xy > eph * 2.f) || (home_dist_z > epv * 2.f);
return (home_dist_xy > fmaxf(eph * 2.f, kMinHomePositionChangeEPH))
|| (home_dist_z > fmaxf(epv * 2.f, kMinHomePositionChangeEPV));
}
bool HomePosition::setHomePosition(bool force)