mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 10:00:35 +08:00
HomePosition: Add minimum position change needed to be recognised as new home position
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user