在英伟达jetson tx2上编译安装okvis

1.平台

nvidia jetson tx2,linux for tegra R28.1,opencv2.4.13,cuda8.0

2.安装依赖项

按照https://github.com/ethz-asl/okvis的README里的教程安装依赖.

cmake

sudo apt-get install cmake

google-glog + gflags

sudo apt-get install libgoogle-glog-dev

BLAS & LAPACK

sudo apt-get install libatlas-base-dev

Eigen3

sudo apt-get install libeigen3-dev

SuiteSparse and CXSparse

sudo apt-get install libsuitesparse-dev

Boost

sudo apt-get install libboost-dev libboost-filesystem-dev

不过这里建议把boost库全装上,一方面整个库也没多大省的以后再装,另一方面只装这么多后面编译可能会出错缺少thread库,以防万一还是全装上保险.

sudo apt-get install libboost-all-dev

**VI sensor

可选,用这个包需要一个系统(比如ROS)
git clone https://github.com/ethz-asl/libvisensor.git
cd libvisensor
./install_libvisensor.sh

3.编译安装okvis

下载源码

git clone https://github.com/ethz-asl/okvis.git

如果直接cmake后make的话,okvis用的是内部的ceres库和brisk库(虽然没啥毛病,但ceres要换源,,另外brisk编译会出错,要改CMakeLists),为了方便以后使用,直接安装ceres和brisk这两个依赖.

安装ceres

okvis用的ceres版本不能高于1.9.0,不然编译报错.
git clone -b 1.9.0 https://github.com/ceres-solver/ceres-solver.git
cd ~/ceres-solver
mkdir build
cd build
cmake ..
make -j6
sudo make install

安装brisk

wget https://www.doc.ic.ac.uk/~sleutene/software/brisk-2.0.3.zip
unzip brisk-2.0.3.zip
cd brisk

直接编译会出错,打开CMakeLists.txt,
将53行:
add_definitions(-mfpu=neon -DHAVE_OPENCV -Wall -pedantic -std=c++0x -fPIC)
改成
add_definitions(-D__ARM_NEON__ -DHAVE_OPENCV -Wall -pedantic -std=c++0x -fPIC)
然后编译即可通过
mkdir build
cmake ..
make -j6
sudo make install

安装okvis

cd ~/okvis
打开CMakeLists.txt,

将13,15行的OFF改成ON

将68行:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon")
改成
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__ARM_NEON__")

然后编译安装

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j6
sudo make install

漫长的等待后安装成功,跑个demo测试一下:去
http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets上下个数据集(比如MH_01_easy).
./okvis_app_synchronous path/to/okvis/config/config_fpga_p2_euroc.yaml path/to/MH_01_easy/mav0/

至于使用okvis库进行二次开发,只需包含刚刚install的okvis库和头文件即可.

你可能感兴趣的:(在英伟达jetson tx2上编译安装okvis)