- Timestamp:
- 08/27/10 17:05:55 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/pmsm/simulator_zdenek/ekf_example/ekf_obj.cpp
r384 r1168 8 8 9 9 /////////////// 10 void EKFfixed::bayes(const vec &dt){ 11 ekf(dt(2),dt(3),dt(0),dt(1)); 10 void EKFfixed::bayes(const vec &yt, const vec &ut){ 11 ekf(yt(0),yt(1),ut(0),ut(1)); 12 12 13 vec xhat(4); 13 14 //UGLY HACK!!! reliance on a predictor!! … … 15 16 xhat(1)=zprevod(x_est[1],Qm)*Iref; 16 17 xhat(2)=zprevod(x_est[2],Qm)*Wref; 17 xhat(3)=zprevod(x_est[3],15) ;18 xhat(3)=zprevod(x_est[3],15)*Thetaref; 18 19 19 20 E.set_mu(xhat); … … 33 34 double* Pp=Pfull._data(); 34 35 for(int i=0;i<16;i++){*(Pp++) = zprevod(P_est[i],15);} 36 37 E._R()._M()=Pfull; 38 35 39 36 40 BM::ll = -0.5* ( 4 * 1.83787706640935 +log ( det ( Pfull ) ) +xdif* ( inv(Pfull)*xdif ) );