这次要实现ETH的开源项目aerial_mapper,因为这篇论文看起来效果比较出色,论文为“Mapping on the Fly: Real-time 3D Dense Reconstruction, Digital Surface Map and Incremental Orthomosaic Generation for Unmanned Aerial Vehicles”,开源地址为https://github.com/ethz-asl/aerial_mapper
首先是进行安装编译配置,理论上来说按照一下流程依次进行即可(当然第一步肯定是安装ROS,这里就不做介绍了网上可以找的教程,我安装的是ubuntu18.04对应的是ROS melodic,直接从安装配置aerial_mapper开始)
###GDAL dependency (used to export orthomosaic as geotiff format):
sudo apt-get update
sudo apt-get install libgdal-dev
###Curl dependency for Google Maps Api (used for visualization):
sudo apt-get update
sudo apt-get install libcurlpp-dev
sudo apt-get install libcurl4-openssl-dev
###e.g. for Ubuntu 18.04, ROS melodic
mkdir -p ~/catkin_ws_aerial_mapper/src
cd catkin_ws_aerial_mapper
catkin init
catkin config --merge-devel # Necessary for catkin_tools >= 0.4.
catkin config --extend /opt/ros/melodic # Replace indigo by your ROS version
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release # Release/Debug
cd src
wstool init
git clone git@github.com:ethz-asl/aerial_mapper.git
# alternatively(推荐): git clone https://github.com/ethz-asl/aerial_mapper.git
wstool merge aerial_mapper/install/dependencies_ssh.rosinstall
wstool update -j8
sed -i 's/WITH_QT=OFF/WITH_QT=ON/g' opencv3_catkin/CMakeLists.txt
###编译
catkin build aerial_mapper
以上就是安装配置的步骤。
下面讲一下我在安装编译过程中遇到的各种问题。
问题一:git@github.com: Permission denied (publickey). fatal: 无法读取远程仓库。
如果要用到git@github.com时候,可以利用git clone代替,如果不方便代替,一定要用git@github.com的话,我是这样解决的
(1)生成密钥,输入以下命令,一路回车即可,会生成ssh key。保存在.ssh目录下。
ssh-keygen -t rsa -C "xxxx@qq.com"
(2)打开刚刚生成的id_rsa.pub,将里面的内容复制,进入github,在settings下,SSH and GPG keys下new SSH key,title随便取一个名字,然后将id_rsa.pub里的内容复制到Key中,完成后Add SSH Key。
(3)输入以下的命令,测试一下
ssh -T git@github.com
问题解决
问题二:在编译时出现compilation terminated.
我最后发现原因应该是我用的虚拟机进行的安装编译,内存不足(虚拟机我给了8G,没想到还能内存不足)
于是只能换成双系统的ubuntu,我的笔记本是16G内存,这个问题得到了解决。
问题三:
Errors << aslam_cv_common:cmake /home/Projects/extrinsics_calibration/logs/aslam_cv_common/build.cmake.014.log
CMake Error at /home/Projects/extrinsics_calibration/devel/share/catkin_simple/cmake/catkin_simple-extras.cmake:38 (find_package):
By not providing "Findprotobuf_catkin.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"protobuf_catkin", but CMake did not find one.
Could not find a package configuration file provided by "protobuf_catkin"
with any of the following names:
protobuf_catkinConfig.cmake
protobuf_catkin-config.cmake
解决方法:
cd ~/catkin_ws_aerial_mapper/src
git clone https://github.com/ethz-asl/protobuf_catkin.git
catkin build protobuf_catkin
运行例程
###You can find demo launch files under
cd aerial_mapper_demos/launch/
###To launch the node, type e.g.:
roslaunch aerial_mapper_demos 0-synthetic-cadastre-dense-pcl.launch
###还有其他launch文件可以运行
问题四:运行时github作者并未写明具体前提步骤,需要自己略微摸索
首先,需要下载dataests文件,原作者给的链接好像有点问题,我最后发现直接利用这个链接进行下载http://timohinzmann.com/datasets/fsr/cadastre_gray.tar.gz
第二步,把下载的文件解压到ubuntu的计算机中的tmp中的simulation文件,simulation文件需要自己新建
若不进行以上步骤运行例程时会出现问题process has died等error,如下图
成功运行如下
参考:
git@github.com: Permission denied (publickey). fatal: 无法读取远程仓库。_dartao_的博客-CSDN博客aslam_cv_common compilation fails. · Issue #97 · ethz-asl/hand_eye_calibration · GitHubHow to run · ethz-asl/aerial_mapper Wiki · GitHub