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

Revision:
35:0e9ba5f20512
Parent:
26:a201dcd4e618
--- a/main.cpp	Mon May 20 09:41:47 2013 +0000
+++ b/main.cpp	Sat May 25 08:39:44 2013 +0000
@@ -125,9 +125,10 @@
 int main()
 {
 
-    int garagenumber = 2;
+    int garagenumber = 5;
     float x = -2.954f + 0.308 * garagenumber;
     float ypre = 1.30f;
+    float xpre = 0;
     float ygoal = 0.60f;
 
     /**
@@ -178,7 +179,7 @@
     robotControl.setAllToZero(START_X_OFFSET, START_Y_OFFSET, PI/2 );
     robotControl.start();
     robotControl.setDesiredPositionAndAngle(START_X_OFFSET, START_Y_OFFSET, PI/2);
-    
+
     wait(0.02);
     state.savePlotFile(s);
 
@@ -190,18 +191,18 @@
         state.savePlotFile(s);
     };
 
-    robotControl.setDesiredPositionAndAngle(-0.75f, 2.85f,  3*PI/8);
+    robotControl.setDesiredPositionAndAngle(-0.60f, 2.85f,  3*PI/8);
     while(!(robotControl.getDistanceError() <= 0.7)) {
         state.savePlotFile(s);
     };
 
-    robotControl.setDesiredPositionAndAngle(-1.0f, 3.75f,  3*PI/4);
-    while(!(robotControl.getDistanceError() <= 0.55)) {
+    robotControl.setDesiredPositionAndAngle(-1.0f, 3.6f,  3*PI/4);
+    while(!(robotControl.getDistanceError() <= 0.50)) {
         state.savePlotFile(s);
     };
 //QR
-    robotControl.setDesiredPositionAndAngle(-1.5f, 3.6f,  PI);
-    while(!(robotControl.getDistanceError() <= 0.075)) {
+    robotControl.setDesiredPositionAndAngle(-1.5f, 3.5f,  PI);
+    while(!(robotControl.getDistanceError() <= 0.045)) {
         state.savePlotFile(s);
     };
 
@@ -210,7 +211,29 @@
         state.savePlotFile(s);
     };
 
-    robotControl.setDesiredPositionAndAngle(x, ypre,  -PI/2);
+    if(garagenumber == 1) {
+        xpre=-2.575f;
+        xpre -= 0.03f; /// künstliche korrektur
+        x -= 0.03f;    /// künstliche korrektur
+    } else if(garagenumber == 2) {
+        xpre=-2.338f;
+        xpre -= 0.02f;  /// künstliche korrektur
+        x -= 0.02f;     /// künstliche korrektur
+    } else if(garagenumber == 3) {
+        xpre=-2.095f;
+        xpre -= 0.01;    /// künstliche korrektur
+        x -= 0.01;       /// künstliche korrektur
+    } else if(garagenumber == 4) {
+        xpre=-1.845f;
+        xpre -= 0.01;    /// künstliche korrektur
+        x -= 0.01;       /// künstliche korrektur
+    } else if(garagenumber == 5) {
+        xpre=-1.510f;
+        xpre -= 0.005;   /// künstliche korrektur
+        x -= 0.005;      /// künstliche korrektur
+    }
+
+    robotControl.setDesiredPositionAndAngle(xpre, ypre,  -PI/2);
     while(!(robotControl.getDistanceError() <= 0.4)) {
         state.savePlotFile(s);
     };