hi,
after I learned coding in apm 2.22.i find that formula to calculate the distance between waypoint is:
if(loc1->lat == 0 || loc1->lng == 0)
return -1;
if(loc2->lat == 0 || loc2->lng == 0)
return -1;
float dlat = (float)(loc2->lat - loc1->lat);
float dlong= ((float)(loc2->lng - loc1->lng)) * scaleLongDown;
wp_distance= (sqrt [ (latitude2-latitude1)^2 + (longitude2-longitude1)^2 ) ] ) * 0.01113195;
my question is:
function "scaleLongDown" is used for what, and how its value?
Where the value " 0.01113195" obtained from ? and what it use for?
what units used for " wp_distance" obtained ? (kilometer or meter or degree or what?)
thanks.
Tags: 2.22, APM, coding, distance, navigation, tracking, waypoint
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.24 members
1298 members
47 members
87 members
183 members
© 2013 Created by Chris Anderson.
Powered by
