编译Robust Stereo Visual Inertial Odometry for Fast Autonomous Flight记录帖子

前言

看到泡泡机器人今天推送的一篇文章:
Robust Stereo Visual Inertial Odometry for Fast Autonomous Flight
泡泡机器人推送链接:http://www.sohu.com/a/251757206_715754

自己还蛮感兴趣的,想要动手编译跑一下,不会写代码,好歹要会跑一些东西啊哈哈哈啊
github链接:https://github.com/KumarRobotics/msckf_vio

编译走起:

环境:Ubuntu16.04+ros Kinectic

Step1:

基本的依赖看起来还比较常规,都是Eigen, OpenCV, and Boost这些东西,
一看我都已经安装好了,按照readme走起:
执行:

catkin_make --pkg msckf_vio --cmake-args -DCMAKE_BUILD_TYPE=Release

出现报错(心里凉凉,吐槽一句,什么时候我可以一遍就过呢???):

Base path: /home/hri/catkin_ws
Source space: /home/hri/catkin_ws/src
Build space: /home/hri/catkin_ws/build
Devel space: /home/hri/catkin_ws/devel
Install space: /home/hri/catkin_ws/install
####
#### Running command: "cmake /home/hri/catkin_ws/src -DCMAKE_BUILD_TYPE=Release -DCATKIN_DEVEL_PREFIX=/home/hri/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/hri/catkin_ws/install -G Unix Makefiles" in "/home/hri/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/hri/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/hri/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/hri/catkin_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/hri/catkin_ws/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - msckf_vio
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'msckf_vio'
-- ==> add_subdirectory(msckf_vio)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
  Could not find a package configuration file provided by "pcl_conversions"
  with any of the following names:

    pcl_conversionsConfig.cmake
    pcl_conversions-config.cmake

  Add the installation prefix of "pcl_conversions" to CMAKE_PREFIX_PATH or
  set "pcl_conversions_DIR" to a directory containing one of the above files.
  If "pcl_conversions" provides a separate development package or SDK, be
  sure it has been installed.
Call Stack (most recent call first):
  msckf_vio/CMakeLists.txt:9 (find_package)


-- Could not find the required component 'pcl_conversions'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "pcl_conversions"
  with any of the following names:

    pcl_conversionsConfig.cmake
    pcl_conversions-config.cmake

  Add the installation prefix of "pcl_conversions" to CMAKE_PREFIX_PATH or
  set "pcl_conversions_DIR" to a directory containing one of the above files.
  If "pcl_conversions" provides a separate development package or SDK, be
  sure it has been installed.
Call Stack (most recent call first):
  msckf_vio/CMakeLists.txt:9 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/hri/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/hri/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

问题分析:

看起来是pcl的问题,所以我想到的是在CMakeListx.txt中添加pcl的东西!
采取措施:添加


set(pcl_DIR "/usr/include/pcl-1.7/" )
到CMakeLists.txt中


!!!上面的先放一放,我又发现了更可能的错误原因:
我看到上面报错里面有这么两句:

    pcl_conversionsConfig.cmake
    pcl_conversions-config.cmake

而且我又返回CMakeLists.txt文件中看了一下,find_package()里面有:

find_package(catkin REQUIRED COMPONENTS
  roscpp
  std_msgs
  tf
  nav_msgs
  sensor_msgs
  geometry_msgs
  eigen_conversions
  tf_conversions
  random_numbers
  message_generation
  nodelet
  image_transport
  cv_bridge
  message_filters
  pcl_conversions
  pcl_ros
  std_srvs
)

然后我在/opt/ros/kinectic/share/下面找了一下,除了
pcl_conversions和pcl_ros我都找得到,所以联想起来我昨天没有装cv_bridge的(cv_bridge的情况可以参考我之前的帖子ros的cv_bridge问题的解决办法)情况,果断装一下这两个东西:

// --执行:
sudo apt-get install ros-kinetic-pcl-conversions ros-kinetic-pcl-ros
// --然后
sudo apt-get update

然后重新尝试编译:

catkin_make --pkg msckf_vio --cmake-args -DCMAKE_BUILD_TYPE=Release

然后变异的过程如下(先说一下结果,果然成功啦~好久没有这么快就能编译通过的代码了,不对,我好像也没有编译过什么别的代码2333333,但就是开心啊哈哈哈!):

➜  catkin_ws catkin_make --pkg msckf_vio --cmake-args -DCMAKE_BUILD_TYPE=Release
Base path: /home/hri/catkin_ws
Source space: /home/hri/catkin_ws/src
Build space: /home/hri/catkin_ws/build
Devel space: /home/hri/catkin_ws/devel
Install space: /home/hri/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/hri/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/hri/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/hri/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/hri/catkin_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/hri/catkin_ws/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - msckf_vio
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'msckf_vio'
-- ==> add_subdirectory(msckf_vio)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.58.0
-- Found OpenCV: /usr/local/opencv3.2.0 (found suitable version "3.2.0", minimum required is "3.2.0") 
-- A library with BLAS API found.
-- Found AMD headers in: /usr/include/suitesparse
-- Found AMD library: /usr/lib/x86_64-linux-gnu/libamd.so
-- Found CAMD headers in: /usr/include/suitesparse
-- Found CAMD library: /usr/lib/x86_64-linux-gnu/libcamd.so
-- Found COLAMD headers in: /usr/include/suitesparse
-- Found COLAMD library: /usr/lib/x86_64-linux-gnu/libcolamd.so
-- Found CCOLAMD headers in: /usr/include/suitesparse
-- Found CCOLAMD library: /usr/lib/x86_64-linux-gnu/libccolamd.so
-- Found CHOLMOD headers in: /usr/include/suitesparse
-- Found CHOLMOD library: /usr/lib/x86_64-linux-gnu/libcholmod.so
-- Found SUITESPARSEQR headers in: /usr/include/suitesparse
-- Found SUITESPARSEQR library: /usr/lib/x86_64-linux-gnu/libspqr.so
-- Did not find Intel TBB library, assuming SuiteSparseQR was not compiled with TBB.
-- Found SUITESPARSE_CONFIG headers in: /usr/include/suitesparse
-- Found SUITESPARSE_CONFIG library: /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so
-- Found LIBRT library: /usr/lib/x86_64-linux-gnu/librt.so
-- Adding librt: /usr/lib/x86_64-linux-gnu/librt.so to SuiteSparse_config libraries (required on Linux & Unix [not OSX] if SuiteSparse is compiled with timing).
-- Did not find METIS library (optional SuiteSparse dependency)
-- Found SuiteSparse: TRUE (found version "4.4.6") 
-- msckf_vio: 3 messages, 0 services
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hri/catkin_ws/build
####
#### Running command: "make -j8 -l8" in "/home/hri/catkin_ws/build/msckf_vio"
####
Scanning dependencies of target _msckf_vio_generate_messages_check_deps_TrackingInfo
Scanning dependencies of target _msckf_vio_generate_messages_check_deps_CameraMeasurement
Scanning dependencies of target tf2_msgs_generate_messages_py
Scanning dependencies of target _msckf_vio_generate_messages_check_deps_FeatureMeasurement
Scanning dependencies of target actionlib_msgs_generate_messages_nodejs
Scanning dependencies of target std_msgs_generate_messages_cpp
Scanning dependencies of target topic_tools_generate_messages_py
Scanning dependencies of target nodelet_generate_messages_cpp
[  0%] Built target tf2_msgs_generate_messages_py
[  0%] Built target topic_tools_generate_messages_py
[  0%] Built target std_msgs_generate_messages_cpp
[  0%] Built target actionlib_msgs_generate_messages_nodejs
[  0%] Built target nodelet_generate_messages_cpp
Scanning dependencies of target actionlib_msgs_generate_messages_eus
Scanning dependencies of target actionlib_generate_messages_nodejs
Scanning dependencies of target actionlib_msgs_generate_messages_lisp
Scanning dependencies of target actionlib_generate_messages_lisp
Scanning dependencies of target sensor_msgs_generate_messages_eus
[  0%] Built target actionlib_msgs_generate_messages_lisp
[  0%] Built target actionlib_generate_messages_lisp
[  0%] Built target actionlib_msgs_generate_messages_eus
[  0%] Built target actionlib_generate_messages_nodejs
[  0%] Built target sensor_msgs_generate_messages_eus
Scanning dependencies of target actionlib_msgs_generate_messages_cpp
Scanning dependencies of target sensor_msgs_generate_messages_cpp
Scanning dependencies of target std_msgs_generate_messages_nodejs
Scanning dependencies of target nav_msgs_generate_messages_py
[  0%] Built target sensor_msgs_generate_messages_cpp
[  0%] Built target actionlib_msgs_generate_messages_cpp
Scanning dependencies of target std_msgs_generate_messages_py
[  0%] Built target std_msgs_generate_messages_nodejs
[  0%] Built target nav_msgs_generate_messages_py
[  0%] Built target _msckf_vio_generate_messages_check_deps_FeatureMeasurement
[  0%] Built target _msckf_vio_generate_messages_check_deps_TrackingInfo
Scanning dependencies of target tf2_msgs_generate_messages_lisp
Scanning dependencies of target rosgraph_msgs_generate_messages_eus
[  0%] Built target _msckf_vio_generate_messages_check_deps_CameraMeasurement
[  0%] Built target std_msgs_generate_messages_py
Scanning dependencies of target nav_msgs_generate_messages_cpp
Scanning dependencies of target rosgraph_msgs_generate_messages_nodejs
Scanning dependencies of target actionlib_msgs_generate_messages_py
[  0%] Built target tf2_msgs_generate_messages_lisp
Scanning dependencies of target geometry_msgs_generate_messages_nodejs
Scanning dependencies of target geometry_msgs_generate_messages_eus
[  0%] Built target rosgraph_msgs_generate_messages_eus
[  0%] Built target rosgraph_msgs_generate_messages_nodejs
[  0%] Built target actionlib_msgs_generate_messages_py
Scanning dependencies of target roscpp_generate_messages_cpp
[  0%] Built target nav_msgs_generate_messages_cpp
Scanning dependencies of target nodelet_generate_messages_py
[  0%] Built target geometry_msgs_generate_messages_nodejs
[  0%] Built target geometry_msgs_generate_messages_eus
Scanning dependencies of target tf2_msgs_generate_messages_cpp
[  0%] Built target roscpp_generate_messages_cpp
Scanning dependencies of target pcl_msgs_generate_messages_eus
Scanning dependencies of target rosgraph_msgs_generate_messages_cpp
Scanning dependencies of target roscpp_generate_messages_py
Scanning dependencies of target geometry_msgs_generate_messages_cpp
Scanning dependencies of target sensor_msgs_generate_messages_nodejs
[  0%] Built target nodelet_generate_messages_py
[  0%] Built target tf2_msgs_generate_messages_cpp
Scanning dependencies of target roscpp_generate_messages_eus
[  0%] Built target sensor_msgs_generate_messages_nodejs
[  0%] Built target geometry_msgs_generate_messages_cpp
[  0%] Built target roscpp_generate_messages_py
[  0%] Built target rosgraph_msgs_generate_messages_cpp
Scanning dependencies of target actionlib_generate_messages_cpp
[  0%] Built target pcl_msgs_generate_messages_eus
Scanning dependencies of target sensor_msgs_generate_messages_py
Scanning dependencies of target rosgraph_msgs_generate_messages_py
[  0%] Built target roscpp_generate_messages_eus
Scanning dependencies of target roscpp_generate_messages_nodejs
Scanning dependencies of target rosgraph_msgs_generate_messages_lisp
Scanning dependencies of target tf_generate_messages_lisp
[  0%] Built target actionlib_generate_messages_cpp
Scanning dependencies of target tf_generate_messages_eus
[  0%] Built target roscpp_generate_messages_nodejs
[  0%] Built target sensor_msgs_generate_messages_py
[  0%] Built target rosgraph_msgs_generate_messages_py
Scanning dependencies of target roscpp_generate_messages_lisp
[  0%] Built target rosgraph_msgs_generate_messages_lisp
[  0%] Built target tf_generate_messages_lisp
[  0%] Built target tf_generate_messages_eus
Scanning dependencies of target bond_generate_messages_py
Scanning dependencies of target tf_generate_messages_nodejs
Scanning dependencies of target std_srvs_generate_messages_py
Scanning dependencies of target std_srvs_generate_messages_lisp
[  0%] Built target roscpp_generate_messages_lisp
Scanning dependencies of target std_msgs_generate_messages_lisp
Scanning dependencies of target bond_generate_messages_eus
[  0%] Built target bond_generate_messages_py
[  0%] Built target tf_generate_messages_nodejs
Scanning dependencies of target std_msgs_generate_messages_eus
Scanning dependencies of target actionlib_generate_messages_eus
[  0%] Built target std_srvs_generate_messages_py
[  0%] Built target std_srvs_generate_messages_lisp
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target bond_generate_messages_eus
Scanning dependencies of target tf_generate_messages_cpp
[  0%] Built target actionlib_generate_messages_eus
Scanning dependencies of target msckf_vio_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_eus
Scanning dependencies of target tf2_msgs_generate_messages_nodejs
Scanning dependencies of target std_srvs_generate_messages_eus
[  0%] Built target tf_generate_messages_cpp
[  3%] Generating Javascript code from msckf_vio/TrackingInfo.msg
Scanning dependencies of target pcl_ros_gencfg
Scanning dependencies of target tf2_msgs_generate_messages_eus
Scanning dependencies of target nav_msgs_generate_messages_eus
Scanning dependencies of target nav_msgs_generate_messages_lisp
[  3%] Built target std_srvs_generate_messages_eus
[  3%] Built target tf2_msgs_generate_messages_nodejs
[  7%] Generating Javascript code from msckf_vio/CameraMeasurement.msg
[  7%] Built target pcl_ros_gencfg
[  7%] Built target nav_msgs_generate_messages_lisp
[  7%] Built target tf2_msgs_generate_messages_eus
[  7%] Built target nav_msgs_generate_messages_eus
[ 11%] Generating Javascript code from msckf_vio/FeatureMeasurement.msg
Scanning dependencies of target nav_msgs_generate_messages_nodejs
Scanning dependencies of target nodelet_generate_messages_lisp
Scanning dependencies of target tf_generate_messages_py
Scanning dependencies of target nodelet_generate_messages_nodejs
Scanning dependencies of target msckf_vio_generate_messages_lisp
[ 11%] Built target nav_msgs_generate_messages_nodejs
[ 11%] Built target nodelet_generate_messages_lisp
[ 11%] Built target tf_generate_messages_py
[ 14%] Built target nodelet_generate_messages_nodejs
[ 14%] Generating Lisp code from msckf_vio/TrackingInfo.msg
[ 18%] Generating Lisp code from msckf_vio/CameraMeasurement.msg
[ 22%] Generating Lisp code from msckf_vio/FeatureMeasurement.msg
Scanning dependencies of target bond_generate_messages_cpp
Scanning dependencies of target bond_generate_messages_lisp
[ 22%] Built target bond_generate_messages_cpp
[ 22%] Built target bond_generate_messages_lisp
Scanning dependencies of target nodelet_generate_messages_eus
Scanning dependencies of target topic_tools_generate_messages_cpp
Scanning dependencies of target topic_tools_generate_messages_eus
[ 22%] Built target msckf_vio_generate_messages_nodejs
Scanning dependencies of target pcl_msgs_generate_messages_lisp
[ 22%] Built target topic_tools_generate_messages_cpp
[ 22%] Built target topic_tools_generate_messages_eus
Scanning dependencies of target pcl_msgs_generate_messages_nodejs
[ 22%] Built target nodelet_generate_messages_eus
[ 22%] Built target pcl_msgs_generate_messages_lisp
Scanning dependencies of target std_srvs_generate_messages_nodejs
Scanning dependencies of target dynamic_reconfigure_generate_messages_cpp
Scanning dependencies of target msckf_vio_generate_messages_py
Scanning dependencies of target pcl_msgs_generate_messages_py
[ 22%] Built target msckf_vio_generate_messages_lisp
[ 22%] Built target pcl_msgs_generate_messages_nodejs
Scanning dependencies of target bond_generate_messages_nodejs
Scanning dependencies of target dynamic_reconfigure_generate_messages_eus
[ 22%] Built target std_srvs_generate_messages_nodejs
[ 25%] Generating Python from MSG msckf_vio/TrackingInfo
[ 25%] Built target dynamic_reconfigure_generate_messages_cpp
[ 25%] Built target pcl_msgs_generate_messages_py
[ 25%] Built target bond_generate_messages_nodejs
Scanning dependencies of target dynamic_reconfigure_generate_messages_lisp
Scanning dependencies of target msckf_vio_generate_messages_eus
[ 25%] Built target dynamic_reconfigure_generate_messages_eus
Scanning dependencies of target dynamic_reconfigure_generate_messages_nodejs
[ 29%] Generating Python from MSG msckf_vio/CameraMeasurement
Scanning dependencies of target actionlib_generate_messages_py
[ 29%] Built target dynamic_reconfigure_generate_messages_lisp
[ 33%] Generating Python from MSG msckf_vio/FeatureMeasurement
[ 37%] Generating EusLisp code from msckf_vio/TrackingInfo.msg
[ 37%] Built target dynamic_reconfigure_generate_messages_nodejs
Scanning dependencies of target dynamic_reconfigure_generate_messages_py
[ 40%] Generating EusLisp code from msckf_vio/CameraMeasurement.msg
[ 40%] Built target actionlib_generate_messages_py
Scanning dependencies of target dynamic_reconfigure_gencfg
[ 40%] Built target dynamic_reconfigure_generate_messages_py
[ 44%] Generating EusLisp code from msckf_vio/FeatureMeasurement.msg
[ 48%] Generating EusLisp manifest code for msckf_vio
[ 48%] Built target dynamic_reconfigure_gencfg
Scanning dependencies of target nodelet_topic_tools_gencfg
[ 48%] Built target nodelet_topic_tools_gencfg
Scanning dependencies of target pcl_msgs_generate_messages_cpp
[ 48%] Built target pcl_msgs_generate_messages_cpp
Scanning dependencies of target std_srvs_generate_messages_cpp
Scanning dependencies of target topic_tools_generate_messages_lisp
Scanning dependencies of target sensor_msgs_generate_messages_lisp
[ 48%] Built target std_srvs_generate_messages_cpp
Scanning dependencies of target topic_tools_generate_messages_nodejs
[ 48%] Built target sensor_msgs_generate_messages_lisp
[ 48%] Built target topic_tools_generate_messages_lisp
Scanning dependencies of target geometry_msgs_generate_messages_py
[ 48%] Built target topic_tools_generate_messages_nodejs
Scanning dependencies of target geometry_msgs_generate_messages_lisp
[ 48%] Built target geometry_msgs_generate_messages_py
Scanning dependencies of target msckf_vio_generate_messages_cpp
[ 55%] Generating C++ code from msckf_vio/CameraMeasurement.msg
[ 55%] Generating C++ code from msckf_vio/TrackingInfo.msg
[ 55%] Built target geometry_msgs_generate_messages_lisp
[ 59%] Generating C++ code from msckf_vio/FeatureMeasurement.msg
[ 62%] Generating Python msg __init__.py for msckf_vio
[ 62%] Built target msckf_vio_generate_messages_py
[ 62%] Built target msckf_vio_generate_messages_cpp
[ 62%] Built target msckf_vio_generate_messages_eus
Scanning dependencies of target msckf_vio_generate_messages
Scanning dependencies of target msckf_vio
Scanning dependencies of target image_processor
[ 62%] Built target msckf_vio_generate_messages
[ 70%] Building CXX object msckf_vio/CMakeFiles/image_processor.dir/src/image_processor.cpp.o
[ 70%] Building CXX object msckf_vio/CMakeFiles/image_processor.dir/src/utils.cpp.o
[ 77%] Building CXX object msckf_vio/CMakeFiles/msckf_vio.dir/src/utils.cpp.o
[ 77%] Building CXX object msckf_vio/CMakeFiles/msckf_vio.dir/src/msckf_vio.cpp.o
[ 81%] Linking CXX shared library /home/hri/catkin_ws/devel/lib/libimage_processor.so
[ 81%] Built target image_processor
Scanning dependencies of target image_processor_nodelet
[ 85%] Building CXX object msckf_vio/CMakeFiles/image_processor_nodelet.dir/src/image_processor_nodelet.cpp.o
[ 88%] Linking CXX shared library /home/hri/catkin_ws/devel/lib/libimage_processor_nodelet.so
[ 88%] Built target image_processor_nodelet
[ 92%] Linking CXX shared library /home/hri/catkin_ws/devel/lib/libmsckf_vio.so
[ 92%] Built target msckf_vio
Scanning dependencies of target msckf_vio_nodelet
[ 96%] Building CXX object msckf_vio/CMakeFiles/msckf_vio_nodelet.dir/src/msckf_vio_nodelet.cpp.o
[100%] Linking CXX shared library /home/hri/catkin_ws/devel/lib/libmsckf_vio_nodelet.so
[100%] Built target msckf_vio_nodelet

Step2:

好了,编译通过了,那么现在重要的事情就是泡泡数据来爽一下了!

你可能感兴趣的:(ROS,SLAM,VIO)