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: MicroBridge/androidADB.cpp
- Revision:
- 20:01b233b0e606
- Parent:
- 19:b2f76b0fe4c8
- Child:
- 21:48248c5b8992
--- a/MicroBridge/androidADB.cpp Fri May 03 13:34:34 2013 +0000 +++ b/MicroBridge/androidADB.cpp Fri May 03 14:39:24 2013 +0000 @@ -17,17 +17,17 @@ float getDesiredX() { - return androidx; + return androidx/1000; } float getDesiredY() { - return androidy; + return androidy/1000; } float getDesiredTheta() { - return androidt; + return androidt * PI / 180; } void Tokenize(const string& str, vector<string>& tokens, @@ -128,18 +128,25 @@ connection->write(sizeof(str),(unsigned char*)&str); } -void writeActualPosition(float x, float y, float t) +void writeActualPosition(float x, float y, float t, int state_u, int state_l, int state_r, float volt_b) { - + // reconnect funktioniert trotzdem nicht!? while(!(androidConnected)) { connect(); wait(0.5); } - char str[32]; - sprintf( str, "%f;%f;%f;", x, y, t); + char str[100]; + + //send to android + sprintf( str, "%f;%f;%f;%i;%i;%i;%f;;", x, + y, + t * 180 / PI, + state_u == 0 ? 0 : 1, + state_l == 0 ? 0 : 1, + state_r == 0 ? 0 : 1, + volt_b); - //pc.printf("Sending: %s\n\r",str); connection->write(sizeof(str),(unsigned char*)&str); }