标签:view apt-get file exist share win python point use
1. 安装opengl Library
$sudo apt-get install libgl1-mesa-dev
2. 安装opengl utility
$sudo apt-get install libglu1-mesa-dev
3. 安装opengl utility toolkit
$sudo apt-get install freeglut3-dev
$sudo apt-get install libglew-dev
$sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
$sudo apt-get install build-essential
1. 下载链接:https://github.com/stevenlovegrove/Pangolin
注:可以使用git进行clone,也可以直接download zip
2. 编译安装步骤
$cd Pangolin
$mkdir build
$cd build
$cmake ..
$make
$sudo make install
$make doc (生成文档)
必选依赖:sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
可选依赖:sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
源码下载链接:http://opencv.org/downloads.html (选择2.4.xx,3.x.xx版本都可以,新版本的ORBSLAM2已经支持OpenCV3.xx.xx)
编译安装步骤(以OpenCV2.4.xx为例):
$cd opencv-2.4.xx
$mkdir build
$cd build
$cmake ..
$make
$sudo make install
源码下载地址:http://eigen.tuxfamily.org/index.php?title=Main_Page
安装依赖:sudo apt-get install libxmu-dev libxi-dev
编译安装步骤:
$cd eigen
$mkdir build
$cd build
$cmake ..
$make
$sudo make install
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2
$cd ORB_SLAM2
$chmod +x build.sh
$./build.sh
错误信息:
Configuring and building Thirdparty/DBoW2 ...
mkdir: cannot create directory ‘build’: File exists
-- OpenCV ARCH:
-- OpenCV RUNTIME:
-- OpenCV STATIC: OFF
CMake Warning at /home/melanie/tools/opencv-2.4.13/cmake/OpenCVConfig.cmake:163 (message):
Found OpenCV Windows Pack but it has not binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
CMakeLists.txt:27 (find_package)
CMake Error at CMakeLists.txt:27 (find_package):
Found package configuration file:
/home/melanie/tools/opencv-2.4.13/cmake/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
-- Configuring incomplete, errors occurred!
See also "/home/melanie/source/SmartCar/ORM_SLAM2/ORB_SLAM2/Thirdparty/DBoW2/build/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found. Stop.
解决方案:
因为我的OpenCV用源码编译安装的路径默认是/usr/local/share/OpenCV/,所以在这里手动给cmake指定OpenCV的路径
修改build.sh如下:
cd Thirdparty/DBoW2
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=/usr/local/share/OpenCV/
make
错误信息:
/home/melanie/tools/eigen/Eigen/src/Core/AssignEvaluator.h:817:3: error: static assertion failed: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY
EIGEN_CHECK_BINARY_COMPATIBILIY(Func,typename ActualDstTypeCleaned::Scalar,typename Src::Scalar);
^
CMakeFiles/ORB_SLAM2.dir/build.make:350: recipe for target ‘CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o‘ failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o] Error 1
CMakeFiles/Makefile2:178: recipe for target ‘CMakeFiles/ORB_SLAM2.dir/all‘ failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target ‘all‘ failed
make: *** [all] Error 2
解决方案:
打开Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h,将以下代码
template <typename MatrixType>
class LinearSolverEigen: public LinearSolver<MatrixType>
{
public:
typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
typedef Eigen::Triplet<double> Triplet;
typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;
修改为:
template <typename MatrixType>
class LinearSolverEigen: public LinearSolver<MatrixType>
{
public:
typedef Eigen::SparseMatrix<double, Eigen::ColMajor> SparseMatrix;
typedef Eigen::Triplet<double> Triplet;
typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, int> PermutationMatrix;
错误信息:
/home/melanie/source/SmartCar/ORM_SLAM2/ORB_SLAM2/src/Viewer.cc:159:28: error: ‘usleep’ was not declared in this scope
usleep(3000);
^
CMakeFiles/ORB_SLAM2.dir/build.make:494: recipe for target ‘CMakeFiles/ORB_SLAM2.dir/src/Viewer.cc.o‘ failed
make[2]: *** [CMakeFiles/ORB_SLAM2.dir/src/Viewer.cc.o] Error 1
CMakeFiles/Makefile2:178: recipe for target ‘CMakeFiles/ORB_SLAM2.dir/all‘ failed
make[1]: *** [CMakeFiles/ORB_SLAM2.dir/all] Error 2
Makefile:83: recipe for target ‘all‘ failed
make: *** [all] Error 2
解决方案:
在source文件的开头增加include
#include <unistd.h>
需要增加unistd.h的文件有:
Examples/Monocular/mono_euroc.cc
Examples/Monocular/mono_kitti.cc
Examples/Monocular/mono_tum.cc
Examples/RGB-D/rgbd_tum.cc
Examples/Stereo/stereo_euroc.cc
Examples/Stereo/stereo_kitti.cc
src/LocalMapping.cc
src/LoopClosing.cc
src/System.cc
src/Tracking.cc
src/Viewer.cc
安装了CUDA的机器编译的时候会出现CUDA相关错误,修改build.sh如下:
cd Thirdparty/DBoW2
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=/usr/local/share/OpenCV/ -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF
make -j
......
echo "Configuring and building ORB_SLAM2 ..."
mkdir build
cd build
-cmake .. -DCMAKE_BUILD_TYPE=Release
+cmake .. -DCMAKE_BUILD_TYPE=Release -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF
make -j
标签:view apt-get file exist share win python point use
原文地址:http://www.cnblogs.com/melaniedeng/p/6755437.html