在运行ORB-SLAM2+imu紧耦合算法时遇到的错误
fatal error: Eigen/Dense: No such file or directory
解决办法:
1.
cd /usr/local/include
2.
sudo ln -sf eigen3/Eigen Eigen
3.
sudo ln -sf eigen3/unsupported unsupporte
解决了
下一个错误:error:static assertion failed: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY
解决办法:(参照网上博客)
打开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;
解决!
下一个错误:undefined reference to symbol '_ZN2cv6String10deallocateEv'
解决:在CMakeLists里面修改find_package(OpenCV 3 REQUIRED)把版本写成自己安装的就可以
错误:usleep was not declared
解决:#include <unistd.h>添加头文件即可
错误:关于ros的
解决:路径问题,编辑bashrc文件
最后加上一句:export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/home/z/catkin_ws/src/LearnVIORB-RT/Examples/ROS/ORB_VIO