Algorithmus

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
luethale
Date:
Sat Jun 30 14:13:27 2018 +0000
Parent:
35:5a4e1a87b3da
Commit message:
Nacht_der_Technik; Angepasste Werte:; Move & HalfeMove; Ev. Bechleunigung verbessern (aprupte Stops); Ev. Move & HalfeMove weiter anpassen

Changed in this revision

Motion.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
diff -r 5a4e1a87b3da -r 99f60052c746 Motion.cpp
--- a/Motion.cpp	Sat Jun 30 09:49:06 2018 +0000
+++ b/Motion.cpp	Sat Jun 30 14:13:27 2018 +0000
@@ -79,17 +79,17 @@
                 break;    
             
             //Stop at certain distance in speed run
-            }else if (distanceC < 160.0f && speedRun == true && lastMove == true) {
+          /*  }else if (distanceC < 140.0f && speedRun == true && lastMove == true) { //Ursprünglich: 180.0f 
                 stop();
                 break;   
-            
+            */
             //Correct distance from wall
             }else if ( ((countsL - countsLOld)  >= MOVE_DIST || (countsR - countsROld) <= -MOVE_DIST) && (distanceC <= 130.0f) && (distanceC > 40.0f)) {
                 countsLOld += 1000;
                 countsROld -= 1000; 
                   
             //Stop after certain distance if side wall and front wall missing
-            }else if ( deceleration == true && speedRun == false && ( distanceL > 80.0f || distanceR > 80.0f ) && distanceC > 200.0f ) {
+            }else if ( deceleration == true && speedRun == false && ( distanceL > 80.0f || distanceR > 80.0f ) && distanceC > 180.0f ) { //Urspünglich 200.0f
 
                 controller.counterReset();
                 countsLOld = counterLeft.read();
@@ -156,7 +156,7 @@
             }else if ( ((countsL - countsLOld)  >= 824 || (countsR - countsROld) <= -824) && (distanceC >= 100.0f) && (distanceC < 120.0f) )  {
                 countsLOld += 100;
                 countsROld -= 100; 
-                  
+                       
             //Stop after certain distance if side wall missing
             }else if ( (distanceL > 80.0f || distanceR > 80.0f) && lastMove == false && deceleration == true && distanceC < 190.0f) {
 
@@ -166,7 +166,7 @@
                 countsL = counterLeft.read();
                 countsR = counterRight.read();
                 
-                while ((countsL - countsLOld)  <  250.0f || (countsR - countsROld) > -250.0f) {
+                while ((countsL - countsLOld)  <  280.0f || (countsR - countsROld) > -280.0f) { //Ursprünglich 250.0f
                     countsL = counterLeft.read();
                     countsR = counterRight.read(); 
                     accel(RUN_SPEED); 
diff -r 5a4e1a87b3da -r 99f60052c746 main.cpp
--- a/main.cpp	Sat Jun 30 09:49:06 2018 +0000
+++ b/main.cpp	Sat Jun 30 14:13:27 2018 +0000
@@ -54,7 +54,7 @@
     
     volatile int start = 0;
     
-    const int debuging = 1;
+    const int debuging = 0;
     
     const int MOVE = 1;
     const int LEFT = 2;