赞
踩
1.usleep未定义
解决方案:
在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(红色部分是必须要添加的,非红色看报错情况)
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;
错误信息:
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/lib/OpenCV/,所以在这里手动给cmake指定OpenCV的路径
修改build.sh如下:
cd Thirdparty/DBoW2
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=/usr/local/lib/OpenCV/
make
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。