diff --git a/AntennaTracker/GCS_Mavlink.cpp b/AntennaTracker/GCS_Mavlink.cpp index 34a869d93b..cd5018ccb9 100644 --- a/AntennaTracker/GCS_Mavlink.cpp +++ b/AntennaTracker/GCS_Mavlink.cpp @@ -461,11 +461,8 @@ void GCS_MAVLINK_Tracker::handleMessage(mavlink_message_t* msg) break; case MAV_CMD_GET_HOME_POSITION: - send_home(tracker.ahrs.get_home()); - Location ekf_origin; - if (tracker.ahrs.get_origin(ekf_origin)) { - send_ekf_origin(ekf_origin); - } + send_home(); + send_ekf_origin(); result = MAV_RESULT_ACCEPTED; break; diff --git a/AntennaTracker/system.cpp b/AntennaTracker/system.cpp index e488e438ec..2c4a85cc39 100644 --- a/AntennaTracker/system.cpp +++ b/AntennaTracker/system.cpp @@ -158,11 +158,15 @@ void Tracker::set_home(struct Location temp) { set_home_eeprom(temp); current_loc = temp; - gcs().send_home(temp); + + // check EKF origin has been set Location ekf_origin; if (ahrs.get_origin(ekf_origin)) { - gcs().send_ekf_origin(ekf_origin); + ahrs.set_home(temp); } + + gcs().send_home(); + gcs().send_ekf_origin(); } void Tracker::arm_servos()