Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FreePilot PinDetect mbed-src
Fork of FreePilot_V2-2 by
Diff: utilities.cpp
- Revision:
- 57:0299098b2d0e
- Parent:
- 56:456d454d9ced
--- a/utilities.cpp Sun Mar 29 16:03:18 2015 +0000 +++ b/utilities.cpp Wed Apr 01 01:19:30 2015 +0000 @@ -5,7 +5,11 @@ { double angle = ((int)((angle2-90 )* -1 + 360) + 180) % 360 - 180; double diff_angle = angle1 - angle; - diff_angle = ((int)diff_angle + 180) % 360 - 180; + + diff_angle = angle_normal(diff_angle,-180,180); + // diff_angle = ((int)diff_angle + 180) % 360 - 180; + + if ( abs(diff_angle) > 90 ) { if ( (abs(360 - diff_angle)) > 90 ) { diff_angle = abs(360 - diff_angle);