ORB-SLAM3配置

https://github.com/UZ-SLAMLab/ORB_SLAM3

https://github.com/shanpenghui/ORB_SLAM3_Fixed

EVO Evaluation of SLAM 4 --- ORB-SLAM3 编译和利用数据集运行_一个摩羯座的程序猿 的 知识笔记-CSDN博客_orb_slam3数据集

1.ROS Melodic安装

Wiki

采用国内源:

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

#Set up your keys 官方Key有问题的时候
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 sudo apt update
sudo apt install ros-melodic-desktop-full echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo apt install python-rosdep #sudo rosdep init出错
sudo chmod 777 /etc
mkdir -p /etc/ros/rosdep/sources.list.d
gedit 20-default.list #############################################
#填入一下内容
# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx # generic
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte # newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
#############################################

2.Pangolin安装

https://github.com/stevenlovegrove/Pangolin

#安装依赖项:
sudo apt-get install libglew-dev
sudo apt-get install libpython2.7-dev
sudo apt-get install libxkbcommon-dev
sudo apt-get install wayland-protocols #先转到一个要存储Pangolin的路径下,例如~/Documents,然后
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
mkdir build
cd build
cmake ..
make –j8
sudo make install

报错WARNING: Target "pango_python" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it. CMake does not define behavior for this case.

#the error is due to the high c++ standard and you can add
set_property(TARGET ${COMPONENT} PROPERTY CXX_STANDARD 11)
#in the ~/Pangolin/compnents/pango_image/CMakeList.txt under the
get_filename_component(COMPONENT ${CMAKE_CURRENT_LIST_DIR} NAME)

3.安装Eigen3

1.直接安装
sudo apt-get install libeigen3-dev
2.官网(http://eigen.tuxfamily.org/index.php?title=Main_Page)下载最新源码包
mkdir build
cd build
cmake ..
make -j8
sudo make install Eigen头文件的默认位置在 “usr/include/eigen3”
如果不确定,可以通过以下命令查找
sudo updatedb
locate eigen3

4.安装opencv4.4

OpenCV4.4.0 安装测试 Installation & Examination (Ubuntu18.04, Ubuntu 20.04)

# If you don't have cmake:
# sudo apt-get install cmake
sudo apt-get install libswscale-dev libtiff5-dev libgtk2.0-dev pkg-config
sudo apt install build-essential
sudo apt install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt install libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
# If need to support python3:
# sudo apt install python3-dev python3-numpy
# If need ffmpeg:
sudo apt install ffmpeg #报错安装
sudo apt-get install gtk+-3.0 #生成 Makefile
cd opencv-4.4.0
weget "https://codeload.github.com/opencv/opencv_contrib/zip/4.4.0"
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_GENERATE_PKGCONFIG=ON -D OPENCV_ENABLE_NONFREE=ON -D OPENCV_EXTRA_MODULES_PATH=/home/mr-mmm/SLAM/opencv-4.4.0/opencv_contrib-4.4.0/modules/ -D BUILD_opencv_world=YES -D BUILD_opencv_python2=OFF -D BUILD_opencv_python3=OFF -D WITH_OPENGL=ON -D WITH_EIGEN=ON -D BUILD_EXAMPLES=ON -D BUILD_DOCS=ON .. #编译安装
make -j8
sudo make install #环境配置
sudo gedit /etc/ld.so.conf.d/opencv4.conf
#将以下内容写入文件
# libc default configuration
/usr/local/lib #更新配置
sudo ldconfig sudo gedit /etc/bash.bashrc
# Add in the end
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH #更新配置
source /etc/bash.bashrc
sudo updatedb #测试Opencv安装
pkg-config --modversion opencv4

报错E: Unable to locate package libjasper-dev

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev

5.Building ORB-SLAM3 library and examples

git clone https://github.com/UZ-SLAMLab/ORB_SLAM3.git ORB_SLAM3
cd ORB_SLAM3
chmod +x build.sh
./build.sh

6.ROS Examples

gedit ~/.bashrc
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/ORB_SLAM3/Examples/ROS chmod +x build_ros.sh
./build_ros.sh

报错1:fatal error: sophus/se3.hpp: No such file or directory #include <sophus/se3.hpp>

git clone https://github.com/strasdat/Sophus.git
cd Sophus/ mkdir build
cd build
cmake ..
make
sudo make install

报错2:error: conversion from ‘Sophus::SE3f {aka Sophus::SE3}’ to non-scalar type ‘cv::Mat’ requested

error: no matching function for call to ‘std::vectorcv::Mat::push_back(Eigen::Vector3f)’

error: conversion from ‘Eigen::Vector3f {aka Eigen::Matrix<float, 3, 1>}’ to non-scalar type ‘cv::Mat’ requested

https://github.com/UZ-SLAMLab/ORB_SLAM3/issues/442

报错3:error: ‘eigen2cv’ is not a member of ‘cv’

https://github.com/UZ-SLAMLab/ORB_SLAM3/issues/479

注释掉cmakelist中关于AR的部分解决问题

# Node for monocular camera (Augmented Reality Demo)
#rosbuild_add_executable(MonoAR
#src/AR/ros_mono_ar.cc
#src/AR/ViewerAR.h
#src/AR/ViewerAR.cc
#) #target_link_libraries(MonoAR
#${LIBS}
#)

报错4 rosrun ORB_SLAM3 Mono Vocabulary/ORBvoc.txt Examples/ROS/ORB_SLAM3/Asus.yaml

/home/mr-mmm/SLAM/ORB_SLAM3/Examples/ROS/ORB_SLAM3/Mono: error while loading shared libraries: libDBoW2.so: cannot open shared object file: No such file or directory

error while loading shared libraries - ROS Answers: Open Source Q&A Forum

*.so 移动到 /usr/lib/ 解决问题

报错5"Aborted (core dumped)" when running Ros example

run Mono_Inertial Segmentation fault (core dumped)

https://github.com/UZ-SLAMLab/ORB_SLAM3/issues/333

7. ROS运行测试

#setp01
roscore #step02
rosbag play Datasets/MH_01_easy.bag /cam0/image_raw:=/camera/image_raw /imu0:=/imu #step03
rosrun ORB_SLAM3 Mono_Inertial Vocabulary/ORBvoc.txt Examples/Monocular-Inertial/EuRoC.yaml

ORB_SLAM3 + ROS采坑实录(从零开始的毕设生活第一弹)的更多相关文章

  1. Cloudera Manager 5.9 和 CDH 5.9 离线安装指南及个人采坑填坑记

    公司的CDH早就装好了,一直想自己装一个玩玩,最近组了台电脑,笔记本就淘汰下来了,加上之前的,一共3台,就在X宝上买了CPU和内存升级了下笔记本,就自己组了个集群. 话说,好想去捡垃圾,捡台8核16线 ...

  2. 后端路由项目由 gulp 改为 webpack 的踩坑实录

    前言 公司有个后端路由的项目是用 gulp 作为前端自动化构建工具,最近学习了一下 webpack,深感其强大,一狠心将其改成了 webpack 构建,以下是踩坑实录. gulp 先来说说原来的架构. ...

  3. JAVA实用案例之文件导出(JasperReport踩坑实录)

    写在最前面 想想来新公司也快五个月了,恍惚一瞬间. 翻了翻博客,因为太忙,也有将近五个多月没认真总结过了. 正好趁着今天老婆出门团建的机会,记录下最近这段时间遇到的大坑-JasperReport. 六 ...

  4. angular采坑记录

    在angular中会遇到一些莫名的问题,导致不能完成想要的功能,可能是某项用法使用错误,或许是angular相对应不支持,或者是我们功力根本就没有达到.为了在每次采坑之后能有所收获,再遇到时能理解其根 ...

  5. 分布式改造剧集之Redis缓存采坑记

    Redis缓存采坑记 ​ 前言 ​ 这个其实应该属于分布式改造剧集中的一集(第一集见前面博客:http://www.cnblogs.com/Kidezyq/p/8748961.html),本来按照顺序 ...

  6. 采坑:python base64

    需求:  读取文本内容,对字符串进行base64加密 >>> str = 'aaaaaaaaaaaaaaaaaaa\nbbbbbbbbbbbbbbbbbbbbbbbbbbb\nccc ...

  7. Hadoop环境搭建--Docker完全分布式部署Hadoop环境(菜鸟采坑吐血整理)

    系统:Centos 7,内核版本3.10 本文介绍如何从0利用Docker搭建Hadoop环境,制作的镜像文件已经分享,也可以直接使用制作好的镜像文件. 一.宿主机准备工作 0.宿主机(Centos7 ...

  8. Spring Cloud Config采坑记

    1. Spring Cloud Config采坑记 1.1. 问题 在本地运行没问题,本地客户端服务能连上本地服务端服务,可一旦上线,发现本地连不上线上的服务 服务端添加security登录加密,客户 ...

  9. rabbitmq在ios中实战采坑

    1. rabbitmq在ios中实战采坑 1.1. 问题 ios使用rabbitmq连接,没过多久就断开,并报错.且用android做相同的步骤并不会报错,错误如下 Received connecti ...

随机推荐

  1. BestCoder Round #66 (div.2)B GTW likes gt

    思路:一个O(n)O(n)的做法.我们发现b_1,b_2,...,b_xb​1​​,b​2​​,...,b​x​​都加11就相当于b_{x+1},b_{x+2},...,b_nb​x+1​​,b​x+ ...

  2. Kernel PCA for Novelty Detection

    目录 引 主要内容 的选择 数值实验 矩形框 spiral 代码 Hoffmann H. Kernel PCA for novelty detection[J]. Pattern Recognitio ...

  3. [opencv]三通道图像反色

    1.用纯白图像-原图 Mat img = imread(path); imshow("src", img); waitKey(); Mat white = cv::Mat(250, ...

  4. Android物联网应用程序开发(智慧园区)—— 登录界面开发

    效果: 布局代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:an ...

  5. 【SpringBoot】No 'Access-Control-Allow-Origin' header is present on the requested resource.

    关键字:跨域,Access-Control-Allow-Origin,转码,解码 在做一个前后端分离项目,本来前端项目都可以正常访问后端接口,跨域是这么设置的,接口可以正常访问 @Configurat ...

  6. Arrays.sort实现原理

    Collections.sort方法底层就是调用的array.sort方法 比较器的方式 TimSort static void sort(Object[] a, int lo, int hi, Ob ...

  7. Linux sudo 找不到命令

    普通用户执行需要root权限的命令,提示"找不到命令",但是root用户执行该命令不报错,可能是由于该命令未处在sudo搜索的路径. 本文以sudo easy_install 为例 ...

  8. Go语言系列之标准库ioutil

    ioutil标准库中提供了一些常用.方便的IO操作函数 一.相关方法 func ReadAll(r io.Reader) ([]byte, error) func ReadDir(dirname st ...

  9. nuxt中报window is not defined

    1.如果是引用插件报错的话,原因是在服务端渲染时找不到window,这样在插件引入位置把ssr设置为false即可. plugins: [ { src: '@/plugins/iview', ssr: ...

  10. 查询 MySQL 字段注释的 5 种方法!

    很多场景下,我们需要查看 MySQL 中表注释,或者是某张表下所有字段的注释,所以本文就来盘点和对比一下查询注释的几种方式. 创建测试数据库 开始之前咱们先创建一个数据库,以备下面演示使用. -- 如 ...