使用robot_pose_ekf融合odom和imu数据
$rosdep install robot_pose_ekf 自动安装该ros包的依赖。在运行该命令时,报错:找不到工作空间路径,需要把路径永久加入环境变量中。
$roscd robot_pose_ekf ; $rosmake ; $cd catkin_ws/ ;$catkin_make 编译包
由于只是用odom话题和imu话题,可以选择三种方式处理数据。对rosbag进行过滤:$rosbag filter input.bag output.bag “topic == ‘/imu/data’ or topic == ‘/odom’;或者用命令行进行remap:$rosbag play input.bag /odom2:=/odom /imu/data:=/imu_data;或在launch文件中。robot_pose_ekf处理输入后,输出/odom_combined。
运行robot_pose_ekf节点,$rostopic echo /odom_combined 发现没有message产生,$rosrun robot_pose_ekf wtf.py 发现receive no /odom message。解决思路:在odom_estimation_node.cpp中把消息名改为你的rosbag包发布的里程计的消息名,然后在odom中添加协方差矩阵。(因为robot_pose_ekf所用的扩展卡尔曼滤波需要分别提供对应的协方差,在工程实践中,只需确保odom的协方差矩阵对角元素不均为0就能工作。通过搜索how do i compute the covariance matrix of an orientation sensor?)。另外,用ekf做融合,改善的是有旋转后的表现,前进方向做不了改良。