1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-21 15:25:29 +03:00
This commit is contained in:
Tony Yeung 2021-02-23 00:35:27 +00:00
parent 3a599d9842
commit 3aa2edf5d7

View file

@ -77,7 +77,7 @@ fpVector3_t original_rth_home; // the original rth home - save it, sin
radar_pois_t radar_pois[RADAR_MAX_POIS]; radar_pois_t radar_pois[RADAR_MAX_POIS];
#if defined(USE_SAFE_HOME) #if defined(USE_SAFE_HOME)
int8_t safehome_index; // -1 if no safehome, 0 to MAX_SAFEHOMES -1 otherwise int8_t safehome_index = -1; // -1 if no safehome, 0 to MAX_SAFEHOMES -1 otherwise
uint32_t safehome_distance = 0; // distance to the nearest safehome uint32_t safehome_distance = 0; // distance to the nearest safehome
fpVector3_t nearestSafeHome; // The nearestSafeHome found during arming fpVector3_t nearestSafeHome; // The nearestSafeHome found during arming
bool safehome_applied = false; // whether the safehome has been applied to home. bool safehome_applied = false; // whether the safehome has been applied to home.
@ -2416,7 +2416,9 @@ void updateHomePosition(void)
} }
if (setHome) { if (setHome) {
#if defined(USE_SAFE_HOME) #if defined(USE_SAFE_HOME)
if (navConfig()->general.flags.safehome_usage_mode != SAFEHOME_USAGE_OFF) {
findNearestSafeHome(); findNearestSafeHome();
}
#endif #endif
setHomePosition(&posControl.actualState.abs.pos, posControl.actualState.yaw, NAV_POS_UPDATE_XY | NAV_POS_UPDATE_Z | NAV_POS_UPDATE_HEADING, navigationActualStateHomeValidity()); setHomePosition(&posControl.actualState.abs.pos, posControl.actualState.yaw, NAV_POS_UPDATE_XY | NAV_POS_UPDATE_Z | NAV_POS_UPDATE_HEADING, navigationActualStateHomeValidity());
// save the current location in case it is replaced by a safehome or HOME_RESET // save the current location in case it is replaced by a safehome or HOME_RESET