前面我们已经熟悉了Bayesian_filter::Bayes_filter_base和其子类的击继承关系,接下来我们开始学习该类的实现。

bayesFlt.hpp文件为其实现主体,首先是两个常规的头文件,一个是异常处理类型相关的,另一个是支持矩阵的头文件。

#include "bayesException.hpp"   // exception types
#include "matSupSub.hpp" // matrix support subsystem

接着,所有的声明和定义全部都在namespace Bayseian_filter内部。在Bayes++库中,一般将Bayesian_filter_matrix以别名的形式使用

namespace FM = Bayesian_filter_matrix;

接着定义了一个抽象预测模型,该预测模型用来参数化滤波器中的预测函数

class Predict_model_base : public Bayes_base
{
// Empty
};

高斯预测模型,x(k|k-1) = x(k-1|k-1)) + G(k)w(k),其中q(k)是状态噪声协方差,即w(k)的协方差,G(k)表示状态噪声耦合

class Gaussian_predict_model : virtual public Predict_model_base
{
public:
Gaussian_predict_model (std::size_t x_size, std::size_t q_size); FM::Vec q; // Noise variance (always dense, use coupling to represent sparseness)
FM::Matrix G; // Noise Coupling Numerical_rcond rclimit;
// Reciprocal condition number limit of linear components when factorised or inverted
};

  线性化预测模型,x(k|k-1) = f(x(k-1|k-1),Fx(x(k-1|k-1)表示函数fx相对于状态x的雅各比矩阵

class Linrz_predict_model : public Additive_predict_model
{
public:
Linrz_predict_model (std::size_t x_size, std::size_t q_size);
FM::Matrix Fx; // Model
};

  抽象量测模型,量测模型被用来参数化滤波器的量测函数

class Observe_model_base : public Bayes_base
{
// Empty
};

  Kalman状态滤波器,线性滤波器被表示成均值和协方差两个元素;概率性分布用状态向量x和协方差矩阵X表示。一般状态x的size假设为常量,

class Kalman_state_filter : public State_filter
{
public:
FM::SymMatrix X; // state covariance Kalman_state_filter (std::size_t x_size);
/* Initialise filter and set constant sizes
*/ /* Virtual functions for filter algorithm */ virtual void init () = ;
/* Initialise from current state and state covariance
Requires x(k|k), X(k|k)
*/
void init_kalman (const FM::Vec& x, const FM::SymMatrix& X);
/* Initialise from a state and state covariance
Parameters that reference the instance's x and X members are valid
*/
virtual void update () = ;
/* Update filters state and state covariance
Updates x(k|k), X(k|k)
*/ // Minimum allowable reciprocal condition number for PD Matrix factorisations
Numerical_rcond rclimit;
};

  线性化滤波器模型,其中滤波器预测步骤使用了Linrz_predict_model来获取一个雅各比矩阵Fx和添加的噪声

class Linrz_filter : virtual public Bayes_filter_base
{
public:
/* Virtual functions for filter algorithm */ virtual Float predict (Linrz_predict_model& f) = ;
/* Predict state using a Linrz model
Requires x(k|k), X(k|k) or internal equivilent
Returns: Reciprocal condition number of primary matrix used in predict computation (1. if none)
*/ virtual Float observe (Linrz_uncorrelated_observe_model& h, const FM::Vec& z) = ;
virtual Float observe (Linrz_correlated_observe_model& h, const FM::Vec& z) = ;
/* Observation z(k) and with (Un)correlated observation noise model
Requires x(k|k), X(k|k) or internal equivalent
Returns: Reciprocal condition number of primary matrix used in observe computation (1. if none)
*/
};

  EKF的量测的实现使用了量测模型的非线性部分和线性化量测模型的线性部分得到

class Extended_kalman_filter : public Linrz_kalman_filter
{
protected:
Extended_kalman_filter() : Kalman_state_filter() // define a default constructor
{}
public:
virtual Float observe (Linrz_uncorrelated_observe_model& h, const FM::Vec& z);
virtual Float observe (Linrz_correlated_observe_model& h, const FM::Vec& z);
/* Observation z(k) and with (Un)correlated observation noise model
Requires x(k|k), X(k|k) or internal equivalent
Returns: Reciprocal condition number of primary matrix used in observe computation (1. if none)
Default implementation simple computes innovation for observe_innovation
*/ virtual Float observe_innovation (Linrz_uncorrelated_observe_model& h, const FM::Vec& s) = ;
virtual Float observe_innovation (Linrz_correlated_observe_model& h, const FM::Vec& s) = ;
/* Observation innovation s(k) and with (Un)correlated observation noise model
Requires x(k|k), X(k|k) or internal equivalent
Returns: Reciprocal condition number of primary matrix used in observe computation (1. if none)
*/
};

  至此,我们将常用的几个模型基类进行了简单的说明。

Bayes++ Library入门学习之熟悉class-Bayesian_filter_base(2)的更多相关文章

  1. Bayes++ Library入门学习之熟悉class-Bayesian_filter_base(1)

    在对Bayes++库的名称空间有了一个大概的了解之后,我们开始学习该名称空间下的第一个子类Bayesian_filter::Bayes_filter_base. 该类与其子类的继承关系图如下图所示. ...

  2. Bayes++ Library入门学习之熟悉UKF相关类

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

  3. Bayes++ Library入门学习之熟悉namespace

    Bayes++是一个开源的C++类库.这些类表示并实现了用于离散系统的贝叶斯滤波的各种数值算法.该库中的类提供测试和一致的数值方法,并且用层次明确的结构表明了各种滤波算法和系统模型类型. 接下来,我们 ...

  4. Bayes++ Library入门学习之熟悉class-Importance_resampler

    接下来,需要介绍的是重要性重采样类Bayesian_filter::Improtance_resampler.该类实现了两种重采样方法[1][2],和其子类的继承关系图如下: 其中Standard_r ...

  5. OpenCV入门学习笔记

    OpenCV入门学习笔记 参照OpenCV中文论坛相关文档(http://www.opencv.org.cn/) 一.简介 OpenCV(Open Source Computer Vision),开源 ...

  6. SCARA——OpenGL入门学习一、二

    参考博客:http://www.cppblog.com/doing5552/archive/2009/01/08/71532.html 简介 最近开始一个机械手臂的安装调试,平面关节型机器人又称SCA ...

  7. opengl入门学习

    OpenGL入门学习 说起编程作图,大概还有很多人想起TC的#include <graphics.h>吧? 但是各位是否想过,那些画面绚丽的PC游戏是如何编写出来的?就靠TC那可怜的640 ...

  8. 转 iOS Core Animation 动画 入门学习(一)基础

    iOS Core Animation 动画 入门学习(一)基础 reference:https://developer.apple.com/library/ios/documentation/Coco ...

  9. Aho-Corasick算法、多模正则匹配、Snort入门学习

    希望解决的问题 . 在一些高流量.高IO的WAF中,是如何对规则库(POST.GET)中的字符串进行多正则匹配的,是单条轮询执行,还是多模式并发执行 . Snort是怎么组织.匹配高达上千条的正则规则 ...

随机推荐

  1. Android Parcelable vs Serializable

    序列化 在Android中.对象在实现序列化之前是无法直接作为Intent參数在Activity之间传递的. Android中对象序列化能够通过实现Serializable接口或者实现Parcelab ...

  2. c语言中类型转换与赋值运算符、算术运算符、关系运算符、逻辑运算符。原码、反码、补码。小解。

    类型转换 自动转换 小范围的类型能够自动转换成大范围的类型.short->int->long->float->double 强制类型转换 (类型名)变量或数值 #include ...

  3. sql server 无法创建索引 因为对象名称和索引名称重复

    需求分析:如下图所示,给T_DD_OP1200_Final表的Id字段添加主键,保存时弹出 “T_DD_OP1200_Final”表- 无法创建索引“PK_T_DD_OP1200_Final”. 因为 ...

  4. inkscape

    最近的论文需要把latex公式放到图里,于是想起了装了之后一直没怎么用的inkscape.因为visio貌似没法直接贴latex格式的公式. 找了几个用法: http://blog.sciencene ...

  5. ing在写作中到底怎么用

    改关静留的作业中我还得改英文摘要.于是有个地方用了ing.顺便查了一下. http://www.yygrammar.com/Article/201408/3677.html -ing分词用作状语时有九 ...

  6. 3ds Max灯光教程之卧室灯光布局实例

    对于设计师来说要做好一张好的作品效果图包括很多比如:“造型.色彩搭配.灯光气氛.构图角度等等,上次给大家详细的分析了下产品渲染中摄像机的构图及原理.本期教程来跟大家讨论一下max场景灯光布局问题.以卧 ...

  7. H5页面在线制作工具搜集

    1.初页 http://chuye.cloud7.com.cn/ 2.易企秀 http://eqxiu.com/#/home 3.最酷 http://www.zuiku.com/ 4.易传单 http ...

  8. Java中hashCode与equal方法详解

    转载自http://blog.csdn.net/jiangwei0910410003/article/details/22739953 Java中的equals方法和hashCode方法是Object ...

  9. 为什么不能往Android的Application对象里存储数据

    在一个App里面总有一些数据需要在多个地方用到.这些数据可能是一个 session token,一次费时计算的结果等.通常为了避免activity之间传递对象的开销 ,这些数据一般都会保存到持久化存储 ...

  10. Max Points on a Line(直线上最多的点数)

    给定一个二维平面,平面上有 n 个点,求最多有多少个点在同一条直线上. 示例 1: 输入: [[1,1],[2,2],[3,3]] 输出: 3 解释: ^ | |        o |     o | ...