GCOP
1.0
|
00001 #ifndef GCOP_POINT3DGPS_H 00002 #define GCOP_POINT3DGPS_H 00003 00004 #include <Eigen/Dense> 00005 #include "sensor.h" 00006 #include "point3d.h" 00007 00008 namespace gcop { 00009 00010 using namespace Eigen; 00011 00012 // typedef Point3dgps<6> FullPoint3dgps; 00013 // typedef Point3dgps<3> AccPoint3dgps; 00014 00023 template<int _nu = 3, int _np = Dynamic> 00024 class Point3dGps : public Sensor<Point3dState, 6, _nu, _np, Vector3d, 3> { 00025 00026 public: 00027 00028 typedef Matrix<double, _nu, 1> Vectorcd; 00029 typedef Matrix<double, _np, 1> Vectormd; 00030 00031 typedef Matrix<double, 3, 6> Matrix36d; 00032 typedef Matrix<double, 3, _nu> Matrixrcd; 00033 typedef Matrix<double, 3, _np> Matrixrmd; 00034 00035 Point3dGps(): Sensor<Point3dState, 6, _nu, _np, Vector3d, 3>(Rn<3>::Instance()) { 00036 00037 sxy = .02; 00038 sz = .02; 00039 00040 this->R(0,0) = sxy*sxy; 00041 this->R(1,1) = sxy*sxy; 00042 this->R(2,2) = sz*sz; 00043 } 00044 00045 00046 bool operator()(Vector3d &y, double t, const Point3dState &x, const Vectorcd &u, 00047 const Vectormd *p = 0, 00048 Matrix36d *dydx = 0, Matrixrcd *dydu = 0, 00049 Matrixrmd *dydp = 0) { 00050 00051 y = x.q; //#TODO Sample the sensor output from a gaussian distribution of x.q and this->R 00052 00053 if (dydx){ 00054 dydx->topLeftCorner<3,3>().setIdentity(); 00055 } 00056 00057 return true; 00058 } 00059 00060 double sxy; 00061 double sz; 00062 }; 00063 00064 00065 // Point3dGps::Point3dGps() : 00066 } 00067 00068 #endif