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
Fork of autonomous Robot Android by
RobotControl/MotionState.h@39:a4fd6206da89, 2013-06-10 (annotated)
- Committer:
- chrigelburri
- Date:
- Mon Jun 10 14:40:37 2013 +0000
- Revision:
- 39:a4fd6206da89
- Parent:
- 38:d76e488e725f
V1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chrigelburri | 0:31f7be68e52d | 1 | #ifndef _MOTION_STATE_H_ |
chrigelburri | 0:31f7be68e52d | 2 | #define _MOTION_STATE_H_ |
chrigelburri | 0:31f7be68e52d | 3 | |
chrigelburri | 0:31f7be68e52d | 4 | #include "defines.h" |
chrigelburri | 0:31f7be68e52d | 5 | |
chrigelburri | 0:31f7be68e52d | 6 | /** |
chrigelburri | 0:31f7be68e52d | 7 | * @author Christian Burri |
chrigelburri | 0:31f7be68e52d | 8 | * |
chrigelburri | 38:d76e488e725f | 9 | * @copyright Copyright (c) 2013 HSLU Pren Team #1 Cruising Crêpe |
chrigelburri | 0:31f7be68e52d | 10 | * All rights reserved. |
chrigelburri | 0:31f7be68e52d | 11 | * |
chrigelburri | 11:775ebb69d5e1 | 12 | * @brief |
chrigelburri | 0:31f7be68e52d | 13 | * |
chrigelburri | 3:92ba0254af87 | 14 | * This help class is for calculate and save the actual or desired value. |
chrigelburri | 3:92ba0254af87 | 15 | * There have the setter and the getter methode to change the value |
chrigelburri | 0:31f7be68e52d | 16 | * |
chrigelburri | 38:d76e488e725f | 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, |
chrigelburri | 38:d76e488e725f | 18 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
chrigelburri | 38:d76e488e725f | 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
chrigelburri | 38:d76e488e725f | 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
chrigelburri | 38:d76e488e725f | 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
chrigelburri | 38:d76e488e725f | 22 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
chrigelburri | 38:d76e488e725f | 23 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
chrigelburri | 0:31f7be68e52d | 24 | */ |
chrigelburri | 0:31f7be68e52d | 25 | class MotionState |
chrigelburri | 0:31f7be68e52d | 26 | { |
chrigelburri | 0:31f7be68e52d | 27 | |
chrigelburri | 0:31f7be68e52d | 28 | public: |
chrigelburri | 0:31f7be68e52d | 29 | |
chrigelburri | 11:775ebb69d5e1 | 30 | /** @brief The xposition value of this motion state. */ |
chrigelburri | 0:31f7be68e52d | 31 | float xposition; |
chrigelburri | 11:775ebb69d5e1 | 32 | /** @brief The yposition value of this motion state. */ |
chrigelburri | 0:31f7be68e52d | 33 | float yposition; |
chrigelburri | 11:775ebb69d5e1 | 34 | /** @brief The θ of this motion state. */ |
chrigelburri | 0:31f7be68e52d | 35 | float theta; |
chrigelburri | 11:775ebb69d5e1 | 36 | /** @brief The speed value of this motion state. */ |
chrigelburri | 0:31f7be68e52d | 37 | float speed; |
chrigelburri | 11:775ebb69d5e1 | 38 | /** @brief The speed rotational value of this motion state. */ |
chrigelburri | 0:31f7be68e52d | 39 | float omega; |
chrigelburri | 0:31f7be68e52d | 40 | |
chrigelburri | 0:31f7be68e52d | 41 | /** |
chrigelburri | 11:775ebb69d5e1 | 42 | * @brief Creates a <code>MotionState</code> object. |
chrigelburri | 0:31f7be68e52d | 43 | * The values for position and speed are set to 0. |
chrigelburri | 0:31f7be68e52d | 44 | */ |
chrigelburri | 0:31f7be68e52d | 45 | MotionState(); |
chrigelburri | 0:31f7be68e52d | 46 | |
chrigelburri | 0:31f7be68e52d | 47 | /** |
chrigelburri | 11:775ebb69d5e1 | 48 | * @brief Creates a <code>MotionState</code> object with given values for position and speed. |
chrigelburri | 6:48eeb41188dd | 49 | * @param xposition the initial position value of this motion state, given in [m] |
chrigelburri | 6:48eeb41188dd | 50 | * @param yposition the initial position value of this motion state, given in [m] |
chrigelburri | 6:48eeb41188dd | 51 | * @param theta the initial θ value of this motion state, given in [rad] |
chrigelburri | 6:48eeb41188dd | 52 | * @param speed the initial speed value of this motion state, given in [m/s] |
chrigelburri | 6:48eeb41188dd | 53 | * @param omega the initial ω speed value of this motion state, given in [rad/s] |
chrigelburri | 6:48eeb41188dd | 54 | */ |
chrigelburri | 6:48eeb41188dd | 55 | MotionState(float xposition, |
chrigelburri | 6:48eeb41188dd | 56 | float yposition, |
chrigelburri | 6:48eeb41188dd | 57 | float theta, |
chrigelburri | 6:48eeb41188dd | 58 | float speed, |
chrigelburri | 6:48eeb41188dd | 59 | float omega); |
chrigelburri | 0:31f7be68e52d | 60 | |
chrigelburri | 0:31f7be68e52d | 61 | /** |
chrigelburri | 11:775ebb69d5e1 | 62 | * @brief Destructor of the Object to destroy the Object. |
chrigelburri | 12:235e318a414f | 63 | */ |
chrigelburri | 0:31f7be68e52d | 64 | virtual ~MotionState(); |
chrigelburri | 0:31f7be68e52d | 65 | |
chrigelburri | 0:31f7be68e52d | 66 | /** |
chrigelburri | 11:775ebb69d5e1 | 67 | * @brief Sets the values for xPosition, yPostion and θ. |
chrigelburri | 6:48eeb41188dd | 68 | * @param xposition the initial position value of this motion state, given in [m] |
chrigelburri | 6:48eeb41188dd | 69 | * @param yposition the initial position value of this motion state, given in [m] |
chrigelburri | 6:48eeb41188dd | 70 | * @param theta the initial θ value of this motion state, given in [rad] |
chrigelburri | 6:48eeb41188dd | 71 | * @param speed the initial speed value of this motion state, given in [m/s] |
chrigelburri | 6:48eeb41188dd | 72 | * @param omega the initial ω speed value of this motion state, given in [rad/s] |
chrigelburri | 6:48eeb41188dd | 73 | */ |
chrigelburri | 6:48eeb41188dd | 74 | void setState(float xposition, |
chrigelburri | 6:48eeb41188dd | 75 | float yposition, |
chrigelburri | 6:48eeb41188dd | 76 | float theta, |
chrigelburri | 6:48eeb41188dd | 77 | float speed, |
chrigelburri | 6:48eeb41188dd | 78 | float omega); |
chrigelburri | 0:31f7be68e52d | 79 | |
chrigelburri | 0:31f7be68e52d | 80 | /** |
chrigelburri | 11:775ebb69d5e1 | 81 | * @brief Sets the values for X-Position, Y-Postion and θ. |
chrigelburri | 6:48eeb41188dd | 82 | * @param motionState another <code>MotionState</code> object to copy the state values from |
chrigelburri | 6:48eeb41188dd | 83 | */ |
chrigelburri | 0:31f7be68e52d | 84 | void setState(MotionState* motionState); |
chrigelburri | 0:31f7be68e52d | 85 | |
chrigelburri | 0:31f7be68e52d | 86 | /** |
chrigelburri | 11:775ebb69d5e1 | 87 | * @brief Sets the X-position value. |
chrigelburri | 6:48eeb41188dd | 88 | * @param xposition the desired xposition value of this motion state, given in [m] |
chrigelburri | 6:48eeb41188dd | 89 | */ |
chrigelburri | 1:6cd533a712c6 | 90 | void setxPosition(float xposition); |
chrigelburri | 0:31f7be68e52d | 91 | |
chrigelburri | 0:31f7be68e52d | 92 | /** |
chrigelburri | 11:775ebb69d5e1 | 93 | * @brief Gets the X-position value. |
chrigelburri | 6:48eeb41188dd | 94 | * @return the xposition value of this motion state, given in [m] |
chrigelburri | 6:48eeb41188dd | 95 | */ |
chrigelburri | 0:31f7be68e52d | 96 | float getxPosition(); |
chrigelburri | 0:31f7be68e52d | 97 | |
chrigelburri | 0:31f7be68e52d | 98 | /** |
chrigelburri | 11:775ebb69d5e1 | 99 | * @brief Sets the Y-position value. |
chrigelburri | 6:48eeb41188dd | 100 | * @param yposition the desired yposition value of this motion state, given in [m] |
chrigelburri | 6:48eeb41188dd | 101 | */ |
chrigelburri | 0:31f7be68e52d | 102 | void setyPosition(float yposition); |
chrigelburri | 0:31f7be68e52d | 103 | |
chrigelburri | 0:31f7be68e52d | 104 | /** |
chrigelburri | 11:775ebb69d5e1 | 105 | * @brief Gets the Y-position value. |
chrigelburri | 6:48eeb41188dd | 106 | * @return the xposition value of this motion state, given in [m] |
chrigelburri | 6:48eeb41188dd | 107 | */ |
chrigelburri | 0:31f7be68e52d | 108 | float getyPosition(); |
chrigelburri | 0:31f7be68e52d | 109 | |
chrigelburri | 0:31f7be68e52d | 110 | /** |
chrigelburri | 11:775ebb69d5e1 | 111 | * @brief Sets the θ value. |
chrigelburri | 6:48eeb41188dd | 112 | * @param theta the desired θ value of this motion state, given in [rad] |
chrigelburri | 6:48eeb41188dd | 113 | */ |
chrigelburri | 0:31f7be68e52d | 114 | void setTheta(float theta); |
chrigelburri | 0:31f7be68e52d | 115 | |
chrigelburri | 0:31f7be68e52d | 116 | /** |
chrigelburri | 11:775ebb69d5e1 | 117 | * @brief Gets the θ value. |
chrigelburri | 6:48eeb41188dd | 118 | * @return the θ value of this motion state, given in [rad] |
chrigelburri | 6:48eeb41188dd | 119 | */ |
chrigelburri | 0:31f7be68e52d | 120 | float getTheta(); |
chrigelburri | 0:31f7be68e52d | 121 | |
chrigelburri | 0:31f7be68e52d | 122 | /** |
chrigelburri | 11:775ebb69d5e1 | 123 | * @brief Sets the speed value. |
chrigelburri | 6:48eeb41188dd | 124 | * @param speed the desired speed value of this motion state, given in [m/s] |
chrigelburri | 6:48eeb41188dd | 125 | */ |
chrigelburri | 0:31f7be68e52d | 126 | void setSpeed(float speed); |
chrigelburri | 0:31f7be68e52d | 127 | |
chrigelburri | 0:31f7be68e52d | 128 | /** |
chrigelburri | 11:775ebb69d5e1 | 129 | * @brief Gets the speed value. |
chrigelburri | 6:48eeb41188dd | 130 | * @return the speed value of this motion state, given in [m/s] |
chrigelburri | 6:48eeb41188dd | 131 | */ |
chrigelburri | 0:31f7be68e52d | 132 | float getSpeed(); |
chrigelburri | 0:31f7be68e52d | 133 | |
chrigelburri | 0:31f7be68e52d | 134 | /** |
chrigelburri | 11:775ebb69d5e1 | 135 | * @brief Sets the ω value. |
chrigelburri | 6:48eeb41188dd | 136 | * @param omega the desired ω value of this motion state, given in [rad/s] |
chrigelburri | 6:48eeb41188dd | 137 | */ |
chrigelburri | 0:31f7be68e52d | 138 | void setOmega(float omega); |
chrigelburri | 0:31f7be68e52d | 139 | |
chrigelburri | 0:31f7be68e52d | 140 | /** |
chrigelburri | 11:775ebb69d5e1 | 141 | * @brief Gets the ω value. |
chrigelburri | 6:48eeb41188dd | 142 | * @return the ω value of this motion state, given in [rad/s] |
chrigelburri | 6:48eeb41188dd | 143 | */ |
chrigelburri | 0:31f7be68e52d | 144 | float getOmega(); |
chrigelburri | 0:31f7be68e52d | 145 | |
chrigelburri | 0:31f7be68e52d | 146 | }; |
chrigelburri | 0:31f7be68e52d | 147 | |
chrigelburri | 0:31f7be68e52d | 148 | #endif |