auto

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

Files at this revision

API Documentation at this revision

Comitter:
kityann
Date:
Mon Apr 13 10:09:42 2015 +0000
Parent:
1:a5f98c7e1feb
Child:
3:7affc8af6db6
Commit message:
agz

Changed in this revision

AigamozuControlPackets.lib Show annotated file Show diff for this revision Revisions of this file
agzIDLIST.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/AigamozuControlPackets.lib	Sat Apr 11 12:25:34 2015 +0000
+++ b/AigamozuControlPackets.lib	Mon Apr 13 10:09:42 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/aigamozu/code/AigamozuControlPackets/#e77c664ee5e2
+http://mbed.org/teams/aigamozu/code/AigamozuControlPackets/#4d71c9cc3b4a
--- a/agzIDLIST.lib	Sat Apr 11 12:25:34 2015 +0000
+++ b/agzIDLIST.lib	Mon Apr 13 10:09:42 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/aigamozu/code/agzIDLIST/#f80f54b11696
+http://mbed.org/teams/aigamozu/code/agzIDLIST/#f9411e7b89a6
--- a/main.cpp	Sat Apr 11 12:25:34 2015 +0000
+++ b/main.cpp	Mon Apr 13 10:09:42 2015 +0000
@@ -120,7 +120,7 @@
                     //CommandType -> Send Status
                     case STATUS_REQUEST:{
                             //Create GPS Infomation Packet
-                            agz.createReceiveStatusCommand('B','a',myGPS.longitudeH,myGPS.longitudeL,myGPS.latitudeH,myGPS.latitudeL);
+                            agz.createReceiveStatusCommand('D','a',myGPS.longitudeH,myGPS.longitudeL,myGPS.latitudeH,myGPS.latitudeL);
                             //Select Destination
                                 ZBTxRequest tx64request(robot_Address,agz.packetData,agz.getPacketLength());
                             //Send -> Base
@@ -133,12 +133,14 @@
                             
                         printf("Receive Status\n");      
                            
-                        id = buf1[6] - 'A';
+                        id = buf1[5] - 'A';
                         robot[id].set_state(buf1[9]);
                         robot[id].set_LatitudeH(&buf1[13]);
                         robot[id].set_LatitudeL(&buf1[17]);
                         robot[id].set_LongitudeH(&buf1[21]);
                         robot[id].set_LongitudeL(&buf1[25]); 
+                        
+                        agz.reNewBasePoint(id,robot[id].get_LatitudeH(),robot[id].get_LatitudeL(),robot[id].get_LongitudeH(),robot[id].get_LongitudeL());
                             
                         printf("%d\n", id);                    
                         printf("%ld, %ld, %ld, %ld\n", robot[id].get_LatitudeH(), robot[id].get_LatitudeL(), robot[id].get_LongitudeH(), robot[id].get_LongitudeL());
@@ -167,8 +169,8 @@
             refresh_Timer.reset();
             if (myGPS.fix) {
                 agz.nowStatus = GPS_AVAIL;
-                agz.reNewPoint(myGPS.longitudeH,myGPS.longitudeL,myGPS.latitudeH,myGPS.latitudeL);
-            
+                agz.reNewRobotPoint(myGPS.longitudeH,myGPS.longitudeL,myGPS.latitudeH,myGPS.latitudeL);
+                printf("state = %d\n",agz.nowMode);
                 printf("my %ld, %ld, %ld, %ld\n", myGPS.longitudeH,myGPS.longitudeL,myGPS.latitudeH,myGPS.latitudeL);
             }
             else agz.nowStatus = GPS_UNAVAIL;
@@ -179,7 +181,7 @@
         if( collect_Timer.read_ms() >= collect_Time){
             collect_Timer.reset();
             
-            printf("Send Request\n");
+            printf("Send Request:%d,%d\n",collect_flag,collect_state);
                       
             agz.createRequestCommand('A', collect_state);
             //Select Destination