- Timestamp:
- 04/12/11 22:31:34 (14 years ago)
- Location:
- library/bdm/estim
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/kalman.cpp
r1312 r1328 494 494 } 495 495 D(i) = sigma; 496 if (D(i)>(1<<17)) D(i)=(1<<17); 496 497 /////////////// !!!!!!!!!!!!! 497 if (D(i) > 1579000) D(i) =1579000;498 498 499 499 for (j=0;j<i;j++){ … … 515 515 } 516 516 } 517 517 518 518 if ( log_level[logU] ){ 519 // transformed U 520 mat tU; 521 mat P= U*diag(D)*U.T(); 522 523 vec xref; 524 if (dim==4){ 525 xref.set_length(4); 526 xref(0)= 30.0*1.4142 *4.; 527 xref(1)= 30.0*1.4142 *4.; 528 xref(2)= 6.283185*200.*4.; 529 xref(3) = 3.141593; 530 //xref(4) = 34.0; 531 }else{ 532 xref.set_length(2); 533 xref(0)= 6.283185*200.*4.; 534 xref(1) = 3.141593; 535 536 } 519 //vec tmp=vec(U._data(),dimension()*dimension()); 520 log_level.store(logU, vec(U._data(),dimension()*dimension())); 537 521 538 mat T = diag(1.0/(xref)); 539 mat Pf = T*P*T; 522 log_level.store(logD, D); 540 523 541 mat TQT = T*Q*T; 542 543 ldmat Pld(Pf); 544 545 //vec tmp=vec(U._data(),dimension()*dimension()); 546 vec tmp=vec(Pld._L()._data(),dimension()*dimension()); 547 log_level.store(logU,round(((int)1<<15)*tmp)); 548 vec vPf(Pf._data(),Pf._datasize()); 549 log_level.store(logP,round(((int)1<<15)*vPf)); 550 log_level.store(logD,(Pld._D()*(1<<15))); 551 552 mat Atr=T*A*diag(xref)*(1<<15); 553 mat Att=Atr.T(); 554 vec vA(Att._data(), dimension()*dimension()); 555 log_level.store(logA,vA); 524 log_level.store(logA, vec(A._data(), dimension()*dimension())); 525 526 log_level.store(logC, vec(C._data(), dimension()*dimensiony())); 556 527 557 528 } 558 529 if ( log_level[logG] ){ 559 vec tmp=vec(G._data(),dimension()*dimension()); 560 log_level.store(logG,tmp); 530 log_level.store(logG,vec(G._data(),dimension()*dimension())); 561 531 } 562 532 //cout << "Ut: " << U << endl; … … 596 566 597 567 } 568 569 // artificial round of U 570 U = round(U*(1<<15))/(1<<15); 598 571 599 572 ///// -
library/bdm/estim/kalman.h
r1308 r1328 430 430 protected: 431 431 //! logger 432 LOG_LEVEL(EKF_UD,logU, logG, logD,logA,logP );432 LOG_LEVEL(EKF_UD,logU, logG, logD,logA,logP,logC); 433 433 //! Internal Model f(x,u) 434 434 shared_ptr<diffbifn> pfxu; … … 481 481 if ( log_level[logD] ) 482 482 L.add_vector ( log_level, logD, RV ( dimension()), prefix ); 483 if ( log_level[logC] ) 484 L.add_vector ( log_level, logC, RV ( dimension()*dimensiony()), prefix ); 483 485 484 486 L.add_vector ( log_level, logA, RV ( dimension()*dimension()), prefix );