Christian Burri / Mbed 2 deprecated autonomousRobotAndroid

Dependencies:   mbed

Fork of autonomousRobotAndroid by Christian Burri

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MotionState.h Source File

MotionState.h

00001 #ifndef _MOTION_STATE_H_
00002 #define _MOTION_STATE_H_
00003 
00004 #include "defines.h"
00005 
00006 /**
00007  * @author Christian Burri
00008  *
00009  * @copyright Copyright (c) 2013 HSLU Pren Team #1 Cruising Crêpe
00010  * All rights reserved.
00011  *
00012  * @brief
00013  *
00014  * This help class is for calculate and save the actual or desired value.
00015  * There have the setter and the getter methode to change the value
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
00018  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00020  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00021  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00022  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00023  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00024  */
00025 class MotionState
00026 {
00027 
00028 public:
00029 
00030     /** @brief The xposition value of this motion state. */
00031     float xposition;
00032     /** @brief The yposition value of this motion state. */
00033     float yposition;
00034     /** @brief The θ of this motion state. */
00035     float theta;
00036     /** @brief The speed value of this motion state. */
00037     float speed;
00038     /** @brief The speed rotational value of this motion state. */
00039     float omega;
00040 
00041     /**
00042      * @brief Creates a <code>MotionState</code> object.
00043      * The values for position and speed are set to 0.
00044      */
00045     MotionState();
00046 
00047     /**
00048      * @brief Creates a <code>MotionState</code> object with given values for position and speed.
00049      * @param xposition the initial position value of this motion state, given in [m]
00050      * @param yposition the initial position value of this motion state, given in [m]
00051      * @param theta the initial &theta; value of this motion state, given in [rad]
00052      * @param speed the initial speed value of this motion state, given in [m/s]
00053      * @param omega the initial &omega; speed value of this motion state, given in [rad/s]
00054      */
00055     MotionState(float xposition,
00056                 float yposition,
00057                 float theta,
00058                 float speed,
00059                 float omega);
00060 
00061     /**
00062      * @brief Destructor of the Object to destroy the Object.
00063      */
00064     virtual     ~MotionState();
00065 
00066     /**
00067      * @brief Sets the values for xPosition, yPostion and &theta;.
00068      * @param xposition the initial position value of this motion state, given in [m]
00069      * @param yposition the initial position value of this motion state, given in [m]
00070      * @param theta the initial &theta; value of this motion state, given in [rad]
00071      * @param speed the initial speed value of this motion state, given in [m/s]
00072      * @param omega the initial &omega; speed value of this motion state, given in [rad/s]
00073      */
00074     void        setState(float xposition,
00075                          float yposition,
00076                          float theta,
00077                          float speed,
00078                          float omega);
00079 
00080     /**
00081      * @brief Sets the values for X-Position, Y-Postion and &theta;.
00082      * @param motionState another <code>MotionState</code> object to copy the state values from
00083      */
00084     void        setState(MotionState* motionState);
00085 
00086     /**
00087      * @brief Sets the X-position value.
00088      * @param xposition the desired xposition value of this motion state, given in [m]
00089      */
00090     void        setxPosition(float xposition);
00091 
00092     /**
00093      * @brief Gets the X-position value.
00094      * @return the xposition value of this motion state, given in [m]
00095      */
00096     float       getxPosition();
00097 
00098     /**
00099      * @brief Sets the Y-position value.
00100      * @param yposition the desired yposition value of this motion state, given in [m]
00101      */
00102     void        setyPosition(float yposition);
00103 
00104     /**
00105      * @brief Gets the Y-position value.
00106      * @return the xposition value of this motion state, given in [m]
00107      */
00108     float       getyPosition();
00109 
00110     /**
00111      * @brief Sets the &theta; value.
00112      * @param theta the desired &theta; value of this motion state, given in [rad]
00113      */
00114     void        setTheta(float theta);
00115 
00116     /**
00117      * @brief Gets the &theta; value.
00118      * @return the &theta; value of this motion state, given in [rad]
00119      */
00120     float       getTheta();
00121 
00122     /**
00123      * @brief Sets the speed value.
00124      * @param speed the desired speed value of this motion state, given in [m/s]
00125      */
00126     void        setSpeed(float speed);
00127 
00128     /**
00129      * @brief Gets the speed value.
00130      * @return the speed value of this motion state, given in [m/s]
00131      */
00132     float       getSpeed();
00133 
00134     /**
00135      * @brief Sets the &omega; value.
00136      * @param omega the desired &omega; value of this motion state, given in [rad/s]
00137      */
00138     void        setOmega(float omega);
00139 
00140     /**
00141      * @brief Gets the &omega; value.
00142      * @return the &omega; value of this motion state, given in [rad/s]
00143      */
00144     float       getOmega();
00145 
00146 };
00147 
00148 #endif