阅读论文 A Robust and Modular Multi-Sensor Fusion Approach Applied to MAV Navigation后想复现该篇论文,因此在Ubuntu16.04/ROS Kinect系统下编译苏黎世大学ethz的多传感器融合算法msf,该项目地址为https://github.com/ethz-asl/ethzasl_msf。按照[这篇博客]编译,发现很多报错,因此把具体过程记录,详细的介绍msf的编译过程。
python使用ros自带2.7版本,opencv同样也是ros自带版本。**注意:**不要安装anaconda,因为anaconda下的opencv和Python环境与ros本地的版本会产生大量冲突,有很多bug。另外不要在这个工作空间下安装Pangolin库。
正式开始编译:
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ..
catkin_make
source devel/setup.bash
执行echo $ROS_PACKAGE_PATH
可以查看当前环境变量是否正确。正常应该输出
/home/你的用户名/你的工作空间名/src:/opt/ros/kinetic/share
cd src/
git clone https://github.com/ethz-asl/glog_catkin.git
git clone https://github.com/catkin/catkin_simple.git
git clone https://github.com/ethz-asl/asctec_mav_framework.git
git clone https://github.com/ethz-asl/mav_comm.git
glog是一个c++库。
git clone https://github.com/google/glog.git
cd glog
./autogen.sh && ./configure && make
sudo make install
如果报错./autogen.sh: 5: ./autogen.sh: autoreconf: not found
,执行
sudo apt-get install autoconf
sudo apt-get install automake
sudo apt-get install libtool
第一种方案
下载在geographiclib的zip文件,这里选择1.50版本,下载完成后解压到工作空间的src目录
cd src/GeographicLib-1.50.1/
mkdir build
cd build
../configure
make -j4
sudo make install
若第一种不可行,则使用第二种方案
sudo pip install geographiclib
回到工作空间(catkin_ws)
source devel/setup.bash
catkin_make
一、
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by
“sensor_fusion_comm” with any of the following names:
sensor_fusion_commConfig.cmake
sensor_fusion_comm-config.cmake
解决方案:
cd src/
git clone https://github.com/ethz-asl/ethzasl_sensor_fusion.git
二、
CMake Error at /home/hgh/catkin_ws/devel/share/glog_catkin/cmake/glog_catkinConfig.cmake:173 (message):
Project ‘msf_core’ tried to find library ‘glog’. The library is neither a
target nor built/installed properly. Did you compile project
‘glog_catkin’? Did you find_package() it before the subdirectory containing
its code is included?
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
ethzasl_msf-master/msf_core/CMakeLists.txt:17 (find_package)
未安装glog导致,执行步骤2的glog安装
三、
catkin_ws/src/asctec_mav_framework/asctec_hl_interface/src/hl_interface.h:51:45: fatal error: mav_msgs/RollPitchYawrateThrust.h: No such file or directory
compilation terminated.
asctec_mav_framework/asctec_hl_interface/CMakeFiles/hl_node.dir/build.make:86: recipe for target ‘asctec_mav_framework/asctec_hl_interface/CMakeFiles/hl_node.dir/src/hl_interface.cpp.o’ failed
make[2]: *** [asctec_mav_framework/asctec_hl_interface/CMakeFiles/hl_node.dir/src/hl_interface.cpp.o] Error 1
CMakeFiles/Makefile2:4304: recipe for target ‘asctec_mav_framework/asctec_hl_interface/CMakeFiles/hl_node.dir/all’ failed
make[1]: *** [asctec_mav_framework/asctec_hl_interface/CMakeFiles/hl_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
缺少 mav_comm库,执行步骤2的git clone https://github.com/ethz-asl/mav_comm.git
四、
/home/hgh/catkin_ws/src/MSF_developed-master/src/read_dataset/main.cpp:19:38: fatal error: GeographicLib/Geodesic.hpp: No such file or directory
compilation terminated.
MSF_developed-master/CMakeFiles/read_node.dir/build.make:62: recipe for target ‘MSF_developed-master/CMakeFiles/read_node.dir/src/read_dataset/main.cpp.o’ failed
make[2]: *** [MSF_developed-master/CMakeFiles/read_node.dir/src/read_dataset/main.cpp.o] Error 1
CMakeFiles/Makefile2:9608: recipe for target ‘MSF_developed-master/CMakeFiles/read_node.dir/all’ failed
make[1]: *** [MSF_developed-master/CMakeFiles/read_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
未安装GeographicLib,执行步骤2的GeographicLib安装