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:
1:6cd533a712c6
Parent:
0:31f7be68e52d
Child:
2:d8e1613dc38b
diff -r 31f7be68e52d -r 6cd533a712c6 RobotControl/RobotControl.h
--- a/RobotControl/RobotControl.h	Thu Feb 07 17:43:19 2013 +0000
+++ b/RobotControl/RobotControl.h	Sat Mar 02 09:39:34 2013 +0000
@@ -15,7 +15,7 @@
  *
  * @section LICENSE
  *
- * Copyright (c) 2013 HSLU Pren Team #1 Cruising Crêpe
+ * Copyright © 2013 HSLU Pren Team #1 Cruising Crêpe
  * All rights reserved.
  *
  * @section DESCRIPTION
@@ -36,7 +36,7 @@
 
     MaxonESCON*         motorControllerLeft;
     MaxonESCON*         motorControllerRight;
-    HMC6352*            compass;
+//   HMC6352*            compass;
     AnalogIn*           battery;
     MotionState         Desired;
     MotionState         Actual;
@@ -45,10 +45,14 @@
     float               period;
     float               speed;
     float               omega;
-    
+
     float               rho; /* Distance to goal [m]*/
     float               gamma; /* Angle of the start position to goal position [rad]*/
-    
+    float               delta; /* Angle of the goal postition [rad]*/
+
+    float               deltaXPostition; /* differenz of the actual X-value and the desired [m] */
+    float               deltaYPostition; /* differenz of the actual X-value and the desired [m] */
+
 
 
 public:
@@ -61,7 +65,7 @@
      * @param compass Modul HMC5883L
      * @param period the sampling period of the run loop of this controller, given in [s].
      */
-    RobotControl(MaxonESCON* motorControllerLeft, MaxonESCON* motorControllerRight, HMC6352* compass, float period);
+    RobotControl(MaxonESCON* motorControllerLeft, MaxonESCON* motorControllerRight, /*HMC6352* compass,*/ float period);
 
     /**
     * Destructor of the Object to destroy the Object.
@@ -83,17 +87,15 @@
 
     /**
     * Sets the maximum acceleration value.
-    * @param acceleration the maximum acceleration value to use for the calculation
-    * of the motion trajectory, given in [m/s²].
+    * @param acceleration the maximum acceleration value to use for the calculation of the motion trajectory, given in [m/s<SUP>2</SUP>].
     */
-    void        setAcceleration(float acc);
+    void        setAcceleration(float acceleration);
 
     /**
     * Sets the maximum acceleration value of rotation.
-    * @param acceleration the maximum acceleration value to use for the calculation
-    * of the motion trajectory, given in [rad/s&sup2;].
+    * @param acceleration the maximum acceleration value to use for the calculation of the motion trajectory, given in [rad/s<SUP>2</SUP>].
     */
-    void        setThetaAcceleration(float acc);
+    void        setThetaAcceleration(float acceleration);
 
     /**
     * Sets the desired translational speed of the robot.
@@ -103,27 +105,33 @@
 
     /**
     * Sets the desired rotational speed of the robot.
-    * @param speed the desired speed, given in [rad/s].
+    * @param omega the desired rotational speed, given in [rad/s].
     */
     void        setDesiredOmega(float omega);
 
     /**
     * Sets the desired X- position of the robot.
-    * @param xpostion the desired position, given in [m].
+    * @param xposition the desired position, given in [m].
     */
-    void        setxPosition(float position);
+    void        setxPosition(float xposition);
 
     /**
     * Sets the desired Y-position of the robot.
-    * @param ypostion the desired position, given in [m].
+    * @param yposition the desired position, given in [m].
     */
-    void        setyPosition(float position);
+    void        setyPosition(float yposition);
 
     /**
     * Sets the angle of the robot.
     * @param theta the desired angle, given in [rad].
     */
     void        setTheta(float theta);
+    
+    /**
+     * Gets the desired Theta. Angle of the goal Point.
+     * @return the desired Theta, given in [rad].
+     */
+    float       getTheta();
 
     /**
      * Gets the desired translational speed of the robot.
@@ -183,14 +191,35 @@
     * Gets the orientation following error of the robot.
     * @return the orientation following error, given in [rad].
     */
+    
     float       getThetaError();
+    
+    /**
+    * Gets the Distance to Disired point. Calculate witch pythagoras
+    * @return distance to goal, given in [m].
+    */
+    float       getDistanceError();
+    
+    /**
+    * Gets the Angle ot the pointing vector to the goal right the unicycle axis from actual point
+    * @return theta to goal, given in [rad].
+    */
+    float       getThetaErrorToGoal();
+    
+    /**
+    * Gets the Angle ot the pointing vector to the goal right the unicycle main axis
+    * @return theta from the goal, given in [rad].
+    */
+    float       getThetaGoal();
+
 
     /**
     * Set all state to zero
-    * @param Sets the start X-position [m].
-    * @param Sets the start y-position [m].
+    * @param xZeroPos Sets the start X-position [m].
+    * @param yZeroPos Sets the start y-position [m].
+    * @param theta Sets the start angle [rad].
     */
-    void        setAllToZero(float xZeroPos, float xZeroPos);
+    void        setAllToZero(float xZeroPos, float yZeroPos, float theta);
 
     void        run();
 };