视觉-惯导多传感器融合(2)IMU 原始数据处理

 视觉-惯导多传感器融合(1)IMU & ROS_Techblog of HaoWANG-CSDN博客IMU,全称inertial measurement unit,即惯性测量单元,主要用于测量自身位姿,位姿包含位置和姿态。https://haowang.blog.csdn.net/article/details/121249997

目录

1.  数据采集

2. 数据回放

3. 滤波去噪

4. 绘制曲线



 

 


1.  数据采集

     使用ROS工具‘rosbag’录制IMU数据至本地文件, ROS launch 文件: 

<!--imu ros 驱动 & IMU topic 数据记录-->
<launch>
  <arg name="record_zed" default="true" />
  <arg name="record_imu" default="true" />

  <!-- imu型号,默认 a9 -->
  <arg name="imu_type" default="a9" doc="model type [a9, b9, b6 ,d6]"/>

  <!-- imu 对应 python 文件 -->
  <node pkg="handsfree_ros_imu" type="hfi_$(arg imu_type)_ros.py" name="imu" output="screen">
  </node>

  <!-- Launch rosbag to recore handsfree data -->
  <node pkg="rosbag" type="record" name="rosbag_record_handsfree"
        args="record -O  /home/jetson/records/handsfree/ros_a9_imu_record /handsfree/imu"
        if="$(arg record_imu)" />

  <!-- Launch rosbag to recore ZED2 sensor data -->
  <node pkg="rosbag" type="record" name="rosbag_record_zed2"
        args="record -O  /home/jetson/records/zed2/zed2_records /zed2/zed_node/imu/data"
        if="$(arg record_zed)" />

</launch>

2. 数据回放

使用Plotjuggler回放.bag文件,绘制图像示例:

 

1. 三轴线加速度、

 2.三轴角速度、

 3.三轴角度  

 


3. 滤波去噪

 将ros bag 文件格式转换成.csv格式或者excel格式,便于后续处理

rostopic echo -b ros_bag_records.bag - p/zed2/zed_node/imu/data > imu_data.csv

 导出文件后使用MATLAB工具做快速的数据平滑处理与可视化:

clc;clear;

imu_raw = xlsread('imu_data20211117.xlsx');%读取excel数据,同目录下

linear_acc_x = imu_raw(:,1);  %第1列为里程数据,单位m
linear_acc_y = imu_raw(:,2);  %第1列为里程数据,单位m
linear_acc_z = imu_raw(:,3);  %第1列为里程数据,单位m

% 中值滤波, 滑窗200
mdfilter_acc_x = medfilt1(linear_acc_x,200);
% 均值滤波,利用移动平均法做平滑处理
box_acc_x = smooth(linear_acc_x,200);
box_acc_y = smooth(linear_acc_y,200);
box_acc_z = smooth(linear_acc_z,200);

%利用lowess方法y做平滑处理
lowess_acc_x=smooth(linear_acc_x,100,'lowess'); 
figure;
hold on;
plot(box_acc_x,'-');
result = [box_acc_x, box_acc_y, box_acc_z];
xlswrite('acc_x_y_z.xlsx', result);   
% plot(lowess_acc_x,'-');
% plot(mdfilter_acc_x,'-');
% plot(linear_acc_x,'-');

 


4. 绘制曲线

1. 原始带噪声数据:IMU样本数据点80,000个,采样率400Hz

 2. 中值滤波去噪平滑:滑动窗口200

噪声去除明显,感兴趣的加速度波形已经初具规模,但是仍有一部分尖峰,且峰峰值较大

 3. 均值滤波:滑窗200

数据有一定程度失真

 4. 利用lowess方法y做平滑处理

加速度波形合理,失真较小

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Techblog of HaoWANG

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值