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.cpp Source File

MotionState.cpp

00001 #include "MotionState.h"
00002 
00003 using namespace std;
00004 
00005 MotionState::MotionState()
00006 {
00007     xposition = 0.0f;
00008     yposition = 0.0f;
00009     theta = 0.0f;
00010     speed = 0.0f;
00011     omega = 0.0f;
00012 }
00013 
00014 
00015 MotionState::MotionState(float xposition,
00016                          float yposition,
00017                          float theta,
00018                          float speed,
00019                          float omega)
00020 {
00021     this->xposition = xposition;
00022     this->yposition = yposition;
00023     this->theta = theta;
00024     this->speed = speed;
00025     this->omega = omega;
00026 }
00027 
00028 MotionState::~MotionState()
00029 {
00030 
00031 }
00032 
00033 void MotionState::setState(float xposition,
00034                            float yposition,
00035                            float theta,
00036                            float speed,
00037                            float omega)
00038 {
00039     this->xposition = xposition;
00040     this->yposition = yposition;
00041     this->theta = theta;
00042     this->speed = speed;
00043     this->omega = omega;
00044 }
00045 
00046 void MotionState::setState(MotionState* motionState)
00047 {
00048     xposition = motionState->xposition;
00049     yposition = motionState->yposition;
00050     theta = motionState->theta;
00051     speed = motionState->speed;
00052     omega = motionState->omega;
00053 }
00054 
00055 void MotionState::setxPosition(float xposition)
00056 {
00057     this->xposition = xposition;
00058 }
00059 
00060 float MotionState::getxPosition()
00061 {
00062     return xposition;
00063 }
00064 
00065 void MotionState::setyPosition(float yposition)
00066 {
00067     this->yposition = yposition;
00068 }
00069 
00070 float MotionState::getyPosition()
00071 {
00072     return yposition;
00073 }
00074 
00075 void MotionState::setTheta(float theta)
00076 {
00077     this->theta = theta;
00078 }
00079 
00080 float MotionState::getTheta()
00081 {
00082     return theta;
00083 }
00084 
00085 void MotionState::setSpeed(float speed)
00086 {
00087     this->speed = speed;
00088 }
00089 
00090 float MotionState::getSpeed()
00091 {
00092     return speed;
00093 }
00094 
00095 void MotionState::setOmega(float omega)
00096 {
00097     this->omega = omega;
00098 }
00099 
00100 float MotionState::getOmega()
00101 {
00102     return omega;
00103 }
00104