GCOP  1.0
insgps.h
Go to the documentation of this file.
00001 #ifndef GCOP_INSGPS_H
00002 #define GCOP_INSGPS_H
00003 
00004 #include <Eigen/Dense>
00005 #include "sensor.h"
00006 #include "ins.h"
00007 
00008 namespace gcop {
00009   
00010   using namespace Eigen;
00011 
00012   //  typedef Insgps<6> FullInsgps;
00013   //  typedef Insgps<3> AccInsgps;
00014   
00023   template<int _nu = 6, int _np = Dynamic>
00024   class InsGps : public Sensor<InsState, 15, _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, 15> Matrix3x15d;
00032     typedef Matrix<double, 3, _nu> Matrixrcd;
00033     typedef Matrix<double, 3, _np> Matrixrmd;
00034   
00035   InsGps();
00036 
00037   bool operator()(Vector3d &y, double t, const InsState &x, const Vectorcd &u,
00038                   const Vectormd *p = 0, 
00039                   Matrix3x15d *dydx = 0, Matrixrcd *dydu = 0,
00040                   Matrixrmd *dydp = 0) {
00041     
00042     //    y.template head<3>() = x.first.transpose()*a0 - ba;
00043     y = x.p;
00044     
00045     if (dydx){
00046       dydx->block<3,3>(0,9).setIdentity();
00047     }
00048     
00049     return true;    
00050   }
00051   
00052   double sxy;   
00053   double sz;    
00054   };
00055   
00056   template<int _nu, int _np> 
00057   InsGps<_nu, _np>::InsGps() : 
00058   Sensor<InsState, 15, _nu, _np, Vector3d, 3>(Rn<3>::Instance()) {    
00059     
00060     sxy = 3;
00061     sz = 10;
00062     
00063     this->R(0,0) = sxy*sxy;
00064     this->R(1,1) = sxy*sxy;
00065     this->R(2,2) = sz*sz;
00066   }
00067 }
00068 
00069 #endif