先安装依赖
sudo apt install cmake
sudo apt install ros-noetic-pcl-ros
sudo apt install ros-noetic-tf2-sensor-msgs
sudo apt install libgoogle-glog-dev libatlas-base-dev libeigen3-dev
sudo apt install libsuitesparse-dev libopencv-dev
sudo apt install libboost-dev libboost-filesystem-dev
在安装libsuitesparse-dev libopencv-dev的时候出现了问题,但是由于之前在电脑里下载过opencv,跳过好像没影响。
安装ceres
git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver
git checkout 1.14.x
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
sudo make install
cd ../..
后续编译这一步会报错
手动安装了新版本ceres(2.2)
Tags · ceres-solver/ceres-solver · GitHub
安装brisk
wget https://www.doc.ic.ac.uk/~sleutene/software/brisk-2.0.8.zip
unzip brisk-2.0.8.zip
cd brisk
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
sudo make install
cd ../..
Building the project
mkdir -p ~/svin_ws/src
cd ~/svin_ws/src
git clone --branch 0.2 https://github.com/AutonomousFieldRoboticsLab/SVIn.git
git clone https://github.com/AutonomousFieldRoboticsLab/imagenex831l.git
# For Ubuntu 18.04/20.04 (ROS Noetic)
git clone --branch ros-noetic git@github.com:AutonomousFieldRoboticsLab/sonar_rviz_plugin.git
cd ..
catkin_make
这里找不到库,需要自己去重新下载
GitHub - AutonomousFieldRoboticsLab/sonar_rviz_plugin at ros-noetic
随后开始编译
处理报错
/usr/bin/ld: 找不到 -lopengv
collect2: error: ld returned 1 exit status
make[2]: *** [SVIn-main/pose_graph/CMakeFiles/pose_graph.dir/build.make:887:/home/zzz/catkin_ws_svln/devel/lib/libpose_graph.so] 错误 1
make[1]: *** [CMakeFiles/Makefile2:4448:SVIn-main/pose_graph/CMakeFiles/pose_graph.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2
Invoking "make -j12 -l12" failed
这里是自己下载了opengv的库,参考链接
https://www.cnblogs.com/long5683/p/13575788.html
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install cmake libeigen3-dev
git clone https://github.com/laurentkneip/opengv
cd opengv
mkdir build && cd build && cmake ..
make -j8
sudo make install
随后就能正常编译了
运行
参考issue中,先使用v2测试,发现opencv版本不对,下载了4.2.0,可以运行了。
但是第二天编译发现出现了这个问题,要下载1.77boost,下载了boost也没用
找了一些电脑里的boost库,整理了一下名字,在/usr/include中把1.71.0复制到了usr/local/include中
编译,发现找不到boost,不能写版本名字。
算了还是老老实实下载boost1.71.1然后指定路径
SET(Boost_DIR /usr/local/lib/cmake/Boost-1.71.0/) # 设置Boost_DIR