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

Dependencies:   mbed

Fork of autonomous Robot Android by Christian Burri

Embed: (wiki syntax)

« Back to documentation index

State Class Reference

State Class Reference

State is the main mechanism for communicating current realtime system state to the rest of the system for logging etc. More...

#include <State.h>

Inherits Task.

Public Member Functions

 State (state_t *s, RobotControl *robotControl, MaxonESCON *motorControllerLeft, MaxonESCON *motorControllerRight, PinName batteryPin, float period)
 Creates a robot control object and initializes all private state variables.
virtual ~State ()
 Destructor of the Object to destroy the Object.
void initPlotFile (void)
 Initzialize the File.
void closePlotFile (void)
 Close the File.
float readBattery ()
 Return the Battery voltage state variables.
void startTimerFromZero ()
 Starts the timer from zero.
void savePlotFile (state_t s)
 Save the new state to a new line.
float dim (int idx, float f)
 Returns the transform a sinusvalue from -1.0 .
void run ()
 Run method actualize every period.
float getPeriod ()
 Gets the period of this task.
void start ()
 Starts this task.
void stop ()
 Stops this task.

Detailed Description

State is the main mechanism for communicating current realtime system state to the rest of the system for logging etc.

Author:
Christian Burri

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 at line 29 of file State.h.


Constructor & Destructor Documentation

State ( state_t s,
RobotControl robotControl,
MaxonESCON motorControllerLeft,
MaxonESCON motorControllerRight,
PinName  batteryPin,
float  period 
)

Creates a robot control object and initializes all private state variables.

Parameters:
sstruct to read and write the state
robotControlObject to read the state
motorControllerLefta reference to the servo drive for the left motor
motorControllerRighta reference to the servo drive for the right motor
batteryPinmbed pin for analog Input Battery Voltage
periodthe sampling period of the run loop of this controller, given in [s]

Definition at line 11 of file State.cpp.

~State (  ) [virtual]

Destructor of the Object to destroy the Object.

Definition at line 29 of file State.cpp.


Member Function Documentation

void closePlotFile ( void   )

Close the File.

Definition at line 101 of file State.cpp.

float dim ( int  idx,
float  f 
)

Returns the transform a sinusvalue from -1.0 .

. 1.0 to 0.0 .. 1.0

Parameters:
idxnumber of LEDS
fvalue till 2
Returns:
sinus value from 0.0f 1.0f

Definition at line 144 of file State.cpp.

float getPeriod (  ) [inherited]

Gets the period of this task.

Returns:
the period in seconds.

Definition at line 13 of file Task.cpp.

void initPlotFile ( void   )

Initzialize the File.

Open the File plots.txt and set the title at first line.

Definition at line 31 of file State.cpp.

float readBattery (  )

Return the Battery voltage state variables.

Returns:
Batterie Voltage [V]

Definition at line 106 of file State.cpp.

void run (  ) [virtual]

Run method actualize every period.

Reimplemented from Task.

Definition at line 149 of file State.cpp.

void savePlotFile ( state_t  s )

Save the new state to a new line.

Definition at line 65 of file State.cpp.

void start (  ) [inherited]

Starts this task.

Definition at line 18 of file Task.cpp.

void startTimerFromZero (  )

Starts the timer from zero.

The timer is for the logging Time.

Definition at line 138 of file State.cpp.

void stop (  ) [inherited]

Stops this task.

Definition at line 23 of file Task.cpp.