Browse Source

Copter: always update current_loc regardless of inav state

If inertial nav is not initialised these will be set to zero anyway
master
Randy Mackay 10 years ago
parent
commit
9e156d2f81
  1. 11
      ArduCopter/navigation.pde

11
ArduCopter/navigation.pde

@ -16,12 +16,11 @@ static void run_nav_updates(void) @@ -16,12 +16,11 @@ static void run_nav_updates(void)
}
// calc_position - get lat and lon positions from inertial nav library
static void calc_position(){
if (ap.home_is_set) {
// pull position from interial nav library
current_loc.lng = inertial_nav.get_longitude();
current_loc.lat = inertial_nav.get_latitude();
}
static void calc_position()
{
// pull position from interial nav library
current_loc.lng = inertial_nav.get_longitude();
current_loc.lat = inertial_nav.get_latitude();
}
// calc_distance_and_bearing - calculate distance and bearing to next waypoint and home

Loading…
Cancel
Save