2015/06/09

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

Fork of Aigamozu_Robot_ver4_4 by aigamozu

Revision:
39:f6c7b746f0c4
Parent:
38:01505448b500
--- a/main.cpp	Fri Jun 05 03:47:37 2015 +0000
+++ b/main.cpp	Mon Jun 08 15:48:20 2015 +0000
@@ -46,6 +46,11 @@
 //
 //2015/05/30
 //新カルマンフィルタの実装
+//
+//2015/06/04
+//内外判定の結果によって動きを変えるように変更
+//ロボットA,B,C,D,Eは基地局a,b,c,dの内側を
+//ロボットF,G,H,I,Jは基地局e,f,g,hの内側を走る
 /**********************************************/
 
 #include "mbed.h"
@@ -64,9 +69,9 @@
 //Base    ID: 'a' ~ 'a'
 //manager ID: '0'(数字のゼロ)
 //
-const char MyID = 'C'; 
+const char MyID = 'L';
 
-const int collect_base_address[4]={0,1,2,3};//{4,5,6,7}
+const int collect_base_address[4]={5,6,7,8};//1,2,3,4,5,6,7,8
 //************ID Number*****************
 
 /////////////////////////////////////////
@@ -161,7 +166,7 @@
     if(SenderIDc >= 'a' && SenderIDc <= 'z'){
         send_Address = base_Address[SenderIDc - 'a'];
 
-        agz.createReceiveStatusCommand(MyID,SenderIDc, (int)agz.gpsAuto(),
+        agz.createReceiveStatusCommand(MyID,SenderIDc, (int)agz.gpsAuto(collect_base_address),
                                         agz.get_agzPoint_lati(),agz.get_agzPoint_longi(),
                                         agz.get_agzPointKalman_lati(),agz.get_agzPointKalman_longi(),
                                         agz.get_agzCov_lati(),agz.get_agzCov_longi());    
@@ -334,11 +339,14 @@
 void auto_Move(){
  
  bool result=false; // 毎回の内外判定の結果を格納
- static bool out_flag = false; // 外側処理の実行フラグ
+ bool out_flag = false; // 外側処理の実行フラグ
  const int sequenceTime[4] = {30000, 31000, 34000, 34200};
  const int outSequenceTime[4] = {10000, 11000, 14000, 14200};
  
- result = agz.gpsAuto();
+ 
+ //内外判定を行うtrueの時は外 falseの時は内側にいる
+ result = agz.gpsAuto(collect_base_address);
+ 
  //agz.set_agzAutoGPS();
  //agz.set_agzKalmanGPS();