改良版位置補正プログラム動作未確認

Dependencies:   mbed move4wheel2 EC CruizCore_R1370P

Files at this revision

API Documentation at this revision

Comitter:
la00noix
Date:
Sat Mar 02 08:27:05 2019 +0000
Parent:
6:26724c287387
Child:
8:2ba338b4590e
Commit message:
a

Changed in this revision

can/can.cpp 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
movement/movement.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/can/can.cpp	Sat Mar 02 07:48:18 2019 +0000
+++ b/can/can.cpp	Sat Mar 02 08:27:05 2019 +0000
@@ -34,16 +34,16 @@
 
         if(msg.id == 3) {
             usw_data1 = 0.1 * (short)((msg.data[0]<<8) | msg.data[1]);
-            debug_printf("usw_data1 = %f\n\r",usw_data1);
+            //debug_printf("usw_data1 = %f\n\r",usw_data1);
 
             usw_data2 = 0.1 * (short)((msg.data[2]<<8) | msg.data[3]);
-            debug_printf("usw_data2 = %f\n\r",usw_data2);
+            //debug_printf("usw_data2 = %f\n\r",usw_data2);
 
             usw_data3 = 0.1 * (short)((msg.data[4]<<8) | msg.data[5]);
-            debug_printf("usw_data3 = %f\n\r",usw_data3);
+            //debug_printf("usw_data3 = %f\n\r",usw_data3);
 
             usw_data4 = 0.1 * (short)((msg.data[6]<<8) | msg.data[7]);
-            debug_printf("usw_data4 = %f\n\r",usw_data4);
+            //debug_printf("usw_data4 = %f\n\r",usw_data4);
         }
 
     } else {
--- a/main.cpp	Sat Mar 02 07:48:18 2019 +0000
+++ b/main.cpp	Sat Mar 02 08:27:05 2019 +0000
@@ -112,12 +112,14 @@
                 calc_xy(0,1,1);
                 ashi_led();
                 MaxonControl(0,0,0,0);
+                go_waitmode = 0;
 
                 break;
 //-----manual mode--------------------------------------------------------------------------------------------------------------------//
             case 2:
 
                 ManualOut(250,100,500,200);
+                go_waitmode = 0;
 
                 break;
         }
--- a/movement/movement.cpp	Sat Mar 02 07:48:18 2019 +0000
+++ b/movement/movement.cpp	Sat Mar 02 08:27:05 2019 +0000
@@ -465,7 +465,7 @@
         r=hypot(now_x - tgt_x, now_y - tgt_y);
 
         if(r < R) break;
-
+        if(id1_value[0] != 1)break;
     }
 
     while(1) {
@@ -483,7 +483,7 @@
         }
 
         if(tgt_angle - 0.5 < now_angle && now_angle < tgt_angle + 0.5) break;  //目標角度からの許容誤差内に機体の角度が収まった時、補正終了
-
+        if(id1_value[0] != 1)break;
     }
     MaxonControl(0,0,0,0);
 }
\ No newline at end of file