![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
change kalman
Dependencies: ADXL345 AigamozuControlPackets HMC5843 ITG3200 MBed_Adafruit-GPS-Library XBee agzIDLIST agz_common mbed
Fork of Aigamozu_Base_ver3 by
Revision 15:35e3917fcbf5, committed 2015-05-27
- Comitter:
- s1200058
- Date:
- Wed May 27 12:12:04 2015 +0000
- Parent:
- 14:3aa6d735a2fa
- Commit message:
- define the range of error
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3aa6d735a2fa -r 35e3917fcbf5 main.cpp --- a/main.cpp Mon May 25 11:38:09 2015 +0000 +++ b/main.cpp Wed May 27 12:12:04 2015 +0000 @@ -79,6 +79,7 @@ ///////////////////////////////////////// #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センサの分散 @@ -155,11 +156,11 @@ } if(flag >= 16){ -// 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; + change = 1; } - else{ +/* else{ change = 0; }