Revision 289, 1.0 kB
(checked in by smidl, 15 years ago)
|
missing files
|
Line | |
---|
1 | |
---|
2 | /*! |
---|
3 | \file |
---|
4 | \brief UserInfo for Kalman filters and extensions |
---|
5 | \author Vaclav Smidl. |
---|
6 | |
---|
7 | ----------------------------------- |
---|
8 | BDM++ - C++ library for Bayesian Decision Making under Uncertainty |
---|
9 | |
---|
10 | Using IT++ for numerical operations |
---|
11 | ----------------------------------- |
---|
12 | */ |
---|
13 | |
---|
14 | #include "libKF.h" |
---|
15 | #include <uibuilder.h> |
---|
16 | |
---|
17 | class UIEKF: public UIbuilder { |
---|
18 | public: |
---|
19 | UIEKF():UIbuilder("EKF"){}; |
---|
20 | bdmroot* build ( Setting &S ) const { |
---|
21 | diffbifn* IM; UIbuild(S["IM"],IM); |
---|
22 | diffbifn* OM; UIbuild(S["OM"],OM); |
---|
23 | |
---|
24 | //parameters |
---|
25 | EKFCh* E; E=new EKFCh; |
---|
26 | E->set_parameters(IM, OM, diag(getvec(S["dQ"])), diag(getvec(S["dR"]))); |
---|
27 | |
---|
28 | //statistics |
---|
29 | int dim=IM->dimension(); |
---|
30 | vec mu0; |
---|
31 | mat P0; |
---|
32 | if (S.exists("mu0")){mu0=getvec(S["mu0"]);}else{mu0=zeros(dim);}; |
---|
33 | if (S.exists("P0")){mu0=getmat(S["P0"],dim);}else{P0=eye(dim);}; |
---|
34 | E->set_statistics(mu0,P0); |
---|
35 | |
---|
36 | //connect |
---|
37 | RV* drv; UIbuild(S["drv"],drv); |
---|
38 | E->set_drv(*drv); |
---|
39 | RV* rv; UIbuild(S["rv"],rv); |
---|
40 | E->set_rv(*rv); |
---|
41 | return E; |
---|
42 | } |
---|
43 | }; |
---|
44 | UIREGISTER ( UIEKF ); |
---|
45 | |
---|