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>
Fork of autonomousRobotAndroid by
StateDefines/State.h
- Committer:
- chrigelburri
- Date:
- 2013-03-23
- Revision:
- 6:48eeb41188dd
- Parent:
- 3:92ba0254af87
- Child:
- 11:775ebb69d5e1
File content as of revision 6:48eeb41188dd:
#ifndef _STATE_H_ #define _STATE_H_ #include <cmath> #include "mbed.h" #include "MaxonESCON.h" #include "RobotControl.h" #include "Task.h" #include "HMC5883L.h" #include "HMC6352.h" #include "defines.h" /** * @author Christian Burri * * @section LICENSE * * Copyright © 2013 HSLU Pren Team #1 Cruising Crêpe * All rights reserved. * * @section DESCRIPTION * * State is the main mechanism for communicating current realtime system state to * the rest of the system for logging etc. * */ class State : public Task { private: state_t* s; RobotControl* robotControl; MaxonESCON* motorControllerLeft; MaxonESCON* motorControllerRight; // HMC6352* compass; AnalogIn* battery; Timer timer; float period; //float magout[3]; public: /** * Creates a robot control object and initializes all private state variables. * @param s struct to read and write the state * @param robotControl Object to read the state * @param motorControllerLeft a reference to the servo drive for the left motor * @param motorControllerRight a reference to the servo drive for the right motor * @param compass Modul HMC5883L * @param battery Analog Input Battery Voltage input * @param period the sampling period of the run loop of this controller, given in [s] */ State(state_t* s, RobotControl* robotControl, MaxonESCON* motorControllerLeft, MaxonESCON* motorControllerRight, /*HMC6352* compass,*/ AnalogIn* battery, float period); /** * Destructor of the Object to destroy the Object. **/ virtual ~State(); /** * Initzialize the File. Open the File plots.txt and set the title at first line. */ void initPlotFile(void); /** * Save the char to the file. * For example at the end. * Don't forget the \n at first. */ void savePlotText(char text[]); /** * Close the File. */ void closePlotFile(void); /** * Return the Battery voltage * state variables. * @return Batterie Voltage [V] */ float readBattery(); /** * Starts the timer from zero. * The timer is for the logging Time. */ void startTimerFromZero(); /** * Save the new state to a new line. */ void savePlotFile(state_t s); void run(); private: void setBatteryBit(); void setEnableLeftBit(); void setEnableRightBit(); }; #endif