Christian Burri / Mbed 2 deprecated autonomous Robot Android

Dependencies:   mbed

Fork of autonomous Robot Android by Christian Burri

Embed: (wiki syntax)

« Back to documentation index

androidADB.h File Reference

androidADB.h File Reference

This File is for the connection to te self written java android app. The connection works with the ADB class from rom Junichi Katsu. For more information see here: http://mbed.org/users/jksoft/code/MicroBridge/ More...

Go to the source code of this file.

Functions

void Tokenize (const string &str, vector< string > &tokens, const string &delimiters=" ")
 Takes an string, a vector of strings for the delimited tokens.
void parseMessage (uint16_t length, uint8_t *data)
 Parse the Message, split and save it to the Attributes.
void connect ()
 Connecting to android.
float getDesiredTheta ()
 Gets the desired value.
float getDesiredX ()
 Gets the desired X-postition.
float getDesiredY ()
 Gets the desired Y-postition.
void setDesiredTheta (float t)
 Sets the desired value.
void init ()
 Initialise the ADB subsystem.
void writeActualPosition (float x, float y, float t, int state_u, int state_l, int state_r, float volt_b)
 Write the Parameterlist to the android smartphone.

Detailed Description

This File is for the connection to te self written java android app. The connection works with the ADB class from rom Junichi Katsu. For more information see here: http://mbed.org/users/jksoft/code/MicroBridge/

Author:
Arno Galliker

Copyright (c) 2013 HSLU Pren Team #1 Cruising Crêpe All rights reserved.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file androidADB.h.


Function Documentation

void connect (  )

Connecting to android.

Definition at line 96 of file androidADB.cpp.

float getDesiredTheta (  )

Gets the desired value.

Returns:
the desired , given in [°]

Definition at line 27 of file androidADB.cpp.

float getDesiredX (  )

Gets the desired X-postition.

Returns:
the desired X-postition, given in [m]

Definition at line 17 of file androidADB.cpp.

float getDesiredY (  )

Gets the desired Y-postition.

Returns:
the desired Y-postition, given in [m]

Definition at line 22 of file androidADB.cpp.

void init (  )

Initialise the ADB subsystem.

Open an ADB stream on tcp port 4568.

Definition at line 103 of file androidADB.cpp.

void parseMessage ( uint16_t  length,
uint8_t *  data 
)

Parse the Message, split and save it to the Attributes.

Parameters:
lengthlength of the data
dataData to parse

Definition at line 71 of file androidADB.cpp.

void setDesiredTheta ( float  t )

Sets the desired value.

Parameters:
tdesired value, given in [°]

Definition at line 32 of file androidADB.cpp.

void Tokenize ( const string &  str,
vector< string > &  tokens,
const string &  delimiters = " " 
)

Takes an string, a vector of strings for the delimited tokens.

Tokens is the array to separated with the delimiters.

Parameters:
strto
tokensis the vecotr array
delimitersof the string

Definition at line 37 of file androidADB.cpp.

void writeActualPosition ( float  x,
float  y,
float  t,
int  state_u,
int  state_l,
int  state_r,
float  volt_b 
)

Write the Parameterlist to the android smartphone.

Parameters:
xAcutal X-Position
yAcutal Y-Position
tAcutal -Position
state_uActual State Undervoltage
state_lActual Left State
state_rActual Right State
volt_bActual battery voltage

Definition at line 120 of file androidADB.cpp.