CanSat-C 2021 / Mbed 2 deprecated cansatC_test2_xbee2

Dependencies:   ATP3012 mbed a HMC US015_2 getGPS

Revision:
18:bd0b2394fa48
Parent:
14:3e7d563538e5
Child:
21:52f8f01a29c5
--- a/main.cpp	Mon Dec 13 10:07:34 2021 +0000
+++ b/main.cpp	Wed Dec 15 06:17:48 2021 +0000
@@ -8,16 +8,18 @@
 DigitalIn flight_pin(A0);
 DigitalOut nichrome(D13);
 // 
-#define cp_max 2    //CPの数を入力する
+#define cp_max 5    //CPの数を入力する
 
 int main() {
     // 変数宣言
     double GPS_x, GPS_y;  // 現在地の座標
     double direction;     // 次CPへの向き
-    double CPs_x[2]={34.545588426585454, 34.5454484832847};  //CPリスト(x座標)
-    double CPs_y[2]={135.50282053551706, 135.50262437335775};    // CPリスト(y座標)
+    double CPs_x[5]={34.54556786858123, 34.545733563643864, 34.54594565284262, 34.54614448597558, 34.54632012151458};  //CPリスト(x座標)
+    double CPs_y[5]={135.51009581235357, 135.51000193504115, 135.5098705068037, 135.50974444298416, 135.50962106137328};    // CPリスト(y座標)
     double next_CP_x, next_CP_y;
-    
+    //B6棟裏セット 34.545588426585454, 34.5454484832847 | 135.50282053551706, 135.50262437335775
+    //グラウンド道路近くの直線 34.54556786858123, 34.545733563643864, 34.54594565284262, 34.54614448597558, 34.54632012151458
+    //                     135.51009581235357, 135.51000193504115, 135.5098705068037, 135.50974444298416, 135.50962106137328
     
     //落下開始
     while(flight_pin){}
@@ -47,7 +49,7 @@
             while(FrontGet()) {
                 xbee.printf("frontget\r\n");
                 Move('1', 0);      //停止
-                Move('4', 0.2);    //時計回り回転
+                Move('4', 0.18);    //時計回り回転
                 wait(0.5);
                 Move('1', 0);      //回転停止
                 xbee.printf("front_avoid_rotate\r\n");
@@ -55,7 +57,7 @@
                 //障害物よけて走ってから目的地に回頭、走らないと障害物に向くかも
                 Move('2', 0.1);
                 wait(1);
-                Move('2', 0.5);
+                Move('2', 0.39);
                 wait(2);
                 Move('1', 0);       //走りながらanglegetできたら、止まらない
                 //ちょっと走るのおわり
@@ -68,12 +70,12 @@
                     if(direction < 20 || direction > 340) {
                         xbee.printf("rotation finish\r\n");
                         Move('1', 0);   //停止
-                        Move('2', 0.5);
+                        Move('2', 0.39);
                         xbee.printf("now_angle=%f\r\n", direction);
                         break;
                         }
                     else {
-                        Move('4', 0.15);//時計回りに回転
+                        Move('4', 0.18);//時計回りに回転
                         xbee.printf("now_angle=%lf\r\n", direction);
                         direction = AngleGet();
                         }