Ubuntu16.04编译王京大神VIORB过程中遇到的问题

前言

这两天遇到了先后遇到了,
1. rosbuild_ws下面编译通过代码,但是无法执行程序,无法跑数据库的尴尬局面;
2. rosbuild_ws下面同时存在LearnVIORB和另外一个基于此的代码的时候,ros路径的问题;
3. 然后rosbuild_ws彻底不工作的问题;
4. ~/.zshrc系列设置的问题;
5. 然后索性把rosbuild_ws下面的东西先拷贝出来。在catkin_ws下面编译!
这次记录了在这个下面编译VIORB的过程中先后遇到的问题,记录一下!
——————————————————————————————————————————————————————

问题一:

编译过程中出现YOU MIXED DIFFERENT NUMERIC TYPES等等错误,就是说显示的是各种看起来让人不舒服的<>这种括号里面乱七八糟的东西,因为之前单独编译ORB-SLAM的时候也遇到过,就一下子解决了
【解决办法】
Step1:
在LearnVIORB项目下,进入到Thirdparty/g2o/g2o/solvers目录下面:
Step2:
用vim或者gedit修改linear_solver_eigen.h文件;
具体的修改的内容:

//1.找到下面这一行:
typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;
//2.把上面找到的这一行修改为:
typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, int> PermutationMatrix;

简而言之,上面其实就是把<>里面的SparseMatrix::Index换成int而已

Step3:
保存退出重新编译。

然后在编译的过程中我又遇到了这样的问题:
————————————————————————————————————————————————————————

问题二:

OpenCV版本的问题,LearnVIORB 提供的是OpenCV 2.x.x的版本,具体的我忘记了,
但是在编译的过程中总是走到开始编译 VIO部分60%部分的时候报错然后就失败了!!!
【解决办法】
这个比较简单,不一一列举了!
简单的说就是把 LearnVIORB下面的 CMakeList.txt和Examples/ROS/VIO_ORB下面的CMakeList.txt中的find package()都改成相应的版本,顺便还要在之前添加:
set( OpenCV_DIR "/usr/local/opencv3.2.0/share/OpenCV")
这里我以自己安装opencv3的地址为例,记住是每个CMakeListx.txt都要进行这样的操作~

好了,这下VIORB的VIO的部分能够编译到100%了,但是又出现了如下的新的问题:
——————————————————————————————————————————————————————

问题三:

报错信息:
基本就是各种undefined reference to XXX
看得我就很生气!很生气!

Scanning dependencies of target VIO
[ 66%] Building CXX object CMakeFiles/VIO.dir/src/MsgSync/MsgSynchronizer.cpp.o
[ 66%] Building CXX object CMakeFiles/VIO.dir/src/ros_vio.cc.o
[100%] Linking CXX executable ../VIO
CMakeFiles/VIO.dir/src/ros_vio.cc.o: In function `bool rosbag::Bag::readField<unsigned int>(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&, bool, unsigned int*) const':
ros_vio.cc:(.text._ZNK6rosbag3Bag9readFieldIjEEbRKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEERS6_bPT_[_ZNK6rosbag3Bag9readFieldIjEEbRKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEERS6_bPT_]+0x25): undefined reference to `rosbag::Bag::checkField(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&, unsigned int, unsigned int, bool) const'
CMakeFiles/VIO.dir/src/ros_vio.cc.o: In function `ros::SubscriptionCallbackHelperT<boost::shared_ptr<sensor_msgs::Imu_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)':
ros_vio.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs4Imu_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0x6f7): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/VIO.dir/src/ros_vio.cc.o: In function `boost::shared_ptr<sensor_msgs::Imu_<std::allocator<void> > > rosbag::Bag::instantiateBuffer<sensor_msgs::Imu_<std::allocator<void> > >(rosbag::IndexEntry const&) const':
ros_vio.cc:(.text._ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs4Imu_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE[_ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs4Imu_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE]+0x3ab): undefined reference to `rosbag::Bag::readField(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&, bool, std::string&) const'
ros_vio.cc:(.text._ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs4Imu_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE[_ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs4Imu_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE]+0x3c5): undefined reference to `rosbag::Bag::readField(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&, bool, std::string&) const'
ros_vio.cc:(.text._ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs4Imu_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE[_ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs4Imu_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE]+0x3df): undefined reference to `rosbag::Bag::readField(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&, bool, std::string&) const'
CMakeFiles/VIO.dir/src/ros_vio.cc.o: In function `boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > rosbag::Bag::instantiateBuffer<sensor_msgs::Image_<std::allocator<void> > >(rosbag::IndexEntry const&) const':
ros_vio.cc:(.text._ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs6Image_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE[_ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs6Image_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE]+0x3ab): undefined reference to `rosbag::Bag::readField(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&, bool, std::string&) const'
ros_vio.cc:(.text._ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs6Image_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE[_ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs6Image_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE]+0x3c5): undefined reference to `rosbag::Bag::readField(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&, bool, std::string&) const'
CMakeFiles/VIO.dir/src/ros_vio.cc.o:ros_vio.cc:(.text._ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs6Image_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE[_ZNK6rosbag3Bag17instantiateBufferIN11sensor_msgs6Image_ISaIvEEEEEN5boost10shared_ptrIT_EERKNS_10IndexEntryE]+0x3df): more undefined references to `rosbag::Bag::readField(std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&, std::string const&, bool, std::string&) const' follow
CMakeFiles/VIO.dir/src/ros_vio.cc.o: In function `main':
ros_vio.cc:(.text.startup+0x5f): undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)'
ros_vio.cc:(.text.startup+0x216): undefined reference to `ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)'
ros_vio.cc:(.text.startup+0x4c0): undefined reference to `rosbag::Bag::open(std::string const&, unsigned int)'
ros_vio.cc:(.text.startup+0x55e): undefined reference to `rosbag::TopicQuery::TopicQuery(std::vector<std::string, std::allocator<std::string> > const&)'
ros_vio.cc:(.text.startup+0x6db): undefined reference to `rosbag::MessageInstance::getMD5Sum() const'
ros_vio.cc:(.text.startup+0x799): undefined reference to `rosbag::MessageInstance::getMD5Sum() const'
ros_vio.cc:(.text.startup+0xd35): undefined reference to `cv_bridge::toCvShare(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, std::string const&)'
ros_vio.cc:(.text.startup+0x124b): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
ros_vio.cc:(.text.startup+0x13e3): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
ros_vio.cc:(.text.startup+0x1455): undefined reference to `cv_bridge::toCvShare(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, std::string const&)'
ros_vio.cc:(.text.startup+0x19c8): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
ros_vio.cc:(.text.startup+0x1e38): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/VIO.dir/src/ros_vio.cc.o: In function `ros::SubscriptionCallbackHelperT<boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, void>::deserialize(ros::SubscriptionCallbackHelperDeserializeParams const&)':
ros_vio.cc:(.text._ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE[_ZN3ros27SubscriptionCallbackHelperTIRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEvE11deserializeERKNS_43SubscriptionCallbackHelperDeserializeParamsE]+0x5b9): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/VIO.dir/src/MsgSync/MsgSynchronizer.cpp.o: In function `ORBVIO::MsgSynchronizer::getRecentMsgs(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const>&, std::vector<boost::shared_ptr<sensor_msgs::Imu_<std::allocator<void> > const>, std::allocator<boost::shared_ptr<sensor_msgs::Imu_<std::allocator<void> > const> > >&)':
MsgSynchronizer.cpp:(.text+0x19ab): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
MsgSynchronizer.cpp:(.text+0x1b24): undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
CMakeFiles/VIO.dir/src/MsgSync/MsgSynchronizer.cpp.o:MsgSynchronizer.cpp:(.text+0x1bf5): more undefined references to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' follow
collect2: error: ld returned 1 exit status
CMakeFiles/VIO.dir/build.make:268: recipe for target '../VIO' failed
make[2]: *** [../VIO] Error 1
CMakeFiles/Makefile2:163: recipe for target 'CMakeFiles/VIO.dir/all' failed
make[1]: *** [CMakeFiles/VIO.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Launch file in Examples/ROS/ORB_VIO/launch.
Modify the configuration file config/euroc.yaml
Run as: roslaunch ORB_VIO testeuroc.launch

【解决办法】

尝试1:

参考https://github.com/ANYbotics/grid_map/issues/159
采取方式:把gcc的版本从4.8切换到5.4
结果:VIO只走到33%,还不如刚刚了,出现了更多的undefined的东西,而且pangolin也不对经了!
难道我刚刚加的东西有问题???

尝试2:

采取措施:在尝试1的基础上,把CMakeList.txt中的我添加的部分,include_directories()里面的东西取消掉
结果:VIO的编译达到了100%,说明还是有效果的,但是还是出现了如下报错信息:
基本上看起来都是第三方库的原因了,说明还是有进步的,起码有继续一个一个修改的欲望了!明天继续!
对哦,我怀疑现在的问题是c++11标准的问题,明天该CMakeLists.txt中的c++11标准部分,直接启用这个试试 !

[  0%] Built target rospack_genmsg_libexe
[  0%] Built target rosbuild_precompile
Scanning dependencies of target VIO
[ 66%] Building CXX object CMakeFiles/VIO.dir/src/ros_vio.cc.o
[ 66%] Building CXX object CMakeFiles/VIO.dir/src/MsgSync/MsgSynchronizer.cpp.o
[100%] Linking CXX executable ../VIO
../../../../lib/libORB_SLAM2.so: undefined reference to `DBoW2::FORB::toString[abi:cxx11](cv::Mat const&)'
../../../../lib/libORB_SLAM2.so: undefined reference to `pangolin::CreateWindowAndBind(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, pangolin::Params const&)'
../../../../lib/libORB_SLAM2.so: undefined reference to `pangolin::CreatePanel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../../../lib/libORB_SLAM2.so: undefined reference to `pangolin::BindToContext(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
../../../../lib/libORB_SLAM2.so: undefined reference to `g2o::writeCCSMatrix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int const*, int const*, double const*, bool)'
../../../../lib/libORB_SLAM2.so: undefined reference to `pangolin::Split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char)'
../../../../lib/libORB_SLAM2.so: undefined reference to `DBoW2::FORB::fromString(cv::Mat&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
CMakeFiles/VIO.dir/build.make:268: recipe for target '../VIO' failed
make[2]: *** [../VIO] Error 1
CMakeFiles/Makefile2:163: recipe for target 'CMakeFiles/VIO.dir/all' failed
make[1]: *** [CMakeFiles/VIO.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Launch file in Examples/ROS/ORB_VIO/launch.
Modify the configuration file config/euroc.yaml
Run as: roslaunch ORB_VIO testeuroc.launch

尝试3:

采取措施:CMakeLists.txt中的c++11标准直接进行,不搞那些判断的语句了!注释掉试试!
把之前的注释掉!,只保留
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
结果:失败,但是VIO的编译还是能够走到100%的,心塞塞

报错和刚刚一毛一样,说明这样的修改无效!
继续新的尝试~~

尝试4:

采取措施:
(猜测还是OpenCV的问题???)
Step1:修改set(CMAKE_CXXFLAGS)
Step2:set( CMAKE_CXX_FLAGS "-std=c++11 -O3" )
Step3:进入Thirdparty中,把BDOW和G2O下面的build都删掉然后重新编译!

结果:

-- Build files have been written to: /home/hri/catkin_ws/src/LearnVIORB/Examples/ROS/ORB_VIO/build
[  0%] Built target rospack_genmsg_libexe
[  0%] Built target rosbuild_precompile
[ 66%] Building CXX object CMakeFiles/VIO.dir/src/MsgSync/MsgSynchronizer.cpp.o
[ 66%] Building CXX object CMakeFiles/VIO.dir/src/ros_vio.cc.o
[100%] Linking CXX executable ../VIO
../../../../lib/libORB_SLAM2.so: undefined reference to `pangolin::CreateWindowAndBind(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int, pangolin::Params const&)'
../../../../lib/libORB_SLAM2.so: undefined reference to `pangolin::CreatePanel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../../../lib/libORB_SLAM2.so: undefined reference to `pangolin::BindToContext(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
../../../../lib/libORB_SLAM2.so: undefined reference to `pangolin::Split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char)'
collect2: error: ld returned 1 exit status
CMakeFiles/VIO.dir/build.make:268: recipe for target '../VIO' failed
make[2]: *** [../VIO] Error 1
CMakeFiles/Makefile2:163: recipe for target 'CMakeFiles/VIO.dir/all' failed
make[1]: *** [CMakeFiles/VIO.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Launch file in Examples/ROS/ORB_VIO/launch.
Modify the configuration file config/euroc.yaml
Run as: roslaunch ORB_VIO testeuroc.launch

分析:关于BOW和g2o的undefined的报错都没有了,说明采取的措施的第三步奏效了,
那么也就是说Pangolin可能需要重新编译一下???

再进行尝试:

尝试5:

回头看了一下,发现关于Pangolin的报错是从我把gcc/g++的版本从4.8切换到5.4之后才产生的,所以,我是不是要用gcc/g++5.4的形态对pangolin重新进行一次编译?
采取措施:恢复之前的注释掉的关于c++11标准的东西再编译一遍!(和预想的一样,派出了c++11标准的幺蛾子!)
想法:set()一下Pangolin的头文件的路径!应该就是这里的问题了吧!

// --在CMakeLists.txt中添加一下
set( Pangolin_DIR "/usr/local/include/pangolin")

结果:编译都无法通过,说明我添加的是错的,对cmake一无所知!!!
重新添加一下路径
set(pangolin/display)
结果:也不行,VIO的编译通过不了
继续尝试:
set( Pangolin_DIR “/home/hri/ThirdParty/Pangolin-master/CMakeModules”)

结果:还是失败!

我觉得因该是得重新装Pangolin了

尝试6:

分析:网上搜了一下关于undefined reference的报错的帖子,里面都提到了gcc/g++的相关东西,我就在想是不是因为之前环境都是用gcc/g++4.8来弄的,但是这次的ros环境下的东西我又都是在5.4版本下面弄得(前面说了4.8的时候ros上会报错很多),那么就打算重新安装一下pangolin, 在gcc/g++5.4版本下编译!
采取措施:
删掉之前的Pangolin的编译包,/usr/下面那些关于上个版本pangolin的余孽残党不用去管,重新编译的时候会覆盖掉之前那些东西的!
具体方法:
Pangolin的github地址:
https://github.com/stevenlovegrove/Pangolin
下载后正常编译就好了!

然后再编译VIORB的代码,顺利通过如下:

Scanning dependencies of target ORB_SLAM2
[ 11%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/LocalMapping.cc.o
[ 11%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/System.cc.o
[ 23%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/LoopClosing.cc.o
[ 23%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/ORBextractor.cc.o
[ 23%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/ORBmatcher.cc.o
[ 11%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Tracking.cc.o
[ 26%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Converter.cc.o
[ 30%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/FrameDrawer.cc.o
[ 34%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/MapPoint.cc.o
[ 38%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/KeyFrameDatabase.cc.o
[ 42%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/KeyFrame.cc.o
[ 50%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/IMU/imudata.cpp.o
[ 46%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Sim3Solver.cc.o
[ 53%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Map.cc.o
[ 57%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/MapDrawer.cc.o
[ 61%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Frame.cc.o
[ 65%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/IMU/NavState.cpp.o
[ 69%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/PnPsolver.cc.o
[ 73%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Viewer.cc.o
[ 76%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/IMU/so3.cpp.o
[ 80%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Initializer.cc.o
[ 84%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/IMU/configparam.cpp.o
[ 88%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/Optimizer.cc.o
[ 92%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/IMU/IMUPreintegrator.cpp.o
[ 96%] Building CXX object CMakeFiles/ORB_SLAM2.dir/src/IMU/g2otypes.cpp.o
[100%] Linking CXX shared library ../lib/libORB_SLAM2.so
[100%] Built target ORB_SLAM2
Build ROS node ...
mkdir: cannot create directory ‘build’: File exists
[rosbuild] Building package ORB_VIO
[rosbuild] using multiarch 'x86_64-linux-gnu' for finding Boost
-- Using CATKIN_DEVEL_PREFIX: /home/hri/catkin_ws/src/LearnVIORB/Examples/ROS/ORB_VIO/build/devel
-- Using CMAKE_PREFIX_PATH: /home/hri/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/hri/catkin_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Skip enable_testing() for dry packages
-- Using CATKIN_TEST_RESULTS_DIR: /home/hri/catkin_ws/src/LearnVIORB/Examples/ROS/ORB_VIO/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
[rosbuild] Including /opt/ros/kinetic/share/roslisp/rosbuild/roslisp.cmake
[rosbuild] Including /opt/ros/kinetic/share/roscpp/rosbuild/roscpp.cmake
[rosbuild] Including /opt/ros/kinetic/share/rospy/rosbuild/rospy.cmake
Build type: Release
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hri/catkin_ws/src/LearnVIORB/Examples/ROS/ORB_VIO/build
[  0%] Built target rospack_genmsg_libexe
[  0%] Built target rosbuild_precompile
[ 33%] Linking CXX executable ../VIO
[100%] Built target VIO

Launch file in Examples/ROS/ORB_VIO/launch.
Modify the configuration file config/euroc.yaml
Run as: roslaunch ORB_VIO testeuroc.launch

好了!开始在这个上面做点工作吧,希望我可以!

___________________________分割线_________________________________

接下来就是把程序跑起来:
按照github上的东西,造yaml里的结果保存也设置了,数据库路径也设置了,但是出现了:一闪就退出的现象?报错如下:

*** Error in `/home/hri/catkin_ws/src/LearnVIORB/Examples/ROS/ORB_VIO/VIO': free(): invalid pointer: 0x000000000c4880b0 ***

还有这个:

[VIO-1] process has died [pid 3777, exit code -6, cmd /home/hri/catkin_ws/src/LearnVIORB/Examples/ROS/ORB_VIO/VIO /home/hri/catkin_ws/src/LearnVIORB/Examples/ROS/ORB_VIO/../../../Vocabulary/ORBvoc.bin /home/hri/catkin_ws/src/LearnVIORB/Examples/ROS/ORB_VIO/../../../config/euroc.yaml __name:=VIO __log:=/home/hri/.ros/log/869870f0-b26a-11e8-97c8-e4f89cfbde4d/VIO-1.log].
log file: /home/hri/.ros/log/869870f0-b26a-11e8-97c8-e4f89cfbde4d/VIO-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

参考了下这个,可能说是内存不够了!我重启一下试试看看有没有作用,因为我直接输入roscore的时候也显示:

Done checking log file disk usage. Usage is <1GB.

参考了:https://stackoverflow.com/questions/9043685/free-invalid-pointer
所以试一下!

猜你喜欢

转载自blog.csdn.net/Amazingren/article/details/82357179