在TX2上安裝VIINS-Mono——問題總結
1 ceres-solver
我們一般通過以下命令安裝Eigen:
sudo apt-get install libeigen3-dev
預設安裝在/usr/include/eigen3
。
在CMakeList.txt中一般用以下語句找到Eigen:
find_package(Eigen REQUIRED)
如果有時找不到,可以替換成:
include_directories(/usr/include/eigen3)
在TX2上安裝ceres-solver時,出現以下錯誤:
– Found installed version of Eigen: /usr/lib/cmake/eigen3
– Found Eigen version 3.2.92: /usr/include/eigen3
CMake Error at CMakeLists.txt:240 (message):
– Ceres requires Eigen version >= 3.3.4 on aarch64. Detected version of
Eigen is: 3.2.92.
因此,需要升級Eigen版本,大於或等於3.3.4。
在Eigen官網下載大於或等於3.3.4的版本,解壓後使用cmake安裝。
cd eigen
mkdir build
cd build
cmake ..
sudo make install
預設安裝路徑為/usr/local/include/eigen3
。
在ceres-solver的CMakeList.txt中註釋find_package(Eigen QUIET)
,然後新增:
include_directories(/usr/local/include/eigen3) set(EIGEN_INCLUDE_DIRS "/usr/local/include/eigen3")
2 catkin_make時找不到Ceres
報錯資訊
CMake Error at MYNT-EYE-VINS-Sample/camera_model/CMakeLists.txt:19 (find_package):
Found package configuration file:
/usr/local/lib/cmake/Ceres/CeresConfig.cmake
but it set Ceres_FOUND to FALSE so package “Ceres” is considered to be NOT
FOUND.
CMake Error at /usr/local/lib/cmake/Ceres/CeresConfig.cmake:83 (message):
Failed to find Ceres - Found Eigen dependency, but the version of Eigen
found (3.3.5) does not exactly match the version of Eigen Ceres was
compiled with (). This can cause subtle bugs by triggering violations of
the One Definition Rule. See the Wikipedia article
http://en.wikipedia.org/wiki/One_Definition_Rule for more details
Call Stack (most recent call first):
/usr/local/lib/cmake/Ceres/CeresConfig.cmake:187 (ceres_report_not_found)
解決方法
開啟/usr/local/lib/cmake/Ceres/CeresConfig.cmake
,作以下修改:
set(Ceres_FOUND TRUE) #將FALSE改為TRUE
set(EIGEN_INCLUDE_DIR "/usr/local/include/eigen3") #新增此行
set(CERES_EIGEN_VERSION 3.3.5) #新增此行,版本號與你安裝的對應
3 stack smashing detected
編譯成功後,執行報錯:
stack smashing detected
發現還是Eigen的問題,在所有包含find_package(Eigen3)
的CMakeList.txt中,將其替換為:
include_directories(/usr/local/include/eigen3)
然後重新編譯,就可以成功運行了。
4 相機供電
由於TX2的USB介面有限,我使用了USB hub進行擴充套件,可能因為供電不足,相機很容易掛掉。
5 總結
綜上,主要是Eigen的版本問題和在CMakeList.txt中找到需要的版本。
最後附一張截圖,明天進行大場景測試。