|
|
@ -24,7 +24,7 @@ void Copter::set_home_to_current_location_inflight() { |
|
|
|
// get current location from EKF
|
|
|
|
// get current location from EKF
|
|
|
|
Location temp_loc; |
|
|
|
Location temp_loc; |
|
|
|
Location ekf_origin; |
|
|
|
Location ekf_origin; |
|
|
|
if (ahrs.get_position(temp_loc) && ahrs.get_origin(ekf_origin)) { |
|
|
|
if (ahrs.get_location(temp_loc) && ahrs.get_origin(ekf_origin)) { |
|
|
|
temp_loc.alt = ekf_origin.alt; |
|
|
|
temp_loc.alt = ekf_origin.alt; |
|
|
|
if (!set_home(temp_loc, false)) { |
|
|
|
if (!set_home(temp_loc, false)) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -40,7 +40,7 @@ void Copter::set_home_to_current_location_inflight() { |
|
|
|
bool Copter::set_home_to_current_location(bool lock) { |
|
|
|
bool Copter::set_home_to_current_location(bool lock) { |
|
|
|
// get current location from EKF
|
|
|
|
// get current location from EKF
|
|
|
|
Location temp_loc; |
|
|
|
Location temp_loc; |
|
|
|
if (ahrs.get_position(temp_loc)) { |
|
|
|
if (ahrs.get_location(temp_loc)) { |
|
|
|
if (!set_home(temp_loc, lock)) { |
|
|
|
if (!set_home(temp_loc, lock)) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|