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:
- 32:767044a3e421
- Parent:
- 30:c32fc6174efe
- Child:
- 33:ac39982fd3b2
diff -r abfaef28d16d -r 767044a3e421 main.cpp --- a/main.cpp Mon May 20 17:31:16 2013 +0000 +++ b/main.cpp Mon May 20 17:40:08 2013 +0000 @@ -106,9 +106,6 @@ /*! @} */ -// @todo PC USB communications DAs wird danach gelöscht -Serial pc(USBTX, USBRX); - /** * @brief Main function. Start the Programm here. */ @@ -116,11 +113,12 @@ { /** - * Check at first the Battery voltage. Starts when the voltages greater as the min is. + * Check at first the Battery voltage. Starts when the voltage is greater than the min is. * start the timer for the Logging to the file * and start the Task for logging **/ state.start(); + while(s.voltageBattery < BAT_MIN) { for (float f = 0.1f; f < 6.3f; f += 0.1f) { for(int i = 0; i <= 3; i ++) { @@ -155,19 +153,15 @@ wait(0.1); robotControl.setEnable(false); - // Verbindung zum putty kann spöter gelöscht werden...... - pc.baud(460800); - pc.printf("********************* MicroBridge 4568 ********************************\n\r"); - /** * Initialise the ADB subsystem. + * Set Theta for to go to Startloop. */ init(); setDesiredTheta(400.0f); - pc.printf("connection isOpen\n"); while(getDesiredTheta() < (4 * PI)) { - ADB::poll(); + ADB::poll(); if (getDesiredTheta() > (2 * PI)) { /** * Runs at first till the Startbutton has pressed @@ -183,9 +177,7 @@ state.savePlotFile(s); wait(PERIOD_ANDROID/2); state.savePlotFile(s); - //void writeActualPosition(float x, float y, float t, int state_u, int state_l, int state_r, float volt_b) } - writeActualPosition(robotControl.getxActualPosition(), robotControl.getyActualPosition(), robotControl.getActualTheta(), @@ -193,8 +185,6 @@ s.state&STATE_LEFT, s.state&STATE_RIGHT, s.voltageBattery); - //connection->write(sizeof(str),(unsigned char*)&str); - wait(PERIOD_ANDROID/2); } @@ -210,9 +200,6 @@ state.savePlotFile(s); leftMotor.setVelocity(0.0f); rightMotor.setVelocity(0.0f); - // while(!(s.millis >= 15000)) { - // state.savePlotFile(s); - // }; /** * Close the File PLOTS.txt to read the file with the computer afterwards and draw a diagramm @@ -242,5 +229,5 @@ } wait(0.05); } - + }