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

Revision:
11:775ebb69d5e1
Parent:
6:48eeb41188dd
diff -r 09ddb819fdcb -r 775ebb69d5e1 StateDefines/State.h
--- a/StateDefines/State.h	Thu Apr 04 06:43:43 2013 +0000
+++ b/StateDefines/State.h	Fri Apr 05 10:58:42 2013 +0000
@@ -1,24 +1,18 @@
 #ifndef _STATE_H_
 #define _STATE_H_
 
-#include <cmath>
-#include "mbed.h"
 #include "MaxonESCON.h"
 #include "RobotControl.h"
 #include "Task.h"
-#include "HMC5883L.h"
-#include "HMC6352.h"
 #include "defines.h"
 
 /**
  * @author Christian Burri
  *
- * @section LICENSE
- *
- * Copyright &copy; 2013 HSLU Pren Team #1 Cruising Crêpe
+ * @copyright Copyright &copy; 2013 HSLU Pren Team #1 Cruising Crêpe
  * All rights reserved.
  *
- * @section DESCRIPTION
+ * @brief
  *
  * State is the main mechanism for communicating current realtime system state to
  * the rest of the system for logging etc.
@@ -30,76 +24,68 @@
 
 private:
 
-    state_t* s;
+    state_t*            s;
     RobotControl*       robotControl;
     MaxonESCON*         motorControllerLeft;
     MaxonESCON*         motorControllerRight;
-    //  HMC6352*            compass;
-    AnalogIn*           battery;
+    AnalogIn            battery;
     Timer               timer;
     float               period;
-    //float               magout[3];
 
 public:
 
     /**
-     * Creates a robot control object and initializes all private state variables.
+     * @brief Creates a robot control object and initializes all private state variables.
      * @param s struct to read and write the state
      * @param robotControl Object to read the state
      * @param motorControllerLeft a reference to the servo drive for the left motor
      * @param motorControllerRight a reference to the servo drive for the right motor
-     * @param compass Modul HMC5883L
-     * @param battery Analog Input Battery Voltage input
+     * @param batteryPin mbed pin for analog Input Battery Voltage
      * @param period the sampling period of the run loop of this controller, given in [s]
      */
     State(state_t* s,
           RobotControl* robotControl,
           MaxonESCON* motorControllerLeft,
           MaxonESCON* motorControllerRight,
-          /*HMC6352* compass,*/
-          AnalogIn* battery,
+          PinName batteryPin,
           float period);
 
     /**
-     * Destructor of the Object to destroy the Object.
+     * @brief Destructor of the Object to destroy the Object.
      **/
     virtual     ~State();
 
     /**
-     * Initzialize the File. Open the File plots.txt and set the title at first line.
+     * @brief Initzialize the File. Open the File plots.txt and set the title at first line.
      */
     void initPlotFile(void);
 
     /**
-     * Save the char to the file.
-     * For example at the end.
-     * Don't forget the \n at first.
-     */
-    void savePlotText(char text[]);
-
-    /**
-     * Close the File.
+     * @brief Close the File.
      */
     void closePlotFile(void);
 
     /**
-     * Return the Battery voltage
+     * @brief Return the Battery voltage
      * state variables.
      * @return Batterie Voltage [V]
      */
     float readBattery();
 
     /**
-     * Starts the timer from zero.
+     * @brief Starts the timer from zero.
      * The timer is for the logging Time.
      */
     void startTimerFromZero();
 
     /**
-     * Save the new state to a new line.
+     * @brief Save the new state to a new line.
      */
     void savePlotFile(state_t s);
 
+    /**
+    * @brief Run method actualize every period.
+    */
     void        run();
 
 private: