博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Bayes++ Library入门学习之熟悉UKF相关类
阅读量:5018 次
发布时间:2019-06-12

本文共 4144 字,大约阅读时间需要 13 分钟。

  UKF-SLAM是一种比较流行SLAM方案。相比EKF-SLAM,UKF利用unscented transform代替了EKF的线性化趋近,因而具有更高的精度。Bayes++库中的unsFlt.hpp中给出了UKF实现的相关类。

       

namespace Bayesian_filter   39 {   40    41 class Unscented_predict_model : public Predict_model_base   42 /* Specific Unscented prediction model for Additive noise   43  *  x(k|k-1) = f(x(k-1|k-1)) + w(x(k))   44  *   45  * Unscented filter requires   46  *  f the function part of the non-linear model   47  *  Q the covariance of the additive w(x(k)), w is specifically allow to be a function of state   48  */   49 {   50 public:   51     Unscented_predict_model (std::size_t q_size)   52     {   53         q_unscented = q_size;   54     }   55    56     virtual const FM::Vec& f(const FM::Vec& x) const = 0;   57     // Functional part of additive model   58     // Note: Reference return value as a speed optimisation, MUST be copied by caller.   59    60     virtual const FM::SymMatrix& Q(const FM::Vec& x) const = 0;   61     // Covariance of additive noise   62     // Note: Reference return value as a speed optimisation, MUST be copied by caller.   63 private:   64     friend class Unscented_filter;  // Filter implementation need to know noise size   65     std::size_t q_unscented;   66 };   67    68    69 class Unscented_scheme : public Linrz_kalman_filter, public Functional_filter   70 {   71 private:   72     std::size_t q_max;          // Maximum size allocated for noise model, constructed before XX   73 public:   74     FM::ColMatrix XX;       // Unscented form of state, with associated Kappa   75     Float kappa;   76    77     Unscented_scheme (std::size_t x_size, std::size_t z_initialsize = 0);   78     Unscented_scheme& operator= (const Unscented_scheme&);   79     // Optimise copy assignment to only copy filter state   80    81     void init ();   82     void init_XX ();   83     void update ();   84     void update_XX (Float kappa);   85    86     void predict (Unscented_predict_model& f);   87     // Efficient Unscented prediction    88     void predict (Functional_predict_model& f);   89     void predict (Additive_predict_model& f);   90     Float predict (Linrz_predict_model& f)   91     {   // Adapt to use the more general additive model   92         predict(static_cast
(f)); 93 return 1.; // Always well condition for additive predict 94 } 95 96 Float observe (Uncorrelated_additive_observe_model& h, const FM::Vec& z); 97 Float observe (Correlated_additive_observe_model& h, const FM::Vec& z); 98 // Unscented filter implements general additive observe models 99 100 Float observe (Linrz_uncorrelated_observe_model& h, const FM::Vec& z) 101 { // Adapt to use the more general additive model 102 return observe (static_cast
(h),z); 103 } 104 Float observe (Linrz_correlated_observe_model& h, const FM::Vec& z) 105 { // Adapt to use the more general additive model 106 return observe (static_cast
(h),z); 107 } 108 109 public: // Exposed Numerical Results 110 FM::Vec s; // Innovation 111 FM::SymMatrix S, SI; // Innovation Covariance and Inverse 112 113 protected: 114 virtual Float predict_Kappa (std::size_t size) const; 115 virtual Float observe_Kappa (std::size_t size) const; 116 /* Unscented Kappa values 117 default uses the rule which minimise mean squared error of 4th order term 118 */ 119 120 protected: // allow fast operation if z_size remains constant 121 std::size_t last_z_size; 122 void observe_size (std::size_t z_size); 123 124 private: 125 void unscented (FM::ColMatrix& XX, const FM::Vec& x, const FM::SymMatrix& X, Float scale); 126 /* Determine Unscented points for a distribution */ 127 std::size_t x_size; 128 std::size_t XX_size; // 2*x_size+1 129 130 protected: // Permanently allocated temps 131 FM::ColMatrix fXX; 132 }; 133 134 135 }//namespace 136 #endif

 

转载于:https://www.cnblogs.com/freshmen/p/6009520.html

你可能感兴趣的文章
&&、||、?:、,四个运算符的求值顺序
查看>>
实验三
查看>>
SQL联合查询
查看>>
《Linux命令行与shell脚本编程大全 第3版》创建实用的脚本---06
查看>>
《Linux命令行与shell脚本编程大全 第3版》Linux命令行---14
查看>>
Linux下内存泄漏工具
查看>>
msp430入门编程23
查看>>
RBAC简介
查看>>
微信表情代码
查看>>
(E2E_L2)GOMfcTemplate在vs2017上的运行并融合Dnn模块
查看>>
[BTS] Error Can't update assemblies.
查看>>
JavaScript的变量作用域
查看>>
jmeter - DBC Request之Query Type
查看>>
sprinvmvc整合swagger实现实时接口信息展示
查看>>
20180124现货黄金操作总结
查看>>
emui4.0高仿其他系统主题
查看>>
ets
查看>>
thinkphp 3.2 完全开发手册地址
查看>>
第十次!
查看>>
Codeforces Round #112 (Div. 2) D. Beard Graph
查看>>