这里主要记录编译过程中遇到的坑
1首先是一些常规的操作,主要是安装简单的第三方依赖
sudo apt-get install python-setuptools python-rosinstall ipython
sudo apt-get install libeigen3-dev libboost-all-dev doxygen libopencv-dev
sudo apt-get install ros-melodic-vision-opencv ros-indigo-image-transport-plugins
sudo apt-get install ros-melodic-cmake-modules python-software-properties
sudo apt-get install software-properties-common libpoco-dev python-matplotlib
sudo apt-get install python-scipy python-git python-pip ipython libtbb-dev
sudo apt-get install libblas-dev liblapack-dev python-catkin-tools libv4l-dev
sudo pip install python-igraph --upgrade
这里如果失败就换成
sudo apt-get install python-igraph
2创建工作空间
mkdir -p ~/kalibr_workspace/src
cd ~/kalibr_workspace
source /opt/ros/melodic/setup.bash
catkin init
catkin config --extend /opt/ros/indigo
catkin config --merge-devel
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
3下载源代码
cd ~/kalibr_workspace/src
git clone https://github.com/ethz-asl/Kalibr.git
4编译(这里就会出现各种错误)
cd ~/kalibr_workspace
catkin build -DCMAKE_BUILD_TYPE=Release -j4
第一个错误:由suitesparse引起的多个依赖被abandond
这里主要是wget进行验证导致的 解决办法: 更改cmakelist里面的文件,添加–no-check-certificate
DOWNLOAD_COMMAND rm -f SuiteSparse-${VERSION}.tar.gz && wget --no-check-certificate http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-${VERSION}.tar.gz
第二个问题应该是 aslam_imgproc编译失败
解决方案 在文件 kalibr/aslam_cv/aslam_imgproc/include/aslam/implementation/aslamcv_helper.hpp 替换"CvSize" 成为"cv::Size" in file
第三个问题应该是 aslam_cv_python 编译失败
解决方案:
cd /home/你的/kalibr_workspace/build/aslam_cv_python
catkin build --get-env aslam_cv_python | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j
第四个问题应该是 aslam_cv_backend_python 编译失败(如果你内存不够<4G)
如果是虚拟机就多分配一些 Unfortunately this particular file currently requires quite some memory to compile. (I reckon at least 4GB) Maybe you can manage to free enough or add swap space. Add an -j 1 argument to your build command to compile this file. If all that fails you could try to split the file in multiple compilation units (cpp) or remove parts that you don’t need for your task. It should be possible to delete blocks like https://github.com/ethz-asl/kalibr/blob/master/aslam_cv/aslam_cv_backend_python/src/module.cpp#L54-L56 if you don’t need them for your setup. 官方链接.
5source
source ~/kalibr_workspace/devel/setup.bash
|