Skip to content
Snippets Groups Projects
Commit 485cebf8 authored by rmackay9's avatar rmackay9
Browse files

ArduCopter - bug fix to calc_XY_velocity (was using uninitialised...

ArduCopter - bug fix to calc_XY_velocity (was using uninitialised last_longitutde and last_latitude for speed calculations)
parent a122cfcf
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,12 @@ static void calc_XY_velocity(){
// y_GPS_speed positve = Up
// x_GPS_speed positve = Right
// initialise last_longitude and last_latitude
if( last_longitude == 0 && last_latitude == 0 ) {
last_longitude = g_gps->longitude;
last_latitude = g_gps->latitude;
}
// this speed is ~ in cm because we are using 10^7 numbers from GPS
float tmp = 1.0/dTnav;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment