当前位置: 首页 > news >正文

SVO编译

文章目录

  • 软件版本
  • 错误
  • 编译
  • 运行
    • 轨迹路径保存
    • 运行TUM数据集
  • 附录
    • 针对svo slam的/svo/pose_imu转为tum格式代码

软件版本

ubuntu 20
rosnoetic
SVO SLAM
虚拟机 windows 11

错误

  1. 常见的git clone问题可以使用DevSidecar解决,在 加速服务-基本设置-绑定IP 设置为0.0.0.0,虚拟机网络连接设置为桥接,之后在虚拟机中设置网络中的 Network Proxy,IP为WindowsIP地址,端口为DevSidecar代理端口。
  2. server certificate verification failed. CAfile: none CRLfile: none。参考CSDN博客
  3. Cloning into ‘dbow2_src’…ssh: connect to host github.com port 22: Connection timed out。参考CSDN博客
cd svo_ws/src
git clone https://github.com/dorian3d/DBoW2.git
tar -cvf DBoW2.tar DBoW2
# 修改svo_ws/src/dbow2_catkin/CMakeLists.txt
ExternalProject_Add(dbow2_srcGIT_REPOSITORY git@github.com:dorian3d/DBoW2.gitCMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CATKIN_DEVEL_PREFIX}BUILD_COMMAND CXXFLAGS=-i${CATKIN_DEVEL_PREFIX}/include makeINSTALL_COMMAND make install
) 
# 改为 XXXXXX为DBoW2.tar所在路径
ExternalProject_Add(dbow2_srcURL XXXXXX/DBoW2.tarCMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CATKIN_DEVEL_PREFIX}BUILD_COMMAND CXXFLAGS=-i${CATKIN_DEVEL_PREFIX}/include makeINSTALL_COMMAND make install
) 

编译

  创建工作空间,克隆代码

mkdir -p svo_ws/src && cd svo_ws/src
cd ..
catkin config --init --mkdirs --extend /opt/ros/noetic --cmake-args -DCMAKE_BUILD_TYPE=Release -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3
cd src
git clone https://github.com/uzh-rpg/rpg_svo_pro_open.git

  依赖下载

# 该步骤任选其一执行
# 1
vcs-import < ./rpg_svo_pro_open/dependencies.yaml
# 1 结束# 2
git clone https://github.com/catkin/catkin_simple.git &&\
git clone https://github.com/zurich-eye/cmake_external_project_catkin.git &&\
git clone https://github.com/ethz-asl/eigen_catkin.git &&\
git clone https://github.com/ethz-asl/eigen_checks.git &&\
git clone https://github.com/uzh-rpg/fast_neon.git &&\
git clone https://github.com/ethz-asl/gflags_catkin.git &&\
git clone https://github.com/ethz-asl/glog_catkin.git &&\
git clone https://github.com/ethz-asl/minkindr.git &&\
git clone https://github.com/ethz-asl/opengv.git &&\
git clone https://github.com/ethz-asl/minkindr_ros.git &&\
git clone https://github.com/ethz-asl/ceres_catkin.git &&\
git clone https://github.com/uzh-rpg/dbow2_catkin.git &&\
git clone https://github.com/uzh-rpg/rpg_trajectory_evaluation.git
# 2结束

  编译

touch minkindr/minkindr_python/CATKIN_IGNORE
cd rpg_svo_pro_open/svo_online_loopclosing/vocabularies && ./download_voc.sh
cd ../../..
catkin build

运行

  启动SVO核心ROS节点

source XXXXXX/devel/setup.bash
roslaunch svo_ros euroc_mono_frontend_imu.launch

  播放数据集

rosbag play  XXXXXX/DataSets/MH_01_easy.bag

  运行图片
SVO运行截图

轨迹路径保存

  svo轨迹数据通过 /svo/points 话题发布,该话题为visualization_msgs/Marker(中文参考)类型。旋转数据通过 /svo/pose_imu 发布,该话题为geometry_msgs/PoseWithCovarianceStamped(中文参考)类型。
  轨迹路径保存主要分为以下几步:

  1. 启动svo_ros
  2. 播放bag包,在开始后按下空格暂停
  3. 新开两个终端记录话题信息/svo/points和/svo/pose_imu
  4. 继续播放bag包
  5. 将/svo/pose_imu数据转化为
    进行轨迹对比时,使用tum格式进行对比。EUROC转tum命令如下
evo_traj euroc groundtruth.csv --save_as_tum

  /svo/pose_imu原始数据转化为tum格式代码见附录
  获取到真实轨迹与实际轨迹后进行对比,代码与结果如下(感觉结果有点不对,希望知道的人指出):data为真实轨迹,svo_result为ros结果

evo_traj tum data.tum svo_result.txt -p -s --align_origin -a --plot_mode=xyz --ref=data.tum

rpy
all
xyz

运行TUM数据集

待补充

附录

针对svo slam的/svo/pose_imu转为tum格式代码

in_file_path = "svo_pose_data.txt" 
out_file_path = "svo_result.txt" rfp = open(in_file_path)
wfp = open(out_file_path,"w")
file_end = False
while file_end != True:time = 0tx = 0ty = 0tz = 0qx = 0qy = 0qz = 0qw = 0for i in range(19):line = rfp.readline()if line == "":file_end = Truebreakif i == 3:time += float(line.split(":")[1])elif i == 4:time += float(line.split(":")[1])/1e9elif i == 9:tx = float(line.split(":")[1])elif i == 10:ty = float(line.split(":")[1])elif i == 11:tz = float(line.split(":")[1])elif i == 13:qx = float(line.split(":")[1])elif i == 14:qy = float(line.split(":")[1])elif i == 15:qz = float(line.split(":")[1])elif i == 16:qw = float(line.split(":")[1])else:passwrite_str = "{time} {tx} {ty} {tz} {qx} {qy} {qz} {qw}\n".format(time=time,tx=tx,ty=ty,tz=tz,qx=qx,qy=qy,qz=qz,qw=qw)# print(write_str)wfp.write(write_str)
rfp.close()
wfp.close()
print("保存完毕")
http://www.lryc.cn/news/283924.html

相关文章:

  • 探索未知:最新发布的顶级浏览器,为你带来前所未有的浏览体验
  • EasyX图形化学习(三)
  • git-生成证书、公钥、私钥、error setting certificate verify locations解决方法
  • 论文笔记(四十)Goal-Auxiliary Actor-Critic for 6D Robotic Grasping with Point Clouds
  • k8s学习-Deployment
  • Unity之四元数
  • 【计算机硬件】3、输入输出技术、总线结构
  • k8s的对外服务--ingress
  • CSS 雷达监测效果
  • C# System.MissingMethodException
  • Redis面试题23
  • Linux中的yum源仓库和NFS文件共享服务
  • 【LeetCode2744】最大字符串配对数目
  • 安全加速SCDN是什么
  • Android 布局菜鸟 android中的布局类型和特点?
  • 2023总结与2024寒假计划
  • 016-Vue-黑马2023:前后端分离开发(在线接口文档),前端工程化、Element、vue编写一个完成页面、Vue路由、vue打包部署到nginx
  • 如何给新华网投稿发稿?新华网的媒体发稿方法步骤
  • 为什么 macOS 比 Windows 稳定?
  • 从matlab的fig图像文件中提取数据
  • 基于网络爬虫的微博热点分析,包括文本分析和主题分析
  • 前端图片转base64 方法
  • Go语言数据结构(一)双向链表
  • 【MySql】MySQL 如何创建新用户
  • 【DFS】200.岛屿数量
  • Vue动态添加新的属性到实例上(vue的问题)
  • HarmonyOS应用开发者高级认证
  • 设计模式复盘
  • 电力能源三维可视化合集 | 图扑数字孪生
  • What is `@Repository` does?