ORB_SLAM_IMU运行(原创)

本文参考https://github.com/henrywen2011/orb_slam_imu

1. 安装依赖项
测试环境:Ubuntu16.04
1.1 Boost
The Boost library is used to launch different threads of the SLAM system.

 sudo apt-get install libboost-all-dev 

1.2 OpenCV 2.4.x
OpenCV 2.4.x OpenCV is mainly used for feature extraction, and matching. It can be installed via: sudo apt-get install libopencv-dev

sudo apt-get install libopencv-dev

1.3 Install ROS (optional) and download orbslam_dwo
To build the program with the ROS support, a ROS distribution (e.g. Indigo) needs to be installed. For now, the program is only tested with Indigo, but it should work with Hydro and Jade because it only relies on a few basic features of ROS, e.g. ros::rate, ROS_INFO(). After ROS is installed, a catkin workspace has to be set up using this tutorial. From now on, let’s suppose the workspace path is ~/home/username/catkin_ws.

If the program is to be built without ROS support, you may simply create a folder to contain the source of ORBSLAM_DWO, let’s assume that the folder is created such that its path is ‘~/home/username/catkin_ws/src’.

Regardless of the ROS support, download ORBSLAM_DWO into the workspace folder via:

cd catkin_ws/src		
	git clone https://github.com/JzHuai0108/ORB_SLAM.git
	mv $HOME/catkin_ws/src/ORB_SLAM $HOME/catkin_ws/src/orbslam_dwo

下载ORB_SLAM_DWO
我是之前安装的ROS, 运行ORB_SLAM的时候,没有在ROS环境下运行,因此,为了保证环境可用,做了如下测试:
在catkin_ws目录下打开终端:

catkin_make
echo $ROS_PACKAGE_PATH

显示运行结果:

echo $ROS_PACKAGE_PATH

完成后,开始下载ORB_SLAM_DWO。

1.4 g2o
g2o and its dependencies g2o is used to perform optimization tasks. Its dependencies(Eigen, CMAKE, SuiteSparse, QGLViewer) can be installed via: sudo apt-get install cmake libeigen3-dev libsuitesparse-dev libqglviewer-dev To avoid system wide installation, g2o is recommended to be installed into the local folder ‘~/home/username/catkin_ws/src/orbslam_dwo/Thirdparty’. To do that, navigate to that folder in a terminal, and run the following commands:
建议安装到 ‘~/home/username/catkin_ws/src/orbslam_dwo/Thirdparty’. ,可通过一下代码完成。

    git clone https://github.com/RainerKuemmerle/g2o.git
	cd g2o
	mkdir local_install
	mkdir build
	cd build
	cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/catkin_ws/src/orbslam_dwo/Thirdparty/g2o/local_install -DCMAKE_BUILD_TYPE=Release
	make -j4
	make install
	cd

For all the following dependencies(libraries), you DON’T need to install them (e.g., execute ‘make install’).
1.5 autodiff of the ceres solver (included) The autodiff module of the ceres solver is used to compute Jacobians in the IMU constraint. Automatic differentiation is necessary because in the program the full exponential map is used to map se(3) to SE(3). If a first order approximation is used, e.g., in OKVIS, analytic Jacobians can be derived.
未操作。

1.6 DBoW2
已安装

1.7 libviso2
已安装

1.8 Sophus The modified version of Sophus by Steven Lovegrove is used to manipulate Lie group members. The reason why Hauke Strasdat’s version is not used is that Lovegrove’s version is a header only library. More importantly, it complies with the jet numbers used in the autodiff module of the ceres solver. To use it, downloading is enough. To do that, navigate to the orbslam_dwo/Thirdparty folder in a terminal and run: git clone https://github.com/stevenlovegrove/Sophus.git
未操作

1.9 vikit (included)
To build it, navigate to the orbslam_dwo/Thirdparty/vikit_common folder in a terminal and run:

make未通过,先一放,看看对后面是否会有影响。(因属于可不安装范围)

2. 安装 ORBSLAM_DWO and test with KITTI seq 00 and Tsukuba CG stereo dataset
stereo or stereo + inertial configuration In orbslam_dwo/CMakeLists.txt make sure line “SET(MONO_SLAM FALSE)”(文件已有).
Note whether to use IMU data is determined by the use_imu_data field in the yaml setting file. Then build the program either with or without ROS as follows.(此句没看懂,没找到在哪里设置)

2.1 With ROS In orbslam_dwo/CMakeLists.txt make sure line “SET(USE_ROS TRUE)”.(此处已修改为true)

    cd catkin_ws
	source devel/setup.bash		
	catkin_make -DCMAKE_BUILD_TYPE=Release --pkg orbslam_dwo
	make

catkin_make error

报错“: 没有 Eigen Chomlod

安装了上述软件后继续报错:

 BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 2 packages in topological order:
-- ~~  - pangolin (plain cmake)
-- ~~  - orbslam_dwo
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_workspace.cmake:95 (message):
  This workspace contains non-catkin packages in it, and catkin cannot build
  a non-homogeneous workspace without isolation.  Try the
  'catkin_make_isolated' command instead.
Call Stack (most recent call first):
  CMakeLists.txt:64 (catkin_workspace)


-- Configuring incomplete, errors occurred!
See also "/home/l/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/l/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:990: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

执行建议执行的命令及报错:

catkin_make_isolated

fatal error: sophus/se3.hpp: No such file or directory
fatal error: sophus/se3.hpp: No such file or directory

看来sophus的问题还是要解决的,返回第一步解决。
重新安装 : sophus ,(其实github上作者说这个可以不安装的,下载即可,但是如果这个不安装,vikit 就会报错,找不到sophus的文件:
fatal error: sophus/se3.hpp: No such file or directory
其实报错找不到的那个文件时存在的sophus/se3.hpp,就是不知道为什么找不到,怀疑是否因为只保存未安装sophus,所以又去安装sophus,但是…

[ 20%] Building CXX object CMakeFiles/vikit_common.dir/src/math_utils.cpp.o
In file included from /home/l/catkin_ws/src/orbslam_dwo/Thirdparty/vikit_common/src/math_utils.cpp:8:0:
/home/l/catkin_ws/src/orbslam_dwo/Thirdparty/vikit_common/include/vikit/math_utils.h:14:26: **fatal error: sophus/se3.hpp: No such file or directory**
compilation terminated.
CMakeFiles/vikit_common.dir/build.make:62: recipe for target 'CMakeFiles/vikit_common.dir/src/math_utils.cpp.o' failed
make[2]: *** [CMakeFiles/vikit_common.dir/src/math_utils.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/vikit_common.dir/all' failed
make[1]: *** [CMakeFiles/vikit_common.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

sophus 的安装如下:
cmake正常,make时出现一连串报错:同样的错误,因为不懂代码,不知道从何改起。
‘EIGEN_DEVICE_FUNC’ does not name a type
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE

home/l/catkin_ws/src/orbslam_dwo/Thirdparty/Sophus/sophus/so3.hpp:136:3: error: ‘EIGEN_DEVICE_FUNC’ does not name a type
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
   ^
/home/l/catkin_ws/src/orbslam_dwo/Thirdparty/Sophus/sophus/so3.hpp:154:3: error: ‘EIGEN_DEVICE_FUNC’ does not name a type
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
   ^
/home/l/catkin_ws/src/orbslam_dwo/Thirdparty/Sophus/sophus/so3.hpp:164:3: error: ‘EIGEN_DEVICE_FUNC’ does not name a type
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
   ^
/home/l/catkin_ws/src/orbslam_dwo/Thirdparty/Sophus/sophus/so3.hpp:177:3: error: ‘EIGEN_DEVICE_FUNC’ does not name a type
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
   ^
/home/l/catkin_ws/src/orbslam_dwo/Thirdparty/Sophus/sophus/so3.hpp:190:3: error: ‘EIGEN_DEVICE_FUNC’ does not name a type
   EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
   ^

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值