没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
3页
本篇为组合导航扩展卡尔曼滤波 C++ 代码实现。 注:本例所用传感器有激光雷达传感器,雷达传感器 /*扩展卡尔曼滤波器*/ #include #include #include #include #include #include #include #include #define ROWS 1224 #define COLS 8 using namespace std; using namespace Eigen; int main(){ // ******************************导入数据**************************************
资源推荐
资源详情
资源评论
扩展卡尔曼滤波扩展卡尔曼滤波——非线性非线性EKF-C++
本篇为组合导航扩展卡尔曼滤波 C++ 代码实现。
注:本例所用传感器有激光雷达传感器,雷达传感器
/*扩展卡尔曼滤波器*/
#include
#include
#include
#include
#include
#include
#include
#include
#define ROWS 1224
#define COLS 8
using namespace std;
using namespace Eigen;
int main(){
// ******************************导入数据**************************************
clock_t start, stop;
double duration; //记录被测函数运行时间,以s为单位
start = clock(); //开始计时
ifstream inFile("data1.csv", ios::in);
string lineStr;
vector<vector> strArray;
vector<vector> array(ROWS, vector(COLS));
int i, j;
i = 0;
char* end;
if (inFile.fail()) {
std::cout << "读取文件失败" << endl;
}
while (getline(inFile, lineStr)){
j = 0;
// 存成二维表结构
string str;
stringstream ss(lineStr);
vector lineArray;
// 按照逗号分隔
while (getline(ss, str, ',')){
//string -> float
array[i][j] = static_cast(strtod(str.c_str(), &end));
j++;
}
i++;
}
//输出数据保存到文本文件
ofstream fout("position1.txt");
// ******************************初始化**************************************
float delta_t = 0.1;
int u = 1;
//初始化状态
VectorXd x(4);
if (array[0][0] == 1){
x << array[0][1], array[0][2], 0, 0;
}
else{
x << array[0][1], array[0][2], array[0][3], 0;
}
//初始化状态协方差矩阵
MatrixXd P(4, 4);
P << 1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1000, 0,
0, 0, 0, 1000;
//状态转移矩阵
MatrixXd F(4, 4);
F << 1, 0, delta_t, 0,
0, 1, 0, delta_t,
0, 0, 1, 0,
0, 0, 0, 1;
//控制矩阵赋值
MatrixXd B(4, 1);
B << pow(delta_t, 2) / 2, pow(delta_t, 2) / 2,delta_t, delta_t;
//过程噪声矩阵
MatrixXd Q(4, 4);
Q << pow(delta_t, 2) / 4, 0, pow(delta_t, 3) / 2, 0,
0, pow(delta_t, 2) / 4, 0, pow(delta_t, 3) / 2,
pow(delta_t, 3) / 2, 0, pow(delta_t, 2), 0,
0, pow(delta_t, 3) / 2, 0, pow(delta_t, 2);
//Lidar传感器观测矩阵
MatrixXd H(2, 4);
H << 1, 0, 0, 0,
0, 1, 0, 0;
//Radar传感器量测噪声矩阵
MatrixXd R_R(3, 3);
R_R << 0.09, 0, 0,
0, 0.005, 0,
资源评论
- 忧伤的石一2023-07-24总的来说,这篇文章是一份非常实用和有价值的资料,值得更多人了解和参考。
- 呆呆美要暴富2023-07-24文章中提供了多种改进EKF-C的方法,让读者在实践中能够针对具体问题有所启发。
- 柔粟2023-07-24这篇文件对扩展卡尔曼滤波的描述非常详细,很容易理解。
- 玛卡库克2023-07-24作者对EKF-C的优点和局限性都进行了客观的分析,让我能够更好地评估它在实际问题中的适用性。
- 焦虑肇事者2023-07-24文中给出了丰富的例子和实际应用,让我对EKF-C有了更深刻的认识。
weixin_38638799
- 粉丝: 5
- 资源: 952
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 高性能量化工具 hikyuu 2.0.3 python3.9 ubuntu 安装包
- Cyclone Version 9.51
- 高性能量化回测工具 hikyuu 2.0.3 python 3.12 windows 安装包
- 省级城乡居民基本养老保险情况数据集(2010-2022年).xlsx
- 舞队填写版.cpp
- 基于BP神经网络的多输入单输出回归预测.zip
- 高性能量化回测工具 hikyuu 2.0.3 python 3.9 windows 安装包
- 省级城镇职工基本养老保险情况2000-2022年.xlsx
- 高性能量化回测工具 hikyuu 2.0.3 python 3.10 windows 安装包
- 算法部署-使用OpenVINO+C#部署PaddleOCR字符识别算法-项目源码-优质项目实战.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功