Navigation Using Bearing and heading

Hi everyone 

I am currently working on autopilot code for a fixed wing UAV 

I am using flightgear as a simulator and coding in C# .

I am getting heading value from FG wich I believe is the compass value means my current direction and I calculating the bearing as follow 

DX = PointB.x - PointA.x
DY = PointB.y - PointA.y
angle in radians = atan2(DY, DX)
      angle in degrees = radians * (180 / Pi)
        angle = fmod(angle + 360, 360)
My question is how to use this data to cntrol my ailerons in order to turn to the right direction of the next waypoint 
please I am stopped here for almost two months of trying all kind of algorithms without any result please help 

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity