|
|
|
@ -72,15 +72,16 @@ bool Copter::set_home(const Location& loc, bool lock)
@@ -72,15 +72,16 @@ bool Copter::set_home(const Location& loc, bool lock)
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const bool home_was_set = ahrs.home_is_set(); |
|
|
|
|
|
|
|
|
|
// set ahrs home (used for RTL)
|
|
|
|
|
ahrs.set_home(loc); |
|
|
|
|
|
|
|
|
|
// init inav and compass declination
|
|
|
|
|
if (!ahrs.home_is_set()) { |
|
|
|
|
if (!home_was_set) { |
|
|
|
|
// update navigation scalers. used to offset the shrinking longitude as we go towards the poles
|
|
|
|
|
scaleLongDown = longitude_scale(loc); |
|
|
|
|
// record home is set
|
|
|
|
|
ahrs.set_home_status(HOME_SET_NOT_LOCKED); |
|
|
|
|
Log_Write_Event(DATA_SET_HOME); |
|
|
|
|
|
|
|
|
|
#if MODE_AUTO_ENABLED == ENABLED |
|
|
|
@ -96,7 +97,7 @@ bool Copter::set_home(const Location& loc, bool lock)
@@ -96,7 +97,7 @@ bool Copter::set_home(const Location& loc, bool lock)
|
|
|
|
|
|
|
|
|
|
// lock home position
|
|
|
|
|
if (lock) { |
|
|
|
|
ahrs.set_home_status(HOME_SET_AND_LOCKED); |
|
|
|
|
ahrs.lock_home(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// log ahrs home and ekf origin dataflash
|
|
|
|
|