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:
- 32:767044a3e421
- Parent:
- 28:b3e195e80439
- Child:
- 33:ac39982fd3b2
--- a/MicroBridge/androidADB.cpp Mon May 20 17:31:16 2013 +0000 +++ b/MicroBridge/androidADB.cpp Mon May 20 17:40:08 2013 +0000 @@ -1,6 +1,5 @@ #include "androidADB.h" - Connection * connection; /** @brief Desired position in meters for x-coordinate, given by android */ @@ -35,7 +34,6 @@ androidt = t; } - void Tokenize(const string& str, vector<string>& tokens, const string& delimiters /*= " "*/) @@ -60,10 +58,8 @@ if (event == ADB_CONNECTION_OPEN) { androidConnected = true; - //pc.printf("Android Connected\n"); } else if (event == ADB_CONNECTION_CLOSE) { androidConnected = false; - printf("Android Disonnected\n"); } if (event == ADB_CONNECTION_RECEIVE) { @@ -74,8 +70,6 @@ void parseMessage(uint16_t length, uint8_t * data) { - //received = "[ADB RECV]"; printf("[ADB RECV]:%d %d\r\n",data[0],data[1]); - char str[32]; // convert buffer (unsigned char) to char @@ -94,30 +88,22 @@ androidx = ::atof(tokens.at(0).c_str()); androidy = ::atof(tokens.at(1).c_str()); androidt = ::atof(tokens.at(2).c_str()); - - printf("Android x(%d): %f\n\r\n",length,androidx); - printf("Android y(%d): %f\n\r\n",length,androidy); - printf("Android t(%d): %f\n\r\n",length,androidt); - } else { - //pc.printf("Android sayys(%d): %s\n\r\n",length,str); - } + } else {} } void connect() { ADB::poll(); - printf("connecting..."); char c = 'c'; connection->write(sizeof(c), (unsigned char*)&c); - //wait(0.5); } void init() { -// Initialise the ADB subsystem. + // Initialise the ADB subsystem. ADB::init(); // Open an ADB stream on tcp port 4568. Auto-reconnect @@ -130,6 +116,7 @@ } } + //////// Brachts dies noch????????? void write2Android(char str [32]) { @@ -145,7 +132,7 @@ } char str[100]; - + //send to android sprintf( str, "%f;%f;%f;%i;%i;%i;%f;;", x, y, @@ -157,39 +144,4 @@ connection->write(sizeof(str),(unsigned char*)&str); -} - -/* -int main() -{ - - pc.baud(460800); - - pc.printf("********************* MicroBridge 4568 ********************************\n\r"); - - - - pc.printf("connection isOpen\n"); - - float flt = 0.0; - float flt2 = 0.2; - float flt3 = 1.2; - - while(1) { - - ADB::poll(); - - flt = flt - 0.1; - flt2 = flt2 + 0.2; - flt3 = flt3 - 0.05; - - char str[32]; - sprintf( str, "%f;%f;%f;", flt, flt2, flt3); - - pc.printf("Sending: %s\n\r",str); - connection->write(sizeof(str),(unsigned char*)&str); - wait(1); - - } -} -*/ \ No newline at end of file +} \ No newline at end of file