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:
- 23:4d8173c5183b
- Parent:
- 22:bfec16575c91
diff -r bfec16575c91 -r 4d8173c5183b main.cpp --- a/main.cpp Sun May 19 07:35:16 2013 +0000 +++ b/main.cpp Sun May 19 14:39:20 2013 +0000 @@ -108,6 +108,9 @@ // @todo PC USB communications DAs wird danach gelöscht Serial pc(USBTX, USBRX); +PwmOut led[4] = { LED1, LED2, LED3, LED4 }; + + /** * @brief Main function. Start the Programm here. */ @@ -123,12 +126,31 @@ * Check at first the Battery voltage. Starts when the voltages greater as the min is. * start the timer for the Logging to the file * and start the Task for logging + * Slow PWM sample for the end **/ 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); + } state.stop(); + for(int i = 0; i <= 3; i ++) { + led[i] = state.dim( 0, 0.0f ); + } wait(0.5); state.start(); state.initPlotFile(); @@ -195,9 +217,6 @@ } - - - /* pc.baud(460800); pc.printf("********************* MicroBridge 4568 ********************************\n\r"); @@ -241,5 +260,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); + } }