Is there a method to request what the global origin is from the autopilot? I know that it is setup to answer once the ardupilot receives one, but what if one has already been set and the request is denied? It seems that the autopilot wouldn’t respond with the latest…
See the code snippet below from the repository:
// sets ekf_origin if it has not been set.
// should only be used when there is no GPS to provide an absolute position
void GCS_MAVLINK::set_ekf_origin(const Location& loc)
{
// check location is valid
if (!loc.check_latlng()) {
return;
}
AP_AHRS &ahrs = AP::ahrs();
// check if EKF origin has already been set
Location ekf_origin;
if (ahrs.get_origin(ekf_origin)) {
return;
}
if (!ahrs.set_origin(loc)) {
return;
}
ahrs.Log_Write_Home_And_Origin();
// send ekf origin to GCS
if (!try_send_message(MSG_ORIGIN)) {
// try again later
send_message(MSG_ORIGIN);
}
}