altos: tracker distance computation flipped arguments around
authorKeith Packard <keithp@keithp.com>
Fri, 6 Jun 2014 01:47:27 +0000 (18:47 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 6 Jun 2014 01:47:27 +0000 (18:47 -0700)
ao_distance takes (lat, lon, lat, lon) not (lat, lat, lon, lon)

Signed-off-by: Keith Packard <keithp@keithp.com>
src/product/ao_tracker.c

index d4960d258081a0b0e8223baab5df493c2cfe83af..b4e563ee66d8211998a9d04e6165c2ffd7e1eccf 100644 (file)
@@ -97,12 +97,13 @@ ao_tracker(void)
                                break;
                        case ao_flight_pad:
                                ground_distance = ao_distance(ao_gps_data.latitude,
-                                                             start_latitude,
                                                              ao_gps_data.longitude,
+                                                             start_latitude,
                                                              start_longitude);
                                height = ao_gps_data.altitude - start_altitude;
                                if (height < 0)
                                        height = -height;
+
                                if (ground_distance >= ao_config.tracker_start_horiz ||
                                    height >= ao_config.tracker_start_vert)
                                {