/*! \file \brief Multi-Estimator (developped for PMSM) */ #include "base/user_info.h" #include "base/loggers.h" #include "estim/kalman.h" #include "pmsmDS.h" #include "filters.h" #include "base/datasources.h" using namespace bdm; int main ( int argc, char* argv[] ) { const char *fname; if ( argc>1 ) {fname = argv[1]; } else { cout << "Missing configuration file.\n Usage: \n $> estimator config_file.cfg"< L = UI::build ( F, "logger" ); shared_ptr pDS = UI::build ( F, "system" ); Array > Es; // array of estimators UI::get( Es, F, "estimator" ); int nE = Es.length(); //number of estimators int Ndat; //number of data records F.lookupValue ( "experiment.ndat",Ndat ); pDS->log_register ( *L, "true" ); string Ename; for (int i=0; ilog_register(*L,Ename); // estimate } L->init(); vec dt=zeros ( pDS->_drv()._dsize() ); //data variable Array Dls(nE); for (int i=0; i_drv(),pDS->_drv() ); //datalink between a datasource and estimator } // Main cycle for ( int tK=1;tKstep(); // simulator step pDS->getdata ( dt ); // read data pDS->log_write (); // Estimators for (int i=0; ibayes ( Dls(i)->pushdown ( dt ) ); // update estimates Es(i)->log_write (); } // Regulators L->step(); } L->finalize(); for (int i=0; i