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.
Diff: AoA_Est.h
- Revision:
- 11:8574bb5b92b0
- Parent:
- 8:aaf5cde0aa0a
- Child:
- 13:d221d9ef6338
--- a/AoA_Est.h	Thu Apr 28 06:16:10 2016 +0000
+++ b/AoA_Est.h	Thu Apr 28 06:21:10 2016 +0000
@@ -97,15 +97,11 @@
 
     for (int i = 0; i < sensors-1; i++) {
         distance = distanceFinder(phases[i]);
+        distance = (distance > sensorSep[i]) ? distance - 338400/sampleRate : distance;
         angle = acos(distance / sensorSep[i])*180/3.1415923535;
         ambigAngles[0][i] = sensorAngles[i] - angle; //Potentially swap +/-
         ambigAngles[1][i] = sensorAngles[i] + angle;
-    //  if (distance > 0) {
-            //ambigAngles[0][i] = (int(ambigAngles[0][i]) + 180) % 360;  //Check
-            //ambigAngles[1][i] = (int(ambigAngles[1][i]) + 180) % 360; //Not sure
-    //      ambigAngles[0][i] = angle - sensorAngles[i];
-    //      ambigAngles[1][i] = sensorAngles[i] + angle;
-    //  }
+
         ambigAngles[0][i] = (ambigAngles[0][i] < 0) ? ambigAngles[0][i] + 360 : ambigAngles[0][i];
         ambigAngles[1][i] = (ambigAngles[1][i] < 0) ? ambigAngles[1][i] + 360 : ambigAngles[1][i];
     }