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:
0:31f7be68e52d
Child:
1:6cd533a712c6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/StateDefines/defines.h	Thu Feb 07 17:43:19 2013 +0000
@@ -0,0 +1,122 @@
+#ifndef _DEFINES_H_
+#define _DEFINES_H_
+
+#include "mbed.h"
+
+//Physical dimensions.
+#define PI         3.141592654f
+
+// Motor  #339282 EC 45 flat 30W and GEAR
+#define POLE_PAIRS            8u            // 8
+#define GEAR                  1.0f          // Gear on the motor
+#define PULSES_PER_STEP       6u            // 6 step for Hallsensor
+
+// Physical Dimension of the car
+#define WHEEL_RADIUS          0.042f        // radius of the wheel, given in [m]
+#define WHEEL_DISTANCE        0.176f        // Distance of the wheel, given in [m] 
+
+// State Bits of the car
+#define STATE_STOP            1u            // Bit0 = stop pressed 
+#define STATE_UNDER           2u            // Bit1 = Undervoltage battery   
+#define STATE_LEFT            4u            // Bit2 = left ESCON in error state
+#define STATE_RIGHT           8u            // Bit3 = right ESCON in error state     
+
+// ESCON Dimenstion
+#define ESCON_SET_FACTOR      100.0f        // Speed Factor how set in the ESCON
+#define ESCON_GET_FACTOR      100.0f        // Speed Factor how get in the ESCON       
+
+// Start Defintition
+#define START_X_OFFSET        -0.8f          // Sets the start X-point [m]
+#define START_Y_OFFSET        0.8f          // Sets the start Y-point [m]
+
+// Maximum Aceeleration
+#define ACCELERATION          0.25f         // maximum translational acceleration, given in [m/s2]
+#define THETA_ACCELERATION    1.0f          // maximum rotational acceleration, given in [rad/s2
+
+// LiPo Batterie
+#define BAT_MULTIPLICATOR     21.633333333f // R2 / (R1 + R2) = 0.153    R2= 10k , R1 = 1.8k  
+// 1/0.153 = 6.555  ---> 3.3/1 * 6.555 = 21.6333333f
+#define BAT_MIN               17.5f         // minium operate voltage [V] Battery Type: 1SP1P LG-18650 -->
+// nominal voltage 3.6V   --> 5 batterys ==> 5 * 3.5V = 17.5V
+// Frequenz for the Task
+#define PERIOD_COMPASS        0.050f        // 20Hz Rate for Compass HMC6352
+#define PERIOD_ROBOTCONTROL   0.001f        // 1kHz Rate for Robot Control
+#define PERIOD_STATE          0.001f        // 1kHz Rate for State Objekt 
+#define PERIOD_ANDROID        0.1f          // 10Hz Rate for State Objekt 
+
+
+// Compass Maxima und Minima for the Filter
+#define SET_MAXIMAS_MINIMAS   true          // For Set the maximas und minimas when false the object search the maximas minimas by your own
+/*#define COMP_X_MAX            344.464996f   // Maximum X-Range
+#define COMP_Y_MAX            238.751282f   // Maximum Y-Range
+#define COMP_Z_MAX            -266.899994f  // Maximum Z-Range not used in this side
+#define COMP_X_MIN            -90.412109f   // Minimum X-Range
+#define COMP_Y_MIN            -220.834808f  // Minimum Y-Range
+#define COMP_Z_MIN            -356.000000f  // Minimun Z-Range not used in this side
+*/
+#define COMP_X_MAX            391.219910f   // Maximum X-Range
+#define COMP_Y_MAX            382.915161f   // Maximum Y-Range      
+#define COMP_Z_MAX            -237.855042f  // Maximum Z-Range not used in this side      
+#define COMP_X_MIN            -169.952530f  // Minimum X-Range      
+#define COMP_Y_MIN            -247.647675f  // Minimum Y-Range      
+#define COMP_Z_MIN            -385.915009f  // Minimun Z-Range not used in this side  
+
+
+/**
+* struct state
+   * structure containing system sensor data
+   ****** System Status
+   ****** Data reported Motor
+   ****** Data reported Car
+   ****** Set Point Car
+   ****** measuring Position and angle
+   **/
+typedef struct state {
+    /** millis Time [ms]*/
+    int millis;
+    /** Battery voltage [V] */
+    float voltageBattery;
+    /** Number of pulses left */
+    int leftPulses;
+    /** Number of pulses right */
+    int rightPulses;
+    /** Velocity left [m/s] */
+    float leftVelocity;
+    /** Velocity right [m/s] */
+    float rightVelocity;
+    /** Velocity of the car [m/s] */
+    float velocity;
+    /** Velocity rotation [°/s] */
+    float omega;
+    /** X-Axis from co-ordinate [m] */
+    float xAxis;
+    /** Y-Axis from co-ordinate [m] */
+    float yAxis;
+    /** X-Axis Error [m] */
+    float xAxisError;
+    /** X-Axis Error [m] */
+    float yAxisError;
+    /** Angle Error [°] */
+    float angleError;
+    /** Angle from Car [°] */
+    float angle;
+    /** Setpoint X-Axis [m] */
+    float setxAxis;
+    /** Setpoint Y-Axis [m] */
+    float setyAxis;
+    /** Setpoint Angel [°] */
+    float setAngle;
+    /** Right Distance Sensor [m] */
+    float rightDist;
+    /** Compass Angle [°] */
+    float compassAngle;
+    /** Compass X-Axis */
+    float compassxAxis;
+    /** Compass Y-Axis */
+    float compassyAxis;
+    /** State of the Car **/
+    int state;
+} state_t;
+
+
+#endif
\ No newline at end of file