This program is for an autonomous robot for the competition at the Hochschule Luzern. We are one of the 32 teams. <a href="http://cruisingcrepe.wordpress.com/">http://cruisingcrepe.wordpress.com/</a> 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: <a href="http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf">http://www.dis.uniroma1.it/~labrob/pub/papers/Ramsete01.pdf</a>

Dependencies:   mbed

Fork of autonomousRobotAndroid by Christian Burri

Committer:
chrigelburri
Date:
Sat May 25 05:44:14 2013 +0000
Revision:
34:62996eed658a
Parent:
33:ac39982fd3b2
Child:
38:d76e488e725f
vor dem rauskicken der adb;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chrigelburri 18:306d362d692b 1 #ifndef _ANDROIDADB_H_
chrigelburri 18:306d362d692b 2 #define _ANDROIDADB_H_
chrigelburri 18:306d362d692b 3
chrigelburri 18:306d362d692b 4 #include "mbed.h"
chrigelburri 18:306d362d692b 5 #include "Adb.h"
chrigelburri 20:01b233b0e606 6 #include "defines.h"
chrigelburri 18:306d362d692b 7
chrigelburri 18:306d362d692b 8 #include <string>
chrigelburri 18:306d362d692b 9 #include <sstream>
chrigelburri 18:306d362d692b 10 #include <vector>
chrigelburri 18:306d362d692b 11 #include <iostream>
chrigelburri 18:306d362d692b 12 #include <stdlib.h>
chrigelburri 18:306d362d692b 13
chrigelburri 18:306d362d692b 14 /**
chrigelburri 34:62996eed658a 15 * @author Arno Galliker
chrigelburri 34:62996eed658a 16 *
chrigelburri 34:62996eed658a 17 * @copyright Copyright &copy; 2013 HSLU Pren Team #1 Cruising Crêpe
chrigelburri 34:62996eed658a 18 * All rights reserved.
chrigelburri 34:62996eed658a 19 *
chrigelburri 34:62996eed658a 20 * @brief
chrigelburri 34:62996eed658a 21 *
chrigelburri 34:62996eed658a 22 * This File is for the connection to te self written java android app.
chrigelburri 34:62996eed658a 23 * The connection works with the ADB class from rom Junichi Katsu.
chrigelburri 34:62996eed658a 24 * For more information see here: <a href="http://mbed.org/users/jksoft/code/MicroBridge/">http://mbed.org/users/jksoft/code/MicroBridge/</a>
chrigelburri 34:62996eed658a 25 */
chrigelburri 34:62996eed658a 26
chrigelburri 34:62996eed658a 27 /**
chrigelburri 34:62996eed658a 28 * @file androidADB.h
chrigelburri 34:62996eed658a 29 */
chrigelburri 34:62996eed658a 30
chrigelburri 34:62996eed658a 31 /**
chrigelburri 34:62996eed658a 32 * @brief Takes an string, a vector of strings for the delimited tokens.
chrigelburri 34:62996eed658a 33 * Tokens is the array to separated with the delimiters.
chrigelburri 34:62996eed658a 34 * @param str to
chrigelburri 34:62996eed658a 35 * @param tokens is the vecotr array
chrigelburri 34:62996eed658a 36 * @param delimiters of the string
chrigelburri 21:48248c5b8992 37 */
chrigelburri 18:306d362d692b 38 void Tokenize(const string& str,
chrigelburri 18:306d362d692b 39 vector<string>& tokens,
chrigelburri 18:306d362d692b 40 const string& delimiters = " ");
chrigelburri 21:48248c5b8992 41
chrigelburri 21:48248c5b8992 42 /**
chrigelburri 33:ac39982fd3b2 43 * @brief Parse the Message, split and save it to the Attributes.
chrigelburri 33:ac39982fd3b2 44 * @param length length of the data
chrigelburri 33:ac39982fd3b2 45 * @param data Data to parse
chrigelburri 21:48248c5b8992 46 */
chrigelburri 21:48248c5b8992 47 void parseMessage(uint16_t length, uint8_t * data);
chrigelburri 21:48248c5b8992 48
chrigelburri 21:48248c5b8992 49 /**
chrigelburri 33:ac39982fd3b2 50 * @brief Connecting to android.
chrigelburri 21:48248c5b8992 51 */
chrigelburri 18:306d362d692b 52 void connect();
chrigelburri 18:306d362d692b 53
chrigelburri 21:48248c5b8992 54 /**
chrigelburri 21:48248c5b8992 55 * @brief Gets the desired &theta; value.
chrigelburri 32:767044a3e421 56 * @return the desired &theta;, given in [°]
chrigelburri 21:48248c5b8992 57 */
chrigelburri 19:b2f76b0fe4c8 58 float getDesiredTheta();
chrigelburri 21:48248c5b8992 59
chrigelburri 21:48248c5b8992 60 /**
chrigelburri 21:48248c5b8992 61 * @brief Gets the desired X-postition.
chrigelburri 21:48248c5b8992 62 * @return the desired X-postition, given in [m]
chrigelburri 21:48248c5b8992 63 */
chrigelburri 19:b2f76b0fe4c8 64 float getDesiredX();
chrigelburri 21:48248c5b8992 65
chrigelburri 21:48248c5b8992 66 /**
chrigelburri 21:48248c5b8992 67 * @brief Gets the desired Y-postition.
chrigelburri 21:48248c5b8992 68 * @return the desired Y-postition, given in [m]
chrigelburri 21:48248c5b8992 69 */
chrigelburri 19:b2f76b0fe4c8 70 float getDesiredY();
chrigelburri 19:b2f76b0fe4c8 71
chrigelburri 21:48248c5b8992 72 /**
chrigelburri 28:b3e195e80439 73 * @brief Sets the desired &theta; value.
chrigelburri 28:b3e195e80439 74 * @param t desired &theta; value, given in [°]
chrigelburri 28:b3e195e80439 75 */
chrigelburri 28:b3e195e80439 76 void setDesiredTheta(float t);
chrigelburri 28:b3e195e80439 77
chrigelburri 28:b3e195e80439 78 /**
chrigelburri 21:48248c5b8992 79 * @brief Initialise the ADB subsystem. Open an ADB stream on tcp port 4568.
chrigelburri 21:48248c5b8992 80 */
chrigelburri 19:b2f76b0fe4c8 81 void init();
chrigelburri 19:b2f76b0fe4c8 82
chrigelburri 21:48248c5b8992 83 /**
chrigelburri 21:48248c5b8992 84 * @brief Write the Parameterlist to the android smartphone.
chrigelburri 33:ac39982fd3b2 85 * @param x Acutal X-Position
chrigelburri 33:ac39982fd3b2 86 * @param y Acutal Y-Position
chrigelburri 33:ac39982fd3b2 87 * @param t Acutal &theta;-Position
chrigelburri 33:ac39982fd3b2 88 * @param state_u Actual State Undervoltage
chrigelburri 33:ac39982fd3b2 89 * @param state_l Actual Left State
chrigelburri 33:ac39982fd3b2 90 * @param state_r Actual Right State
chrigelburri 33:ac39982fd3b2 91 * @param volt_b Actual battery voltage
chrigelburri 21:48248c5b8992 92 */
chrigelburri 20:01b233b0e606 93 void writeActualPosition(float x, float y, float t, int state_u, int state_l, int state_r, float volt_b);
chrigelburri 19:b2f76b0fe4c8 94
chrigelburri 18:306d362d692b 95 #endif