This program is for an autonomous robot for the competition at the Hochschule Luzern. We are one of the 32 teams. <a href="http://cruisingcrepe.wordpress.com/">http://cruisingcrepe.wordpress.com/</a> 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: <a href="http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf">http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf</a>

Dependencies:   mbed

Fork of autonomousRobotAndroid by Christian Burri

Files at this revision

API Documentation at this revision

Comitter:
chrigelburri
Date:
Sat May 25 15:42:24 2013 +0000
Parent:
34:62996eed658a
Child:
37:fd68b9e0be08
Commit message:
bremsung funktioniert zwei Sekunden nach dem zielpunkt

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat May 25 05:44:14 2013 +0000
+++ b/main.cpp	Sat May 25 15:42:24 2013 +0000
@@ -144,10 +144,10 @@
     state.initPlotFile();
     state.startTimerFromZero();
     robotControl.start();
-/*
-    /**
-     * Clear all Errors of the ESCON Module, with a disabled to enable event.
-     */
+    /*
+        /**
+         * Clear all Errors of the ESCON Module, with a disabled to enable event.
+         */
     robotControl.setEnable(false);
     wait(0.01);
     robotControl.setEnable(true);
@@ -162,15 +162,15 @@
     setDesiredTheta(400.0f);
 
     while(getDesiredTheta() < (4 * PI)) {
-        ADB::poll();
+
         if (getDesiredTheta() > (2 * PI)) {
             /**
             * Runs at first till the Startbutton has pressed.
             */
+            
             state.startTimerFromZero();
             robotControl.setAllToZero(START_X_OFFSET, START_Y_OFFSET, PI/2 );
             robotControl.setDesiredPositionAndAngle(START_X_OFFSET, START_Y_OFFSET, PI/2);
-            robotControl.setEnable(false);
             wait(PERIOD_ANDROID/2);
         } else {
             robotControl.setEnable(true);
@@ -187,7 +187,8 @@
                             s.state&STATE_RIGHT,
                             s.voltageBattery);
         wait(PERIOD_ANDROID/2);
-
+        
+        ADB::poll();
     }
 
     /**
@@ -202,14 +203,12 @@
     rightMotor.setVelocity(0.0f);
     wait(2);
 
-
     /**
      * Close the File PLOTS.txt to read the file with the computer afterwards and draw a diagramm.
      */
     state.closePlotFile();
     state.stop();
     robotControl.setEnable(false);
-    robotControl.stop();
 
     /**
     * Fast PWM sample for the end.