资源简介
老外写的一些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程序
相关资源
- VC++获取系统信息/获取OS/获取MAC/获取
- VC++五子棋程序源码VC6.0控制台下运行
- VC++编写USB接口通信程序
- vc++ tcp 客户端和服务器端
- 参考资料\\C++获取MP3文件信息.doc
- 简单的停车场收费 c++
- JPEG图片EXIF信息提取及缩略图显示VC
- shell.rar,一个用c++实现的具有基本完
- VS2010 C++配色方案 主题
- Qt-C++实现文件浏览器
- c++ MFC实现文件合成器功能,实现多种
- 图书管理系统C++65062
- c++ 记事本 源码
- c++头文件大全,很全哦,
- PCA和KPCA的Matlab和C++程序
- MFC中的多线程同步
- 山东科技大学C++数据库课程设计源代
- c++做的仪表盘非常逼真哦
- c++ 连接sql server 数据库代码
- 缓冲池的模拟(C++)
- c++版的连连看解释很详细
- 激光雷达数据读取、显示、分割、直
- 旅游管理系统 C++ SQL
- Exceptional C++(中文版).侯捷-侯老师的
- C++实现获取win7系统端口号IP状态和P
- C++编程规范_101条规则、准则与最佳实
- C++学校人员信息管理系统课程设计.
- 学生作业完成情况管理系统C++含报告
- mysql封装.zip
- 诊所信息管理系统.cpp
评论
共有 条评论