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.cpp@39:a4fd6206da89, 2013-06-10 (annotated)
- Committer:
- chrigelburri
- Date:
- Mon Jun 10 14:40:37 2013 +0000
- Revision:
- 39:a4fd6206da89
- Parent:
- 11:775ebb69d5e1
V1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chrigelburri | 0:31f7be68e52d | 1 | #include "MotionState.h" |
chrigelburri | 0:31f7be68e52d | 2 | |
chrigelburri | 0:31f7be68e52d | 3 | using namespace std; |
chrigelburri | 0:31f7be68e52d | 4 | |
chrigelburri | 0:31f7be68e52d | 5 | MotionState::MotionState() |
chrigelburri | 0:31f7be68e52d | 6 | { |
chrigelburri | 0:31f7be68e52d | 7 | xposition = 0.0f; |
chrigelburri | 0:31f7be68e52d | 8 | yposition = 0.0f; |
chrigelburri | 0:31f7be68e52d | 9 | theta = 0.0f; |
chrigelburri | 0:31f7be68e52d | 10 | speed = 0.0f; |
chrigelburri | 0:31f7be68e52d | 11 | omega = 0.0f; |
chrigelburri | 0:31f7be68e52d | 12 | } |
chrigelburri | 0:31f7be68e52d | 13 | |
chrigelburri | 0:31f7be68e52d | 14 | |
chrigelburri | 6:48eeb41188dd | 15 | MotionState::MotionState(float xposition, |
chrigelburri | 6:48eeb41188dd | 16 | float yposition, |
chrigelburri | 6:48eeb41188dd | 17 | float theta, |
chrigelburri | 6:48eeb41188dd | 18 | float speed, |
chrigelburri | 6:48eeb41188dd | 19 | float omega) |
chrigelburri | 0:31f7be68e52d | 20 | { |
chrigelburri | 0:31f7be68e52d | 21 | this->xposition = xposition; |
chrigelburri | 0:31f7be68e52d | 22 | this->yposition = yposition; |
chrigelburri | 0:31f7be68e52d | 23 | this->theta = theta; |
chrigelburri | 0:31f7be68e52d | 24 | this->speed = speed; |
chrigelburri | 0:31f7be68e52d | 25 | this->omega = omega; |
chrigelburri | 0:31f7be68e52d | 26 | } |
chrigelburri | 0:31f7be68e52d | 27 | |
chrigelburri | 0:31f7be68e52d | 28 | MotionState::~MotionState() |
chrigelburri | 0:31f7be68e52d | 29 | { |
chrigelburri | 0:31f7be68e52d | 30 | |
chrigelburri | 0:31f7be68e52d | 31 | } |
chrigelburri | 0:31f7be68e52d | 32 | |
chrigelburri | 6:48eeb41188dd | 33 | void MotionState::setState(float xposition, |
chrigelburri | 6:48eeb41188dd | 34 | float yposition, |
chrigelburri | 6:48eeb41188dd | 35 | float theta, |
chrigelburri | 6:48eeb41188dd | 36 | float speed, |
chrigelburri | 6:48eeb41188dd | 37 | float omega) |
chrigelburri | 0:31f7be68e52d | 38 | { |
chrigelburri | 0:31f7be68e52d | 39 | this->xposition = xposition; |
chrigelburri | 0:31f7be68e52d | 40 | this->yposition = yposition; |
chrigelburri | 0:31f7be68e52d | 41 | this->theta = theta; |
chrigelburri | 0:31f7be68e52d | 42 | this->speed = speed; |
chrigelburri | 0:31f7be68e52d | 43 | this->omega = omega; |
chrigelburri | 0:31f7be68e52d | 44 | } |
chrigelburri | 0:31f7be68e52d | 45 | |
chrigelburri | 0:31f7be68e52d | 46 | void MotionState::setState(MotionState* motionState) |
chrigelburri | 0:31f7be68e52d | 47 | { |
chrigelburri | 0:31f7be68e52d | 48 | xposition = motionState->xposition; |
chrigelburri | 0:31f7be68e52d | 49 | yposition = motionState->yposition; |
chrigelburri | 0:31f7be68e52d | 50 | theta = motionState->theta; |
chrigelburri | 0:31f7be68e52d | 51 | speed = motionState->speed; |
chrigelburri | 0:31f7be68e52d | 52 | omega = motionState->omega; |
chrigelburri | 0:31f7be68e52d | 53 | } |
chrigelburri | 0:31f7be68e52d | 54 | |
chrigelburri | 0:31f7be68e52d | 55 | void MotionState::setxPosition(float xposition) |
chrigelburri | 0:31f7be68e52d | 56 | { |
chrigelburri | 0:31f7be68e52d | 57 | this->xposition = xposition; |
chrigelburri | 0:31f7be68e52d | 58 | } |
chrigelburri | 0:31f7be68e52d | 59 | |
chrigelburri | 0:31f7be68e52d | 60 | float MotionState::getxPosition() |
chrigelburri | 0:31f7be68e52d | 61 | { |
chrigelburri | 0:31f7be68e52d | 62 | return xposition; |
chrigelburri | 0:31f7be68e52d | 63 | } |
chrigelburri | 0:31f7be68e52d | 64 | |
chrigelburri | 0:31f7be68e52d | 65 | void MotionState::setyPosition(float yposition) |
chrigelburri | 0:31f7be68e52d | 66 | { |
chrigelburri | 0:31f7be68e52d | 67 | this->yposition = yposition; |
chrigelburri | 0:31f7be68e52d | 68 | } |
chrigelburri | 0:31f7be68e52d | 69 | |
chrigelburri | 0:31f7be68e52d | 70 | float MotionState::getyPosition() |
chrigelburri | 0:31f7be68e52d | 71 | { |
chrigelburri | 0:31f7be68e52d | 72 | return yposition; |
chrigelburri | 0:31f7be68e52d | 73 | } |
chrigelburri | 0:31f7be68e52d | 74 | |
chrigelburri | 0:31f7be68e52d | 75 | void MotionState::setTheta(float theta) |
chrigelburri | 0:31f7be68e52d | 76 | { |
chrigelburri | 0:31f7be68e52d | 77 | this->theta = theta; |
chrigelburri | 0:31f7be68e52d | 78 | } |
chrigelburri | 0:31f7be68e52d | 79 | |
chrigelburri | 0:31f7be68e52d | 80 | float MotionState::getTheta() |
chrigelburri | 0:31f7be68e52d | 81 | { |
chrigelburri | 0:31f7be68e52d | 82 | return theta; |
chrigelburri | 0:31f7be68e52d | 83 | } |
chrigelburri | 0:31f7be68e52d | 84 | |
chrigelburri | 0:31f7be68e52d | 85 | void MotionState::setSpeed(float speed) |
chrigelburri | 0:31f7be68e52d | 86 | { |
chrigelburri | 0:31f7be68e52d | 87 | this->speed = speed; |
chrigelburri | 0:31f7be68e52d | 88 | } |
chrigelburri | 0:31f7be68e52d | 89 | |
chrigelburri | 0:31f7be68e52d | 90 | float MotionState::getSpeed() |
chrigelburri | 0:31f7be68e52d | 91 | { |
chrigelburri | 0:31f7be68e52d | 92 | return speed; |
chrigelburri | 0:31f7be68e52d | 93 | } |
chrigelburri | 0:31f7be68e52d | 94 | |
chrigelburri | 0:31f7be68e52d | 95 | void MotionState::setOmega(float omega) |
chrigelburri | 0:31f7be68e52d | 96 | { |
chrigelburri | 0:31f7be68e52d | 97 | this->omega = omega; |
chrigelburri | 0:31f7be68e52d | 98 | } |
chrigelburri | 0:31f7be68e52d | 99 | |
chrigelburri | 0:31f7be68e52d | 100 | float MotionState::getOmega() |
chrigelburri | 0:31f7be68e52d | 101 | { |
chrigelburri | 0:31f7be68e52d | 102 | return omega; |
chrigelburri | 0:31f7be68e52d | 103 | } |
chrigelburri | 0:31f7be68e52d | 104 |