Subversion Repositories FlightCtrl

Rev

Rev 838 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 838 Rev 966
Line 414... Line 414...
414
        Hy_corr = (Hy * cos_roll +  Hz * sin_roll) / 8192;
414
    Hy_corr = (Hy * cos_roll +  Hz * sin_roll) / 8192;
Line 415... Line 415...
415
 
415
   
416
        // calculate Heading
416
    // calculate Heading
Line -... Line 417...
-
 
417
    heading = c_atan2(Hy_corr, Hx_corr);
-
 
418
   
-
 
419
#if 0
-
 
420
    DebugOut.Analog[3] =  Hx;
-
 
421
    DebugOut.Analog[4]  = Hy;
-
 
422
    DebugOut.Analog[5]  = Hz;
417
        heading = c_atan2(Hy_corr, Hx_corr);
423
#endif
418
 
424
   
419
    // atan returns angular range from -180 deg to 180 deg in counter clockwise notation
425
    // atan returns angular range from -180 deg to 180 deg in counter clockwise notation
420
    // but the compass course is defined in a range from 0 deg to 360 deg clockwise notation.
426
    // but the compass course is defined in a range from 0 deg to 360 deg clockwise notation.
421
        if (heading < 0) heading = -heading;
427
    if (heading < 0) heading = -heading;