博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu14.04运行lsdslam与问题解决
阅读量:6300 次
发布时间:2019-06-22

本文共 7723 字,大约阅读时间需要 25 分钟。

本文是在Ubuntu14.04中运行LSDSLAM的步骤以及出现的一系列问题的解决,最终可以运行数据集和实时运行

基本环境:Ubuntu14.04  opencv3.1.0  但是有问题,因此后来又安装了opencv2.4.9。感谢大佬。

前序的工作和该博主完全一致:

 

出现的问题:

已解决:raise Exception(r"""quotes not allowed in description string '%s'""" % description)

不应该在描述中出现引号(单引号或双引号),可以通过查看错误内容得知需要修改的文件名:1) lsd_slam_viewer/cfg/LSDSLAMViewerParams.cfg第20行scaledDepthVarTH:单词 point's和keyframe's 中出现了单引号,删除单引号第21行absDepthVarTH:单词 point's第24行cutFirstNKf:单词 keyframe's 2) lsd_slam_core/cfg/LSDDebugParams.cfg第11行plotStereoImages:单词 what's第12行plotTracking:单词 what's第48行continuousPCOutput:单词 Keyfram's

 

 

之后,

出现新的问题:

 main_stitchVideos.cpp:(.text+0x8f30): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0x8fc9): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0x8fdb): undefined reference to `cv::String::deallocate()'

  CMakeFiles/videoStitch.dir/src/main_stitchVideos.cpp.o: In function `inlayVid(int, char**)':

  main_stitchVideos.cpp:(.text+0x9c62): undefined reference to `cv::imread(cv::String const&, int)'

  main_stitchVideos.cpp:(.text+0x9c6a): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0x9cb3): undefined reference to `cv::imread(cv::String const&, int)'

  main_stitchVideos.cpp:(.text+0x9cbd): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0x9d02): undefined reference to `cv::imread(cv::String const&, int)'

  main_stitchVideos.cpp:(.text+0x9d0c): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0x9d5a): undefined reference to `cv::imread(cv::String const&, int)'

  main_stitchVideos.cpp:(.text+0x9d67): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0x9db1): undefined reference to `cv::imread(cv::String const&, int)'

  main_stitchVideos.cpp:(.text+0x9dbe): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0xa629): undefined reference to `cv::String::allocate(unsigned long)'

  main_stitchVideos.cpp:(.text+0xa654): undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'

  main_stitchVideos.cpp:(.text+0xa661): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0xa6c6): undefined reference to `cv::String::allocate(unsigned long)'

  main_stitchVideos.cpp:(.text+0xa6e7): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'

  main_stitchVideos.cpp:(.text+0xa6f4): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0xaec5): undefined reference to `cv::String::allocate(unsigned long)'

  main_stitchVideos.cpp:(.text+0xaee8): undefined reference to `cv::String::allocate(unsigned long)'

  main_stitchVideos.cpp:(.text+0xaf08): undefined reference to `cv::String::allocate(unsigned long)'

  main_stitchVideos.cpp:(.text+0xaf28): undefined reference to `cv::String::allocate(unsigned long)'

  main_stitchVideos.cpp:(.text+0xaf46): undefined reference to `cv::String::allocate(unsigned long)'

  main_stitchVideos.cpp:(.text+0xb146): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0xb1e2): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0xb20e): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0xb23f): undefined reference to `cv::String::deallocate()'

  main_stitchVideos.cpp:(.text+0xb270): undefined reference to `cv::String::deallocate()'

  CMakeFiles/videoStitch.dir/src/main_stitchVideos.cpp.o:main_stitchVideos.cpp:(.text+0xb33e): more undefined references to `cv::String::deallocate()' follow

  collect2: error: ld returned 1 exit status

  make[3]: *** [../bin/videoStitch] Error 1

  make[3]: Leaving directory `/home/zc/rosbuild_ws/package_dir/lsd_slam/lsd_slam_viewer/build'

  make[2]: *** [CMakeFiles/videoStitch.dir/all] Error 2

  make[2]: Leaving directory `/home/zc/rosbuild_ws/package_dir/lsd_slam/lsd_slam_viewer/build'

  make[1]: *** [all] Error 2

  make[1]: INTERNAL: Exiting with 3 jobserver tokens available; should be 2!

  make[1]: Leaving directory `/home/zc/rosbuild_ws/package_dir/lsd_slam/lsd_slam_viewer/build'

-------------------------------------------------------------------------------}

 

好像是因为opencv版本的问题,

pkg-config --modversion opencv

查看后发现是3.1.0

想办法解决。

找到了:

解决:   在lsd_slam_viewer中的CMAKELISTS.txt的最后加上:    find_package(OpenCV REQUIRED)     rosbuild_add_executable(videoStitch src/main_stitchVideos.cpp)    target_link_libraries(videoStitch ${OpenCV_LIBS})    

 接着还有一个报错,是在lsd_slam_core路径中的错误:

解决:在lsd_slam_core中的CMAKELISTS.txt的最后增加boost_system库的链接:       find_package(OpenCV REQUIRED)        # build live ros node        rosbuild_add_executable(live_slam src/main_live_odometry.cpp)        target_link_libraries(live_slam lsdslam boost_system ${OpenCV_LIBS})        # build image node        rosbuild_add_executable(dataset_slam src/main_on_images.cpp)        target_link_libraries(dataset_slam lsdslam boost_system ${OpenCV_LIBS})

然后还有一个错误:

/usr/bin/ld: cannot find -lglut

解决方法:我的是so.3   使用命令   locate libglut  找到的

ln -sv libglut.so.3 libglut.so

 

 

 

 

使用数据集来跑

参考:

(1)下载

(2)roscore

(3)rosrun lsd_slam_viewer viewer

(4)rosrun lsd_slam_core live_slam image:=/image_raw camera_info:=/camera_info

(5)rosbag play dataset/LSD_room.bag

将上述命令中的dataset/LSD_room.bag替换为你之前下载的数据集的所在的路径

 

然后出现问题:

 

zc@ubuntu:~ $ rosrun lsd_slam_core live_slam image:=/image_raw camera_info:=/camera_info

WAITING for ROS camera calibration!
Received ROS Camera Calibration: fx: 254.326950, fy: 375.934387, cx: 267.381897, cy: 231.599091 @ 640x480
RECEIVED ROS camera calibration!
Started mapping thread!
Doing Random initialization!
Started constraint search thread!
Started optimization thread
Segmentation fault (core dumped)

 

 

 

需要做的是到目录

lsd_slam/lsd_slam_core/src/util/settings.cpp

把其中的

bool displayDepthMap = true;

改成

//bool displayDepthMap = true;bool displayDepthMap = false;

 这一步就是把debugdepth的那个界面不显示。

点云图正常显示。

然后就会出现新的问题:

rosrun lsd_slam_core live_slam image:=/image_raw camera_info:=/camera_info

WAITING for ROS camera calibration!
Received ROS Camera Calibration: fx: 254.326950, fy: 375.934387, cx: 267.381897, cy: 231.599091 @ 640x480
RECEIVED ROS camera calibration!
Doing Random initialization!
Started mapping thread!
Started constraint search thread!
Started optimization thread
Done Random initialization!
TRACKING LOST for frame 50 (0.00% good Points, which is 18.18% of available points, DIVERGED)!
warning: reciprocal tracking on new frame failed badly, added odometry edge (Hacky).

 

图片有显示,

 

 如果这个时候运行实时的命令,那么将会在优化线程的一步卡死。

最后发现是opencv的版本问题,一开始用的是opencv3.1.0,最后修改成2.4.9解决问题,参考如下:

然后这边对于opencv的解决方法:https://www.cnblogs.com/hxzkh/p/8488132.html    LSDSLAMhttps://www.cnblogs.com/hxzkh/p/8473190.html    ORBSLAM  中的opencv解决参考解决方法:https://answers.ros.org/question/219063/segmentation-fault-in-lsd_slam/https://blog.csdn.net/osgoodwu/article/details/79900620github上哟一个:https://github.com/tum-vision/lsd_slam/issues/30

 

 

最后这个问题发现其实是opencv版本的问题,我的是3.1.0,之后又安装了一个2.4.9的opencv,然后就可以了:

安装一个opencv2.4.9

然后更改:

然后编辑 lsd_slam_core 下的 CMakeLists.txt 文件,11行左右添加:set(OpenCV_DIR ~/opencv-2.4.9/share/OpenCV)include_directories(~/opencv-2.4.9/include)find_package(cmake_modules REQUIRED)
然后编辑 lsd_slam_viewer 下的 CMakeLists.txt 文件,11行左右添加:set(OpenCV_DIR ~/opencv-2.4.9/share/OpenCV)include_directories(~/opencv-2.4.9/include)find_package(cmake_modules REQUIRED)

就可以运行数据集了。

 

 

 

 

实时跑起来:

(1)启动摄像头相关参考,主要是安装usb_cam

 

1. roscore2. rosrun lsd_slam_viewer viewer3. rosrun usb_cam usb_cam_node4. rosrun image_view image_view image:=/usb_cam/image_raw5. rosrun lsd_slam_core live_slam /image:=/usb_cam/image_raw _calib:=/home/zhangchi/Desktop/LSDSlamDataset/LSD_room/cameraCalibration.cfg 其中的calib的路径偷懒直接使用了数据集中的

 

转载于:https://www.cnblogs.com/1228073191Blog/p/10919650.html

你可能感兴趣的文章
Spring+SpringMVC+Hibernate简单整合(转)
查看>>
Zulip 2.0.3 发布,功能强大的群组聊天软件
查看>>
Maven更新POM中的JDK版本(比如更新为JDK1.8)
查看>>
笨办法学 Python · 续 第七部分:大作业
查看>>
区块链应用 | 不要否认区块链十年来的进展,它已经改变了很多事情
查看>>
沃•云总机以互联网+SaaS模式助力河南房产行业信息化
查看>>
数据结构思维 第七章 到达哲学
查看>>
MAC上快速调出终端的设置(保持和Windows的操作一致)
查看>>
SQL更新id段之间的字段
查看>>
阿里云ECS,突发性能实例t5购买参考和使用建议
查看>>
.NET轻量级ORM框架Dapper入门精通
查看>>
量子卫星是何物?快戳进来涨姿势!
查看>>
AI诊断又有新算法,让人们提前10年知道自己是否会老年痴呆
查看>>
商用无人机被“锁”住了螺旋桨,送货机器人却已经开始满地跑了
查看>>
凯迪生态携手海通安恒,成功启动SAP实施项目
查看>>
Java的对象和类
查看>>
格式化字符串漏洞利用 一、引言
查看>>
Oracle NetSuite推出全球首款智能云套件
查看>>
软件项目进度控制表(自制)
查看>>
企业若不改进其IT运营模式则可能错失未来市场机遇
查看>>