00001
00002
00003 #ifndef SLAM_ODO_3D_PREDICT_MODEL_HPP
00004 #define SLAM_ODO_3D_PREDICT_MODEL_HPP
00005
00006 #include "jmath/jblas.hpp"
00007
00008 #include "filter/predictModel.hpp"
00009
00010 namespace jafar {
00011 namespace slam {
00012
00017 class OdoNoiseModel {
00018
00019 public:
00020
00022 double kvv;
00024 double kvw;
00026 double kwv;
00028 double kww;
00029
00039 void set(double kvv_, double kvw_, double kwv_, double kww_) {
00040 kvv = kvv_;
00041 kvw = kvw_;
00042 kwv = kwv_;
00043 kww = kww_;
00044 }
00045
00046
00047
00053 void computeCov(jblas::vec const& vw,
00054 jblas::sym_mat& vwCov) const
00055 {
00056 JFR_PRECOND(vw.size() == 2,
00057 "OdoNoiseModel::computeOdoCov: odo must be 2-dimension");
00058 JFR_PRECOND(vwCov.size1() == 2 && vwCov.size2() == 2,
00059 "OdoNoiseModel::computeOdoCov: odoCov must be a 2x2 matrix");
00060
00061 vwCov.clear();
00062 vwCov(0,0) = pow(kvv,2)*fabs(vw(0)) + pow(kvw, 2)*fabs(vw(1));
00063 vwCov(1,1) = pow(kwv,2)*fabs(vw(0)) + pow(kww, 2)*fabs(vw(1));
00064 }
00065
00066 };
00067
00068
00073 class Odo3dPredictModel :
00074 public jafar::filter::JacobianBlockCommandPredictModel {
00075
00076 public:
00077
00079 OdoNoiseModel odoNoiseModel;
00080
00081 double kzs, kprs;
00082
00084 double robotToRef_yaw;
00085
00086 Odo3dPredictModel();
00087 ~Odo3dPredictModel() {}
00088
00098 void setModel(double kvv_, double kvw_, double kwv_, double kww_, double kzv_, double kprs_);
00099
00100 void computeUCov(jblas::vec const& u) {
00101 odoNoiseModel.computeCov(u, m_uCov);
00102 }
00103
00104 void predict(jblas::vec_range& x_r, jblas::vec const& u);
00105
00106 };
00107
00108 }
00109 }
00110
00111 #endif // SLAM_ODO_3D_PREDICT_MODEL_HPP