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:
- 10:09ddb819fdcb
- Parent:
- 9:d3cdcdef9719
- Child:
- 11:775ebb69d5e1
diff -r d3cdcdef9719 -r 09ddb819fdcb main.cpp --- a/main.cpp Sat Mar 30 16:35:22 2013 +0000 +++ b/main.cpp Thu Apr 04 06:43:43 2013 +0000 @@ -1,7 +1,5 @@ -/** - * \mainpage Index Page +/*! \mainpage Index Page * - * @file main.cpp * @author Christian Burri * * @section LICENSE @@ -41,8 +39,10 @@ //Android //AdkTerm AdkTerm; -// LiPo Batterie -AnalogIn battery(p15); // Battery check +/** + * LiPo Batterie for check an undervoltage. + */ +AnalogIn battery(p15); // compass //HMC5883L compass(p9, p10, PERIOD_COMPASS); // sda, sdl (I2C) @@ -79,11 +79,11 @@ int main() { /** Normal mbed power level for this setup is around 690mW - * assuming 5V used on Vin pin - * If you don't need networking... - * Power down Ethernet interface - saves around 175mW - * Also need to unplug network cable - just a cable sucks power - */ + * assuming 5V used on Vin pin + * If you don't need networking... + * Power down Ethernet interface - saves around 175mW + * Also need to unplug network cable - just a cable sucks power + */ PHY_PowerDown(); // robotControl.start(); @@ -99,7 +99,7 @@ robotControl.setEnable(true); wait(0.1); //robotControl.setAllToZero(0, 0, PI/2 ); - robotControl.setAllToZero(START_X_OFFSET, START_Y_OFFSET, PI/2 ); + robotControl.setAllToZero(START_X_OFFSET, START_Y_OFFSET, PI/2 ); robotControl.start(); @@ -253,30 +253,30 @@ robotControl.setDesiredPositionAndAngle(-1.75f, 0.80f, -PI/2); while(!(s.millis >= 32000)) { state.savePlotFile(s); -} + } - /* - printf("here we go... \n"); - AdkTerm.setupDevice(); - printf("Android Development Kit: start\r\n"); - USBInit(); - while (!(s.millis >= 60000)) { - USBLoop(); + /* + printf("here we go... \n"); + AdkTerm.setupDevice(); + printf("Android Development Kit: start\r\n"); + USBInit(); + while (!(s.millis >= 60000)) { + USBLoop(); - printf("x: %f y: %f theta: %f", AdkTerm.getx(), AdkTerm.getx(), AdkTerm.getx() ) + printf("x: %f y: %f theta: %f", AdkTerm.getx(), AdkTerm.getx(), AdkTerm.getx() ) - if( AdkTerm.getx() == 99) { - break; - } + if( AdkTerm.getx() == 99) { + break; } - */ + } + */ - state.savePlotFile(s); - state.closePlotFile(); - state.stop(); - robotControl.setEnable(false); - } + state.savePlotFile(s); + state.closePlotFile(); + state.stop(); + robotControl.setEnable(false); +}