00001 #ifndef TAG_CONSTANTPOSITION_H
00002 #define TAG_CONSTANTPOSITION_H
00003
00004 #include <TooN/se3.h>
00005
00006 namespace tag {
00007
00008 namespace ConstantPosition {
00009
00014
00018 class State {
00019 public:
00020 State(void){
00021 reset();
00022 }
00023
00024 void reset(void){
00025 position = TooN::SE3();
00026 TooN::Identity(covariance);
00027 }
00028
00029 static const int STATE_DIMENSION = 6;
00030 TooN::SE3 pose;
00031 TooN::Matrix<STATE_DIMENSION> covariance;
00032 };
00033
00036 template <class O>
00037 O & operator<< (O & os , const State & st){
00038 os << st.pose.ln() << st.pose.inverse().get_translation();
00039 return os;
00040 }
00041
00046 class Model {
00047 public:
00049 TooN::Vector<State::STATE_DIMENSION> sigma;
00051 TooN::Matrix<State::STATE_DIMENSION> jacobian;
00053 TooN::Matrix<State::STATE_DIMENSION> noise;
00054
00055 Model(void){
00056 TooN::Zero(sigma);
00057 TooN::Zero(noise);
00058 TooN::Identity(jacobian);
00059 }
00060
00062 TooN::Matrix<State::STATE_DIMENSION> & getJacobian(const State & state, double dt){
00063 return jacobian;
00064 }
00065
00066 void updateState( State & state, const double dt ){
00067 }
00068
00069 TooN::Matrix<State::STATE_DIMENSION> & getNoiseCovariance( double dt ){
00070 for(unsigned int i = 0; i < 6; i++){
00071 noise(i,i) = dt * sigma[i];
00072 }
00073 return noise;
00074 }
00075
00076 void updateFromMeasurement( State & state, const TooN::Vector<State::STATE_DIMENSION> & innovation ){
00077 state.pose = TooN::SE3::exp(innovation) * state.pose;
00078 }
00079 };
00080
00081 }
00082
00083 }
00084
00085 #endif