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
Fork of autonomous Robot Android by
Diff: main.cpp
- Revision:
- 24:08241be546ba
- Parent:
- 22:bfec16575c91
- Child:
- 26:a201dcd4e618
diff -r bfec16575c91 -r 08241be546ba main.cpp --- a/main.cpp Sun May 19 07:35:16 2013 +0000 +++ b/main.cpp Sun May 19 14:54:49 2013 +0000 @@ -40,6 +40,17 @@ #include "androidADB.h" /** + * @name LED + * @{ + */ + +/** +* @brief The Array of the four LED on the mbed board. +*/ +PwmOut led[4] = { LED1, LED2, LED3, LED4 }; +/*! @} */ + +/** * @name Hallsensor * @{ */ @@ -127,7 +138,25 @@ state.start(); state.initPlotFile(); state.closePlotFile(); - while(s.voltageBattery < BAT_MIN) {} + while(s.voltageBattery < BAT_MIN) { + for (float f = 0.1f; f < 6.3f; f += 0.1f) { + for(int i = 0; i <= 3; i ++) { + led[i] = state.dim( i, f ); + } + wait_ms(20); + } + wait(0.05); + for (float f = 0.1f; f < 6.3f; f += 0.1f) { + for(int i = 0; i <= 3; i ++) { + led[i] = state.dim( 3-i, f ); + } + wait_ms(20); + } + wait(0.05); + } + for(int i = 0; i <= 3; i ++) { + led[i] = state.dim( 0, 0.0f ); + } state.stop(); wait(0.5); state.start(); @@ -241,5 +270,26 @@ state.closePlotFile(); state.stop(); robotControl.setEnable(false); + robotControl.stop(); + + /** + * Fast PWM sample for the end + */ + while(1) { + for (float f = 0.1f; f < 6.3f; f += 0.1f) { + for(int i = 0; i <= 3; i ++) { + led[i] = state.dim( i, f ); + } + wait_ms(5); + } + wait(0.1); + for (float f = 0.1f; f < 6.3f; f += 0.1f) { + for(int i = 0; i <= 3; i ++) { + led[i] = state.dim( 3-i, f ); + } + wait_ms(5); + } + wait(0.05); + } }