资源简介
老外写的一些UKF相关的C++代码 对需要UKF编程的人有帮助, 学习卡尔曼滤波技术的最佳材料,易懂易看利于快速进行二次开发

代码片段和文件信息
/*
* Kalman filter for Flying Fox
*
* from paparazzi autopilot
* also by Zik Saleeba 2008-04-05
*/
#include
#include
#include “FreeRTOS.h“
#include “kalman.h“
#include “matrix.h“
/*
* ukf_filter_new
*/
ukf_filter
ukf_filter_new(unsigned int state_dim
unsigned int measure_dim
double *Q
double *R
filter_function ffun
measure_function mfun) {
ukf_filter filter;
int Size;
unsigned err = 0;
// nothing to do if no state or measurement !
if(state_dim == 0 || measure_dim == 0)
return 0;
// alloc new structure
filter = pvPortMalloc(sizeof(struct ukf_filter_t));
// returns 0 if allocation fails
if(filter == 0)
return 0;
// fills the structure
filter->state_dim = state_dim;
filter->measure_dim = measure_dim;
filter->ffun = ffun;
filter->mfun = mfun;
filter->x = pvPortMalloc(state_dim * sizeof(double));
err |= (filter->x == 0);
filter->y = pvPortMalloc(measure_dim * sizeof(double));
err |= (filter->y == 0);
Size = state_dim * state_dim;
filter->P = pvPortMalloc(Size * sizeof(double));
err |= (filter->P == 0);
Size = 2 * state_dim + 1;
filter->wm = pvPortMalloc(Size * sizeof(double));
err |= (filter->wm == 0);
filter->wc = pvPortMalloc(Size * sizeof(double));
err |= (filter->wc == 0);
filter->sigma_point = pvPortMalloc(Size * state_dim * sizeof(double));
err |= (filter->sigma_point == 0);
Size = filter->state_dim;
filter->sigma = pvPortMalloc(Size * sizeof(double));
err |= (filter->sigma == 0);
filter->PM = pvPortMalloc(Size * Size * sizeof(double));
err |= (filter->PM == 0);
filter->PM_save = pvPortMalloc(Size * Size * sizeof(double));
err |= (filter->PM == 0);
filter->xm = pvPortMalloc(Size * sizeof(double));
err |= (filter->xm == 0);
filter->ym = pvPortMalloc(filter->measure_dim * sizeof(double));
err |= (filter->ym == 0);
Size = 2 * filter->state_dim + 1;
filter->khi = pvPortMalloc(Size * filter->state_dim * sizeof(double));
err |= (filter->khi == 0);
filter->khi_y = pvPortMalloc(Size * filter->measure_dim * sizeof(double));
err |= (filter->khi_y == 0);
Size = filter->measure_dim;
filter->Pyy = pvPortMalloc(Size * Size * sizeof(double));
err |= (filter->Pyy == 0);
filter->Pxy = pvPortMalloc(Size * filter->state_dim * sizeof(double));
err |= (filter->Pxy == 0);
filter->dx = pvPortMalloc(filter->state_dim * sizeof(double));
err |= (filter->dx == 0);
filter->
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 12285 2009-09-26 09:51 UKFC源码\1\kalman.c
文件 3460 2009-09-26 09:48 UKFC源码\1\kalman.h
文件 2391 2009-09-26 09:55 UKFC源码\1\matrix.c
文件 1417 2009-09-26 09:57 UKFC源码\1\matrix.h
目录 0 2009-09-27 09:11 UKFC源码\1
文件 3854 2009-09-26 10:36 UKFC源码\2\unscent kalman filter.cpp
文件 2816 2009-09-26 10:42 UKFC源码\2\unscent kalman filter.h
文件 47615 2009-09-26 11:12 UKFC源码\2\unscent kalman filter__2.cpp
文件 6684 2009-09-26 11:14 UKFC源码\2\unscent kalman filter__2.h
目录 0 2009-09-27 10:36 UKFC源码\2
目录 0 2009-09-27 09:11 UKFC源码
----------- --------- ---------- ----- ----
80522 11
- 上一篇:eig.cpp
- 下一篇:纯C语言的串口YModem程序
相关资源
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
- VC++基于OpenGL模拟的一个3维空间模型
评论
共有 条评论