mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-25 18:18:49 -04:00
No longer blocking before initing home
This commit is contained in:
parent
dc2103d67f
commit
7820d96f4c
@ -192,20 +192,9 @@ static void set_next_WP(struct Location *wp)
|
|||||||
static void init_home()
|
static void init_home()
|
||||||
{
|
{
|
||||||
home_is_set = true;
|
home_is_set = true;
|
||||||
|
|
||||||
// block until we get a good fix
|
|
||||||
// -----------------------------
|
|
||||||
while (!g_gps->new_data || !g_gps->fix) {
|
|
||||||
g_gps->update();
|
|
||||||
// we need GCS update while waiting for GPS, to ensure
|
|
||||||
// we react to HIL mavlink
|
|
||||||
gcs_update();
|
|
||||||
}
|
|
||||||
|
|
||||||
home.id = MAV_CMD_NAV_WAYPOINT;
|
home.id = MAV_CMD_NAV_WAYPOINT;
|
||||||
home.lng = g_gps->longitude; // Lon * 10**7
|
home.lng = g_gps->longitude; // Lon * 10**7
|
||||||
home.lat = g_gps->latitude; // Lat * 10**7
|
home.lat = g_gps->latitude; // Lat * 10**7
|
||||||
//home.alt = max(g_gps->altitude, 0); // we sometimes get negatives from GPS, not valid
|
|
||||||
home.alt = 0; // Home is always 0
|
home.alt = 0; // Home is always 0
|
||||||
|
|
||||||
// to point yaw towards home until we set it with Mavlink
|
// to point yaw towards home until we set it with Mavlink
|
||||||
@ -220,7 +209,7 @@ static void init_home()
|
|||||||
// Save prev loc this makes the calcs look better before commands are loaded
|
// Save prev loc this makes the calcs look better before commands are loaded
|
||||||
prev_WP = home;
|
prev_WP = home;
|
||||||
|
|
||||||
//
|
// in case we RTL
|
||||||
next_WP = home;
|
next_WP = home;
|
||||||
|
|
||||||
// Load home for a default guided_WP
|
// Load home for a default guided_WP
|
||||||
|
Loading…
Reference in New Issue
Block a user