⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bayesflt_8hpp-source.html

📁 Bayes滤波器算法C++类说明文档,源码见Bayes滤波器算法
💻 HTML
📖 第 1 页 / 共 5 页
字号:
00381 <span class="keyword">private</span>:00382     <span class="keyword">mutable</span> FM::Vec hx;00383 };00384 <a name="l00385"></a><a class="code" href="classBayesian__filter_1_1Linear__uncorrelated__observe__model.html">00385</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Linear__uncorrelated__observe__model.html">Linear_uncorrelated_observe_model</a> : <span class="keyword">public</span> <a class="code" href="classBayesian__filter_1_1Linrz__uncorrelated__observe__model.html">Linrz_uncorrelated_observe_model</a>00386 <span class="comment">/* Linear observation model, uncorrelated observation noise</span>00387 <span class="comment">    zp(k) = Hx(k) * x(k|k-1)</span>00388 <span class="comment">    Enforces linear model invariant. Careful when deriving to to change this invariant!</span>00389 <span class="comment"> */</span>00390 {00391 <span class="keyword">public</span>:<a name="l00392"></a><a class="code" href="classBayesian__filter_1_1Linear__uncorrelated__observe__model.html#a0">00392</a>     <a class="code" href="classBayesian__filter_1_1Linear__uncorrelated__observe__model.html#a0">Linear_uncorrelated_observe_model</a> (size_t x_size, size_t z_size) :00393         <a class="code" href="classBayesian__filter_1_1Linrz__uncorrelated__observe__model.html">Linrz_uncorrelated_observe_model</a>(x_size, z_size), hx(z_size)00394     {}<a name="l00395"></a><a class="code" href="classBayesian__filter_1_1Linear__uncorrelated__observe__model.html#a1">00395</a>     <span class="keyword">const</span> FM::Vec&amp; <a class="code" href="classBayesian__filter_1_1Linear__uncorrelated__observe__model.html#a1">h</a>(<span class="keyword">const</span> FM::Vec&amp; x)<span class="keyword"> const</span>00396 <span class="keyword">    </span>{   <span class="comment">// Provide a linear implementation of functional h assumes model is already Linrz for Hx</span>00397         hx.assign (FM::prod(<a class="code" href="classBayesian__filter_1_1Jacobian__observe__model.html#o0">Hx</a>,x));00398         <span class="keywordflow">return</span> hx;00399     }00400 <span class="keyword">private</span>:00401     <span class="keyword">mutable</span> FM::Vec hx;00402 };00403 00404 00405 <span class="comment">/*</span>00406 <span class="comment"> * Bayesian Filter</span>00407 <span class="comment"> *</span>00408 <span class="comment"> * A Bayesian Filter uses Bayes rule to fuse the state probabilities</span>00409 <span class="comment"> * of a prior and a likelhood function</span>00410 <span class="comment"> */</span><a name="l00411"></a><a class="code" href="classBayesian__filter_1_1Bayes__filter__base.html">00411</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Bayes__filter__base.html">Bayes_filter_base</a> : <span class="keyword">public</span> <a class="code" href="classBayesian__filter_1_1Bayes__base.html">Bayes_base</a>00412 {00413     <span class="comment">// Empty</span>00414 };00415 00416 <span class="comment">/*</span>00417 <span class="comment"> * Likelihood Filter - Abstract filtering property</span>00418 <span class="comment"> * Represents only the Bayesian Likelihood of a state observation</span>00419 <span class="comment"> */</span><a name="l00420"></a><a class="code" href="classBayesian__filter_1_1Likelihood__filter.html">00420</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Likelihood__filter.html">Likelihood_filter</a> : <span class="keyword">virtual</span> <span class="keyword">public</span> <a class="code" href="classBayesian__filter_1_1Bayes__filter__base.html">Bayes_filter_base</a>00421 {00422 <span class="keyword">public</span>:00423     <span class="comment">/* Virtual functions for filter algorithm */</span>00424 00425     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Likelihood__filter.html#a0">observe</a> (<a class="code" href="classBayesian__filter_1_1Likelihood__observe__model.html">Likelihood_observe_model</a>&amp; h, <span class="keyword">const</span> FM::Vec&amp; z) = 0;00426     <span class="comment">/* Observation state posterior using likelihood model h at z</span>00427 <span class="comment">    */</span>00428 };00429 00430 <span class="comment">/*</span>00431 <span class="comment"> * Functional Filter - Abstract filtering property</span>00432 <span class="comment"> * Represents only filter predict by a simple functional</span>00433 <span class="comment"> * (non-stochastic) model</span>00434 <span class="comment"> * </span>00435 <span class="comment"> * A similar functional observe is not generally useful. The inverse of h is needed for observe!</span>00436 <span class="comment"> */</span><a name="l00437"></a><a class="code" href="classBayesian__filter_1_1Functional__filter.html">00437</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Functional__filter.html">Functional_filter</a> : <span class="keyword">virtual</span> <span class="keyword">public</span> <a class="code" href="classBayesian__filter_1_1Bayes__filter__base.html">Bayes_filter_base</a>00438 {00439 <span class="keyword">public</span>:00440     <span class="comment">/* Virtual functions for filter algorithm */</span>00441 00442     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Functional__filter.html#a0">predict</a> (<a class="code" href="classBayesian__filter_1_1Functional__predict__model.html">Functional_predict_model</a>&amp; f) = 0;00443     <span class="comment">/* Predict state with functional no noise model</span>00444 <span class="comment">        Requires x(k|k), X(k|k) or internal equivilent</span>00445 <span class="comment">        Predicts x(k+1|k), X(k+1|k), using predict model</span>00446 <span class="comment">    */</span>00447 };00448 00449 <span class="comment">/*</span>00450 <span class="comment"> * State Filter - Abstract filtering property</span>00451 <span class="comment"> * Represents only filter state and an update on that state</span>00452 <span class="comment"> */</span><a name="l00453"></a><a class="code" href="classBayesian__filter_1_1State__filter.html">00453</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1State__filter.html">State_filter</a> : <span class="keyword">virtual</span> <span class="keyword">public</span> <a class="code" href="classBayesian__filter_1_1Bayes__filter__base.html">Bayes_filter_base</a>00454 {00455 <span class="keyword">public</span>:00456     <a class="code" href="classBayesian__filter_1_1State__filter.html#a0">State_filter</a> (size_t x_size);00457     <span class="comment">/* Set constant sizes, state must not be empty (must be &gt;=1)</span>00458 <span class="comment">        Exceptions:</span>00459 <span class="comment">         bayes_filter_exception is x_size &lt; 1</span>00460 <span class="comment">     */</span>00461 <a name="l00462"></a><a class="code" href="classBayesian__filter_1_1State__filter.html#o0">00462</a>     FM::Vec <a class="code" href="classBayesian__filter_1_1State__filter.html#o0">x</a>;          <span class="comment">// expected state</span>00463 00464     <span class="comment">/* Virtual functions for filter algorithm */</span>00465 00466     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1State__filter.html#a1">update</a> () = 0;00467     <span class="comment">/* Update filters state</span>00468 <span class="comment">        Updates x(k|k)</span>00469 <span class="comment">    */</span>00470 };00471 00472 00473 <span class="comment">/*</span>00474 <span class="comment"> * Kalman State Filter - Abstract filtering property</span>00475 <span class="comment"> * Linear filter representation for 1st (mean) and 2nd (covariance) moments of a distribution</span>00476 <span class="comment"> *</span>00477 <span class="comment"> * Probability distributions are represted by state vector (x) and a covariance matix.(X)</span>00478 <span class="comment"> *</span>00479 <span class="comment"> * State (x) sizes is assumed to remain constant.</span>00480 <span class="comment"> * The state and state covariance are public so they can be directly manipulated.</span>00481 <span class="comment"> *  init: Should be called if x or X are altered</span>00482 <span class="comment"> *  update: Guarantees that any internal changes made filter are reflected in x,X.</span>00483 <span class="comment"> *  This allows considerable flexibility so filter implemtations can use different numerical representations</span>00484 <span class="comment"> *</span>00485 <span class="comment"> * Derived filters supply definititions for the abstract functions and determine the algorithm used</span>00486 <span class="comment"> * to implement the filter.</span>00487 <span class="comment"> */</span>00488 <a name="l00489"></a><a class="code" href="classBayesian__filter_1_1Kalman__state__filter.html">00489</a> <span class="keyword">class </span><a class="code" href="classBayesian__filter_1_1Kalman__state__filter.html">Kalman_state_filter</a> : <span class="keyword">public</span> <a class="code" href="classBayesian__filter_1_1State__filter.html">State_filter</a>00490 {00491 <span class="keyword">public</span>:<a name="l00492"></a><a class="code" href="classBayesian__filter_1_1Kalman__state__filter.html#o0">00492</a>     FM::SymMatrix <a class="code" href="classBayesian__filter_1_1Kalman__state__filter.html#o0">X</a>;    <span class="comment">// state covariance</span>00493 00494     <a class="code" href="classBayesian__filter_1_1Kalman__state__filter.html#a0">Kalman_state_filter</a> (size_t x_size);00495     <span class="comment">/* Initialise filter and set constant sizes</span>00496 <span class="comment">     */</span>00497 00498     <span class="comment">/* Virtual functions for filter algorithm */</span>00499 00500     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Kalman__state__filter.html#a1">init</a> () = 0;00501     <span class="comment">/* Initialise from current state and state covariance</span>00502 <span class="comment">        Requires x(k|k), X(k|k)</span>00503 <span class="comment">    */</span>00504     <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Kalman__state__filter.html#a2">init_kalman</a> (<span class="keyword">const</span> FM::Vec&amp; x, <span class="keyword">const</span> FM::SymMatrix&amp; X);00505     <span class="comment">/* Initialise from a state and state covariance</span>00506 <span class="comment">        Parameters that reference the instance's x and X members are valid</span>00507 <span class="comment">    */</span>00508     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classBayesian__filter_1_1Kalman__state__filter.html#a3">update</a> () = 0;00509     <span class="comment">/* Update filters state and state covariance </span>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -