2015/06/09

Dependencies:   ADXL345 AigamozuControlPackets HMC5843 ITG3200 MBed_Adafruit-GPS-Library XBee agzIDLIST mbed

Fork of Aigamozu_Robot_ver4_4 by aigamozu

Revision:
35:3094c84a024b
Parent:
34:9c3192c00e41
Child:
36:a11060f5199e
--- a/main.cpp	Mon May 25 11:06:34 2015 +0000
+++ b/main.cpp	Wed May 27 12:10:20 2015 +0000
@@ -99,6 +99,8 @@
 /////////////////////////////////////////
 #define FIRST_S2 0.000001
 #define COUNTER_MAX 10000
+#define ERROR_RANGE 0.001
+
 double x_cur,x_prev,y_cur,y_prev;//緯度と経度の時刻tと時刻t-1での推定値
 double s2x_cur=FIRST_S2,s2x_prev=FIRST_S2,s2y_cur=FIRST_S2,s2y_prev=FIRST_S2;//緯度経度のの時刻tと時刻t-1での共分散
 double s2_R=FIRST_S2;//GPSセンサの分散
@@ -198,7 +200,7 @@
         }
             
         if(flag >= 6){
-            if(abs(x_prev - agz.get_agzPoint_lati()) < 0.001 && abs(y_prev - agz.get_agzPoint_longi()) < 0.001){
+            if(abs(x_prev - agz.get_agzPoint_lati()) < ERROR_RANGE && abs(y_prev - agz.get_agzPoint_longi()) < ERROR_RANGE){
                 Kalman(agz.get_agzPoint_lati(), agz.get_agzPoint_longi());
                 change = 1;
             }