Go to the documentation of this file.00001
00013 #ifndef ROBOTODOMETRY_HPP_
00014 #define ROBOTODOMETRY_HPP_
00015
00016 #include "rtslam/robotAbstract.hpp"
00017
00018 namespace jafar {
00019 namespace rtslam {
00020
00021 class RobotOdometry;
00022 typedef boost::shared_ptr<RobotOdometry> robodo_ptr_t;
00023
00052 class RobotOdometry: public RobotAbstract {
00053 public:
00054 using RobotAbstract::move;
00055
00060 RobotOdometry(const map_ptr_t _mapPtr);
00061
00062 ~RobotOdometry(void) {
00063 }
00064
00065 virtual std::string typeName() const {
00066 return "Odometry";
00067 }
00068
00082 void move_func(const vec & _x, const vec & _u, const vec & _n,
00083 const double _dt, vec & _xnew, mat & _XNEW_x, mat & _XNEW_u, unsigned tempSet = 0) const;
00084
00085 bool move(double time);
00086
00087 void init_func(const vec & _x, const vec & _u, vec & _xnew);
00088
00089 static size_t size() {
00090 return 7;
00091 }
00092
00093 static size_t size_control() {
00094 return 6;
00095 }
00096
00097 static size_t size_perturbation() {
00098 return 6;
00099 }
00100 virtual size_t mySize() {
00101 return size();
00102 }
00103 virtual size_t mySize_control() {
00104 return size_control();
00105 }
00106 virtual size_t mySize_perturbation() {
00107 return size_perturbation();
00108 }
00109
00110 virtual void writeLogHeader(kernel::DataLogger& log) const;
00111 virtual void writeLogData(kernel::DataLogger& log) const;
00112
00113
00114 protected:
00123 template<class Vx, class Vp, class Vq>
00124 inline void splitState(const Vx x, Vp & p, Vq & q) const {
00125 p = ublas::subrange(x, 0, 3);
00126 q = ublas::subrange(x, 3, 7);
00127 }
00128
00137 template<class Vp, class Vq, class Vx>
00138 inline void unsplitState(const Vp & p, const Vq & q, Vx & x) const {
00139 ublas::subrange(x, 0, 3) = p;
00140 ublas::subrange(x, 3, 7) = q;
00141 }
00142
00150 template<class Vu, class V>
00151 inline void splitControl(Vu & u, V & dx, V & dv) const {
00152 dx = project(u, ublas::range(0, 3));
00153 dv = project(u, ublas::range(3, 6));
00154 }
00155
00156 private:
00157
00158 struct TempVariables
00159 {
00160 mat33 PNEW_dx;
00161 mat43 QDV_dv;
00162 mat44 QNEW_qdv;
00163 mat43 QNEW_dv;
00164 mat44 QNEW_q;
00165 };
00166 mutable TempVariables tempvars0, tempvars1;
00167 };
00168 }
00169 }
00170
00171 #endif