nekodesu

Files at this revision

API Documentation at this revision

Comitter:
talsl
Date:
Wed Jul 10 09:19:20 2019 +0000
Parent:
2:860eb70d3656
Commit message:
nekodesu.; nekohaimasu.; arigatougozaimasita.

Changed in this revision

states.cpp Show annotated file Show diff for this revision Revisions of this file
states.h Show annotated file Show diff for this revision Revisions of this file
diff -r 860eb70d3656 -r e91ca9213add states.cpp
--- a/states.cpp	Wed Jul 10 08:23:52 2019 +0000
+++ b/states.cpp	Wed Jul 10 09:19:20 2019 +0000
@@ -15,6 +15,7 @@
     anglePID.setBias(0.0);
 
     state = 400;
+    emStop = false;
 } 
 
 
@@ -36,11 +37,11 @@
     }
     stickRad = PI - pad.getRadian(0) + (nowAngle * (PI / 180));
     norm = pad.getNorm(0);
-    if(b[6]) norm = 0.25;
+    if(b[1] && norm) norm = 0.25;
     X = norm * cos(stickRad);
     Y = norm * sin(stickRad);
-    if(b3[9] == 1) state++;
-    if(b3[10] == 1) state--;
+    if(b3[6] == 1) state++;
+    if(b3[0] == 1) state--;
     
     /*
     *move.tellState(方角)でロボの方角
@@ -62,9 +63,10 @@
     if(pad.receiveState() == 0){
         /*omni.stop()は止める*/
         omni.stop();
-        emStop = false;
+        //emStop = false;
     }else{
-        emStop = true;
+        if(b[12]) emStop = true;
+        if(b[11]) emStop = false;
         tellAngle();
         tellPad();
         turnPower = anglePID.compute();
diff -r 860eb70d3656 -r e91ca9213add states.h
--- a/states.h	Wed Jul 10 08:23:52 2019 +0000
+++ b/states.h	Wed Jul 10 09:19:20 2019 +0000
@@ -53,6 +53,6 @@
     float stickNorm;
     float X;
     float Y;
-    int b[11],b2[11],b3[11];
+    int b[13],b2[13],b3[13];
 };
 #endif