Hi everyone!
I need to write the code for navigation calculations(distance and bearing) for my UAV project. I went through some of the methods like pythagorus & haversine but I am really confused. Can somebody share the code/method which has been succesfully tested. I am working on PIC18 microcontroller.

Regards

Achal

Views: 100

Reply to This

Replies to This Discussion

For ArduPilot, we're using Jordi's algorithms and code, which is based on this method.
Chris following the link ends up with the:

'This site has been disabled for violations of our Program Policies. If you feel this disabling was in error, please visit our contact page to let us know. Contact Us'

Is it available anywhere else?
Treat the coordinates as coordinates on a flat surface. Really easy..

Here's an example (from my NXT AutoPilot):
float tempHeading=0;
float dX=(gpsLon-gpsLon_old);
float dY=(gpsLat-gpsLat_old);
if(dX!=0)
{
tempHeading=radiansToDegrees(atan(dY/dX));
if(dX<0)
{
if(dY<=0)tempHeading+=180;
else if(tempHeading>270)tempHeading-=180;
}

}
else if(dY!=0)
{
if(dY<0)tempHeading=270;
else tempHeading=90;
}
I know this is an ancient thread, but a great source for this is
http://williams.best.vwh.net/avform.htm

The PIC18 will definitely limit you to the flat-earth approximations.

RSS

Social Networking

Contests

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.

A list of all T3 contests is here

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service