[VIO|实践]UBUNTU16.04 跑基于ROS的OKVIS代码

不知道为毛,我的错误超级多,,,,快疯了,,挥泪,,,纪录一下,,,

环境配置

sudo apt-get install ros-kinetic-pcl-ros
sudo apt-get install libgoogle-glog-dev
sudo apt-get install libatlas-base-dev libeigen3-dev libsuitesparse-dev 
sudo apt-get install libopencv-dev libboost-dev libboost-filesystem-dev
  git clone https://github.com/ethz-asl/libvisensor.git
  cd libvisensor
  ./install_libvisensor.sh

编译

  1. 新建文件夹okvis-catkin_ws,里面再建一个叫src的文件夹,然后把解压好的代码集okvis_ros放进去。
  2. 命令行进入到/okvis-catkin_ws这一层,进行catkin_make
  3. 开启ros的工作空间,就是source devel/setup.bash

具体命令:
src下:

wget https://www.doc.ic.ac.uk/~sleutene/software/okvis_ros-1.1.3.zip
unzip okvis_ros-1.1.3.zip

okvis-catkin_ws工作区根目录中键入

catkin_make

令 人 崩 溃 的 错 误 来 了 ! ! ! ! ! ! ! \red{令人崩溃的错误来了!!!!!!!}
出现问题1:

Could not find a package configuration file provided by “cv_bridge”
with any of the following names:

cv_bridgeConfig.cmake
cv_bridge-config.cmake

解决办法:

  1. 下载vision_opencv
git clone https://github.com/ros-perception/vision_opencv.git
  1. 将里面的cv_bridge包拿出来,放到工作空间src中,重新编译:
catkin_make --pkg cv_bridge

又出错:

CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677
(message): Unable to find the requested Boost libraries.

Boost version: 1.58.0

Boost include path: /usr/include

Could not find the following Boost libraries:

      boost_python37

No Boost libraries were found. You may need to set BOOST_LIBRARYDIR
to the directory containing Boost libraries or BOOST_ROOT to the
location of Boost.

解决办法:

  1. 安装boost库:https://blog.csdn.net/zym1348010959/article/details/87821713
  2. 修改CMakeLists.txt文件
    删除掉第12行:find_package(Boost REQUIRED python37),修改为:
set(boost_DIR /home/ouc/install/boost_1_69_0)

后面是你安装的boost库所在路径。

出现问题2:

Could not find a package configuration file provided by
“image_geometry” with any of the following names:

image_geometryConfig.cmake
image_geometry-config.cmake

Add the installation prefix of “image_geometry” to CMAKE_PREFIX_PATH
or set “image_geometry_DIR” to a directory containing one of the
above files. If “image_geometry” provides a separate development
package or SDK, be sure it has been installed. Call Stack (most
recent call first): okvis_ros/CMakeLists.txt:5 (find_package)

解决办法:
安装。。。

sudo apt-get install ros-kinetic-image-geometry

终极版解决办法:ROS工作空间编译的时候出现类似于Could_not_find_a_package_configuration_file _provided _by该如何解决
最可能原因在于:装好ROS(kinetic),但是是moveit包没装。我执行了以下命令,分别安装了moveit包、gazebo控制器包:

sudo apt-get install ros-kinetic-moveit
sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control

再次提示错误 ceres-solver链接无法连接:
将安装包okvis-catkin_ws/src/okvis_ros/okvis/CMakeLists.txt的151行链接修改为:

GIT_REPOSITORY https://github.com/ceres-solver/ceres-solver.git 

O K 了 , , , , , 再 不 成 功 都 快 疯 了 , , , , \red{OK了,,,,,再不成功都快疯了,,,,} OK

再次在okvis-catkin_ws空间键入:

catkin_make
source devel/setup.bash

终 于 没 有 问 题 了 。 。 。 。 。 。 \red{终于没有问题了。。。。。。}

运行

开三个终端:
1.

roscore
  1. 按照自己的安装路径,在okvis-catkin_ws下:
rosrun okvis_ros okvis_node_synchronous path/to/okvis_ros/okvis/config/config_fpga_p2_euroc.yaml path/to/MH_01_easy/

我的是:

rosrun okvis_ros okvis_node_synchronous /home/ouc/okvis-catkin_ws/src/okvis_ros/okvis/config/config_fpga_p2_euroc.yaml /home/ouc/dataset/MH_05_difficult.bag
  1. rviz可视化工具
    在rviz.rviz路径下(我的是~/okvis-catkin_ws/src/okvis_ros/config)输入:
rosrun rviz rviz -d rviz.rviz

试验结果


我还是更适合去种地的,,,,,,

你可能感兴趣的:(VIO实践)