This program is for an autonomous robot for the competition at the Hochschule Luzern. http://cruisingcrepe.wordpress.com/ We are one of the 32 teams. http://cruisingcrepe.wordpress.com/ The postition control is based on this Documentation: Control of Wheeled Mobile Robots: An Experimental Overview from Alessandro De Luca, Giuseppe Oriolo, Marilena Vendittelli. For more information see here: http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf

Dependencies:   mbed

Fork of autonomous Robot Android by Christian Burri

Files at this revision

API Documentation at this revision

Comitter:
chrigelburri
Date:
Tue Mar 26 08:29:43 2013 +0000
Parent:
6:48eeb41188dd
Child:
8:696c2f9dfc62
Commit message:
Grob einstellung vollzogen, korrektur vom linken und rechten rausche noch nicht gemacht

Changed in this revision

StateDefines/defines.h 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/StateDefines/defines.h	Sat Mar 23 13:52:48 2013 +0000
+++ b/StateDefines/defines.h	Tue Mar 26 08:29:43 2013 +0000
@@ -12,9 +12,11 @@
 #define PULSES_PER_STEP       6u            // Pulses per electrical step Hallsensor, have 6 steps
 
 // Physical Dimension of the car
-#define WHEEL_RADIUS_LEFT     0.043f        // radius of the left wheel, given in [m]
-#define WHEEL_RADIUS_RIGHT     0.043f        // radius of the left wheel, given in [m]
-#define WHEEL_DISTANCE        0.1865f       // Distance of the wheel, given in [m] 
+#define WHEEL_RADIUS_DIFF     0.00054        // positiv zu weit links, given in [m] 0.00059
+#define WHEEL_RADIUS_LEFT     0.03930f        // radius of the left wheel, given in [m] 0.03945f
+#define WHEEL_RADIUS_RIGHT    (WHEEL_RADIUS_LEFT + WHEEL_RADIUS_DIFF)        // radius of the left wheel, given in [m]
+#define WHEEL_DISTANCE        0.1860f       // Distance of the wheel, given in [m] 0.1865f
+
 
 // State Bits of the car
 #define STATE_STOP            1u            // Bit0 = stop pressed 
@@ -38,7 +40,7 @@
 #define GAIN                  0.30f         // Main Gain
 #define K1                    1.0f * GAIN
 #define K2                    3.0f * GAIN
-#define K3                    5.0f * GAIN   // deafult 2.0f
+#define K3                    2.0f * GAIN   // deafult 2.0f
 #define MIN_DISTANCE_ERROR    -0.02f         // min. Distance to switch the position controller off. Because when Distance Error goes to zero the ATAN2 is not define, given in [m]                 
 
 // LiPo Batterie
--- a/main.cpp	Sat Mar 23 13:52:48 2013 +0000
+++ b/main.cpp	Tue Mar 26 08:29:43 2013 +0000
@@ -108,10 +108,10 @@
 
    // robotControl.setDesiredPositionAndAngle(START_X_OFFSET, START_Y_OFFSET, PI/2);
   //  robotControl.setDesiredPositionAndAngle(0, 0, PI/2);
-    wait(0.1);
+   // wait(0.1);
     
     //////////////////////////////////////////
-    
+    /*
             robotControl.setDesiredPositionAndAngle(0.0f, 1.0f,  PI);
         while(!(robotControl.getDistanceError() <= 0.1)) {
             state.savePlotFile(s);
@@ -126,13 +126,31 @@
         while(!(robotControl.getDistanceError() <= 0.1)) {
             state.savePlotFile(s);
         };
+        
+                robotControl.setDesiredPositionAndAngle(0.0f, -0.8f,  PI/2);
+        while(!(robotControl.getDistanceError() <= 0.05)) {
+            state.savePlotFile(s);
+        };
+        
+                        robotControl.setDesiredPositionAndAngle(0.0f, -0.2f,  PI/2);
+        while(!(robotControl.getDistanceError() <= 0.05)) {
+            state.savePlotFile(s);
+        };
 
         robotControl.setDesiredPositionAndAngle(0.0, 0.0f,  PI/2);
-        while(!(s.millis >= 55000)) {
+        while(!(s.millis >= 65000)) {
             state.savePlotFile(s);
         };
+  */  
     
+    ///////////////////////stay
     
+            robotControl.setDesiredPositionAndAngle(0.0, 0.0f,  PI/2);
+        while(!(s.millis >= 65000)) {
+            state.savePlotFile(s);
+        };
+        
+   //////////////////////////stay
     
     
     
@@ -147,28 +165,37 @@
     
     
 
-    //Zum Umfang einstellen
-    /*
-    robotControl.setDesiredPositionAndAngle(0.0f, 1.0f,  PI/2);
-    while(!(s.millis >= 20000)) {
+    //Zum Umfang einstellen 2m fahren
+    
+    robotControl.setDesiredPositionAndAngle(0.0f, 2.0f,  PI/2);
+    while(!(s.millis >= 30000)) {
         state.savePlotFile(s);
     };
     
 
-*/
+
 
     ///////////////oder//////////////////
 
 
     // Zum radabstand einstellen
-      
+    
     /*
-    int sek = 1000;
-    int step = 1000;
+        robotControl.setDesiredPositionAndAngle(-0.94f, 0.68f,  PI);
+    while(!(s.millis >= 30000)) {
+        state.savePlotFile(s);
+    }
+   /* 
+      
+  /*  
+    int sek = 0;
+    int step = 5000;
     int i = 0;
-    int totalTurns = 5;
+    int totalTurns = 2;
 
-    while(i >= totalTurns) {
+   sek += step;
+
+    while(i <= totalTurns) {
         robotControl.setDesiredPositionAndAngle(0.0f, 0.0f,  PI);
         while(!(s.millis >= sek)) {
             state.savePlotFile(s);
@@ -195,6 +222,8 @@
 
         i++;
     }
+    
+    
 */