自动驾驶系列(2)精度评估EVO使用

本文介绍了如何通过pip安装和升级EVO工具,包括evo_traj用于轨迹处理和evo_ape计算绝对位姿误差。详细步骤涉及ROSbag数据订阅、位姿数据保存以及使用EVO评估KITTI数据集的过程。
摘要由CSDN通过智能技术生成

一、安装evo

pip install evo --upgrade --no-binary evo --user

检查
在这里插入图片描述

二、使用evo

2.1evo_traj: 主要是用来画轨迹、输出轨迹文件、转换数据格式等功能

//针对 bag 文件 使用 evo_traj 命令
evo_traj  bag文件  话题名1 话题名2 ....  话题名n  [参数]
evo_traj bag data_pose_2020-07-25-17-19-16.bag /odom  /amcl_pose  -p
//针对 kitti、tum、euroc 格式 使用 evo_traj 命令
evo_traj tum --ref=gt.txt 1.txt 2.txt 3.txt  -a  -p  --save_plot  ./output.pdf


2.2evo_ape: 计算绝对位姿误差

命令语法:命令 格式 参考轨迹 估计轨迹 [可选项]

evo_ape kitti ground_truth.txt laser_odom.txt -r full --plot --plot_mode xyz

三、EVO评估KITTI数据集

3.1bag数据订阅

(1)bag话题查询
rosbag info
在这里插入图片描述
(2)订阅相关话题

ros::Subscriber subLaserCloud = nh.subscribe<sensor_msgs::PointCloud2>("/points_raw", 100, laserCloudHandler);

3.2保存轨迹

将机器人的位姿数据(全局坐标系)写入一个文件中。实现原理是将机器人当前的位姿数据(odomAftMapped.pose.pose)

	std::ofstream pose1("/home/zengmiao/code/odom_evo/ALOAM.txt", std::ios::app);
	pose1.setf(std::ios::scientific, std::ios::floatfield);
	//设置输出浮点数的精度为6位。
	pose1.precision(6);

	pose1 << odomAftMapped.header.stamp << " "
	<< odomAftMapped.pose.pose.position.x << " "
	<< odomAftMapped.pose.pose.position.y << " "
	<< odomAftMapped.pose.pose.position.z << " "
	<< odomAftMapped.pose.pose.orientation.x << " "
	<< odomAftMapped.pose.pose.orientation.y << " "
	<< odomAftMapped.pose.pose.orientation.z << " "
	<< odomAftMapped.pose.pose.orientation.w << std::endl;
	pose1.close();

3.3评估轨迹

evo_traj tum --ref=LOAM1.txt LOAM2.txt LOAM3.txt --plot --plot_mode=xyz --align --correct_scale

在这里插入图片描述

在这里插入图片描述

  • 10
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值