Giter Site home page Giter Site logo

slambook's Introduction

NOTE

Slambook 2 has be released since 2019.8 which has better support on Ubuntu 18.04 and has a lot of new features. Slambook 1 will still be available on github but I suggest new readers switch to the second version.

Slambook-en has also been completed recently.

slambook

This is the code written for my new book about visual SLAM called "14 lectures on visual SLAM" which was released in April 2017. It is highy recommended to download the code and run it in you own machine so that you can learn more efficiently and also modify it. The code is stored by chapters like "ch2" and "ch4". Note that chapter 9 is a project so I stored it in the "project" directory.

If you have any questions about the code, please add an issue so I can see it. Contact me for more information: gao dot xiang dot thu at gmail dot com.

These codes are under MIT license. You don't need permission to use it or change it. Please cite this book if you are doing academic work: Xiang Gao, Tao Zhang, Yi Liu, Qinrui Yan, 14 Lectures on Visual SLAM: From Theory to Practice, Publishing House of Electronics Industry, 2017.

In LaTeX: @Book{Gao2017SLAM, title={14 Lectures on Visual SLAM: From Theory to Practice}, publisher = {Publishing House of Electronics Industry}, year = {2017}, author = {Xiang Gao and Tao Zhang and Yi Liu and Qinrui Yan}, }

Contents

  • ch1 Preface
  • ch2 Overview of SLAM & linux, cmake
  • ch3 Rigid body motion & Eigen
  • ch4 Lie group and Lie Algebra & Sophus
  • ch5 Cameras and Images & OpenCV
  • ch6 Non-linear optimization & Ceres, g2o
  • ch7 Feature based Visual Odometry
  • ch8 Direct (Intensity based) Visual Odometry
  • ch9 Project
  • ch10 Back end optimization & Ceres, g2o
  • ch11 Pose graph and Factor graph & g2o, gtsam
  • ch12 Loop closure & DBoW3
  • ch13 Dense reconstruction & REMODE, Octomap

slambook (中文说明)

我最近写了一本有关视觉SLAM的书籍,这是它对应的代码。书籍将会在明年春天由电子工业出版社出版。

我强烈建议你下载这个代码。书中虽然给出了一部分,但你最好在自己的机器上编译运行它们,然后对它们进行修改以获得更好的理解。这本书的代码是按章节划分的,比如第二章内容在”ch2“文件夹下。注意第九章是工程,所以我们没有”ch9“这个文件夹,而是在”project“中存储它。

如果你在运行代码中发现问题,请在这里提交一个issue,我就能看到它。如果你有更多的问题,请给我发邮件:gaoxiang12 dot mails dot tsinghua dot edu dot cn.

本书代码使用MIT许可。使用或修改、发布都不必经过我的同意。不过,如果你是在学术工作中使用它,建议你引用本书作为参考文献。

引用格式: 高翔, 张涛, 颜沁睿, 刘毅, 视觉SLAM十四讲:从理论到实践, 电子工业出版社, 2017

LaTeX格式: @Book{Gao2017SLAM, title={视觉SLAM十四讲:从理论到实践}, publisher = {电子工业出版社}, year = {2017}, author = {高翔 and 张涛 and 刘毅 and 颜沁睿}, lang = {zh} }

目录

  • ch2 概述,cmake基础
  • ch3 Eigen,三维几何
  • ch4 Sophus,李群与李代数
  • ch5 OpenCV,图像与相机模型
  • ch6 Ceres and g2o,非线性优化
  • ch7 特征点法视觉里程计
  • ch8 直接法视觉里程计
  • ch9 project
  • ch10 Ceres and g2o,后端优化1
  • ch11 g2o and gtsam,位姿图优化
  • ch12 DBoW3,词袋方法
  • ch13 稠密地图构建

关于勘误,请参照本代码根目录下的errata.xlsx文件。此文件包含本书从第一次印刷至现在的勘误信息。勘误将随着书籍的印刷版本更新。

备注

百度云备份:[https://pan.baidu.com/s/1slDE7cL] Videos: [https://space.bilibili.com/38737757]

slambook's People

Contributors

delyex avatar gaoxiang12 avatar gaunthan avatar jimzhou-001 avatar lsxiang avatar mactarvish avatar robotlearner1 avatar tyuownu avatar whubaichuan avatar x007dwd avatar yuyucong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slambook's Issues

make error

高老师您好:
我也是16.04的系统,在做ch5时,编译后没有出现找不到vtkproj4的问题,但cmake成功后 make到50%出现如下错误: No rule to make target '/usr/lib/x86_64-linux-gnu/libproj.so', needed by 'joinMap'. Stop 试了上述解决办法,和其他办法均不行,不会也是bug吧!望老师能指导一下,谢谢!

解决了:找出相应.so 文件 ln到 目标目录下即可

ch5 joinMap PCL installation

按照书中写的步骤安装pcl的时候,收到如下提示:
ch5/joinMap/build$ sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
This only exists for history reasons. Please use the PCL version included in Ubuntu:
sudo apt install libpcl-dev
于是我就cancel了,然后用sudo apt install libpcl-dev安装pcl。
安装完成后,$ cmake .. 的时候出现如下错误:
...
-- Checking for module 'libopenni2'
-- No package 'libopenni2' found
-- Could NOT find OpenNI2 (missing: OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS)
** WARNING ** io features related to openni2 will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- The imported target "vtkRenderingPythonTkWidgets" references the file
"/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.
  • An install or uninstall procedure did not complete successfully.
  • The installation package was faulty and contained
    "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
    but not all the files it references.

-- The imported target "vtk" references the file
"/usr/bin/vtk"
but this file does not exist. Possible reasons include:

  • The file was deleted, renamed, or moved to another location.
  • An install or uninstall procedure did not complete successfully.
  • The installation package was faulty and contained
    "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
    but not all the files it references.

-- looking for PCL_COMPONENT
-- Could NOT find PCL_COMPONENT (missing: PCL_COMPONENT_LIBRARY PCL_COMPONENT_INCLUDE_DIR)
...
请问pcl能用Ubuntu1604的预编版吗?还是一定要按照书中的步骤安装?
谢谢。

运行第七章pose_estimation_3d2d程序时终端提示double free or corruption(out)

我的系统是ubuntu16.04 ,初步判定问题出在bundle adjustment那个函数里面产生了内存泄露,但当我把相机参数对象的初始化改为默认构造函数后:
g2o::CameraParameters* camera = new g2o::CameraParameters()
程序就可以运行了,但是输出最终的位姿T后终端会提示段错误。不知道有人遇到跟我一样的问题吗?

ch3.visualizeGeometry

可爱的高博士您好,我在VMstation上运行visualizeGeometry程序的时候,
也遇到了报错“what(): Pangolin X11: Unable to retrieve framebuffer options”,
但没看懂...paulinus 提出的解决办法...
是要修改Pangolin/src/display/device/display_x11.cpp文件中,paulinus标记的123行处的注释内容么?
期待着您的回复,十万分谢谢您!

ch11/pose_graph_gtsam.cpp

问题1
注释里说
// 固定第一个顶点,在gtsam中相当于添加一个先验因子

但随后的代码里面把所有初始值都构造先验因子加入到graph中

问题2
从gtsam的注释来看,要固定顶点应该是使用NonlinearEquality

ch5/joinMap中VTK的问题

报错,但是依然可以编译通过

-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono
--   atomic
--   regex
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

-- looking for PCL_COMPONENT
-- Could NOT find PCL_COMPONENT (missing:  PCL_COMPONENT_LIBRARY PCL_COMPONENT_INCLUDE_DIR) 
-- looking for PCL_COMMON
-- looking for PCL_OCTREE
-- looking for PCL_IO
-- Configuring done
-- Generating done
-- Build files have been written to:

https://stackoverflow.com/questions/37369369/compiling-pcl-1-7-on-ubuntu-16-04-errors-in-cmake-generated-makefile
这里的提问好像是 vtk的问题,不知道有没有办法消除这个问题?

咨询openNI1.x版本以CMakeList.txt方式在程序中导入问题

高博士,不好意思又要来打扰你了。
我在你ch9的project上修改了一下,打算用Kinect V1 测试运行VO那部分程序。安装的驱动组合为OpenNI1.5.7+Sensor5.1+nite1.5.2。在物理机中,openni的所有示例都能正常运行。在程序中我仿照其他库的书写方式,include_directories("usr/include/ni"),以及target_link_liraries他的库,程序编译时总是提示一些文件不存在。。。而这个文件就在usr/include/ni下面。。。不知道你有木有这么使用过,给我提供一些经验提示,网上能找到的都是OpenNI2+freenect的,改了改也不管什么用。 先谢谢了。

Book Language

Hello
I am pleased to hear that the book will be released this month.
BTW, does that book is written in English or Chinese?
I am one of the people who is looking forward your book.
Thank you.

第5章PCL软件源?

W: 仓库 “http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu xenial Release” 没有 Release 文件。
N: 无法认证来自该源的数据,所以使用它会带来潜在风险。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 无法下载 http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。

这是终端提示,安装PCL时提示的,应该是软件源没有更新吧?

第九章0.4版本代码有个地方不是很理解,希望各位有空可以帮忙解答

在第0.4版本的时候
if ( iter->second->good_ == false )
{
// TODO try triangulate this map point

    }

这里面我查了一下,好像并没有定义什么是好的点,所有MapPoint创建是都是用的true?可能是我没有找得完全,希望各位解答一下!我在这段里面写了一个cout,全程运行TMU的rgbd_dataset_freiburg1_desk数据集,并没有看到输出信息!所以特此来请教各位!

关于第5讲操作Opencv图像中头文件引入的两个小疑问

我们在imageBasics.cpp中包含了opencv2的两个头文件:

#include <opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>

好奇的打开了这两个文件,发现他们分别引入的是上一级目录opencv2根目录下的core.hpp和highgui.hpp,
例如opencv2/core/core.hpp文件中内容只有:


#ifdef __OPENCV_BUILD
#error this is a compatibility header which should not be used inside the OpenCV library
#endif

#include "opencv2/highgui.hpp"

想请问高博,我们实际中,以及本例中采用这么一种调用方式而不直接#include <opencv2/core.hpp>的原因是什么呢?
另外,代码中说this is a compatibility header which should not be used inside the OpenCV library,是指我们不该用这个程序么?

麻烦您解答一下我的小疑惑,谢谢您了。

ch5 joinMap exit code 139

运行例程ch5 中的点云拼接程序,报错
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

大概是溢出的问题,具体原因不得而知。
定位问题 到代码第36行:
poses.push_back( T );

修改意见:将poses定义为数列。
第15行: vectorEigen::Isometry3d poses; // 相机位姿
修改为: Eigen::Isometry3d poses[5];

再运行 就成功了。
希望能帮助到和我遇到相同问题的人!

ch4 sophus编译出错

按照书上的要求获取了非模板类的Sophus
编译时出现错误
/Users/wangcaimeng/Sophus/sophus/so2.cpp:32:24: error: expression is not
assignable
unit_complex_.real() = 1.;

/Users/wangcaimeng/Sophus/sophus/so2.cpp:33:24: error: expression is not
    assignable
unit_complex_.imag() = 0.;
~~~~~~~~~~~~~~~~~~~~ ^
2 errors generated.
make[2]: *** [CMakeFiles/Sophus.dir/sophus/so2.cpp.o] Error 1
make[1]: *** [CMakeFiles/Sophus.dir/all] Error 2
make: *** [all] Error 2

求指点

高博能否用百度云分享能正确运行程序的虚拟机?

高博能否用百度云分享能正确运行程序的虚拟机?我在实现书上的例子的时候,总感觉结果不太对,利用估计的位置重建世界时,差异很大,经过了g2o优化也不行,所以想高博能否分享一个虚拟机,可以对照找出自己的问题。

第三讲-3.2实践Eigen中一个小错误

高博士您好,

在书本P45页关于Eigen库使用的练习代码,最下方for循环内,由于Matrix_23是一个2行3列矩阵,行坐标i的外层循应为i<2而不是i<1,内层列j的循环应该将判决条件j<2改为j<3。

在配套的代码里均是正确的,望课本的内容也相应更新下。

祝好。

小智

Conversion from pangolin::OpenGlMatrix to Eigen::Matrix

I am getting the following error when trying to build visualizeGeometry:

error: conversion from ‘pangolin::OpenGlMatrix’ to non-scalar type ‘Eigen::Matrix<double, 4, 4>’ requested
         Matrix<double,4,4> m = matrix;

ch6 g2o_curve_fitting. no matching function for call to ...

Those days when I try to compile ch6's g2o code, I got an error with
error: no matching function for call to ‘g2o::BlockSolver<g2o::BlockSolverTraits<3, 1>>::BlockSolver(g2o::BlockSolver<g2o::BlockSolverTraits<3, 1> >::LinearSolverType*&). I run the code on a virtual machine with Ubuntu-16.04 installed.

Then I found a solution in g2o's example. See following code.

typedef g2o::BlockSolver<g2o::BlockSolverTraits<3, 1> > Block;
typedef g2o::LinearSolverDense<Block::PoseMatrixType> MyLinearSolver;
// Block::LinearSolverType* linearSolver = new g2o::LinearSolverDense<Block::PoseMatrixType> ();
// Block* solver_ptr = new Block(linearSolver);
g2o::OptimizationAlgorithmLevenberg* solver = new g2o::OptimizationAlgorithmLevenberg(
        g2o::make_unique<Block>(g2o::make_unique<MyLinearSolver>())
);

I am not sure what's the problem, but anyway it was solved. So I post it here in case you have the same problem.

Thanks for your informative book. 👍

关于第五章joinMap代码的几点疑问

高博您好:最近学习您的SLAM14讲的过程中有一些疑问,是关于第五章JoinMap代码的。在这个代码中有两处我不是很理解:
第一处:代码的31行:for(auto& d:data),不是很理解这里的取地址符&的作用是什么,感觉不加也没有什么问题。
第二处:代码的69行,根据公式应该是Pc=TPw,但是这里进行逆运算为什么是Pw=TPc,不是很理解。
麻烦高博百忙之中给予解答,谢谢!

ch5 CMakeList.txt error

高博您好:请教一个问题~~~
我使用ubuntu16.04,build时显示:
/usr/bin/ld: cannot find -lvtkproj4
collect2: error: ld returned 1 exit status
CMakeFiles/joinMap.dir/build.make:350: recipe for target 'joinMap' failed
make[2]: *** [joinMap] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/joinMap.dir/all' failed
Makefile:83: recipe for target 'all' failed
make[1]: *** [CMakeFiles/joinMap.dir/all] Error 2
make: *** [all] Error 2
*** Failure: Exit code 2 ***
怎么解决?

C12 make feature_training.cpp报错

您好.我在编译字典训练这部分时出错,如下所示:(仅是部分错误)
Vocabulary.cpp:(.text._ZN5DBoW310Vocabulary6createERKSt6vectorIN2cv3MatESaIS3_EE+0x27a):对‘cv::fastFree(void*)’未定义的引用
Vocabulary.cpp:(.text._ZN5DBoW310Vocabulary6createERKSt6vectorIN2cv3MatESaIS3_EE+0x2c2):对‘cv::Mat::Mat(cv::Mat const&, cv::Range const&, cv::Range const&)’未定义的引用
全是与cv::有关的错误
请问到底是什么原因呢?已经安装了opencv 3.但是同时之前也安装过opencv 2.4.9

ch4/useSophus Error

~/slambook/ch4/useSophus$ make
Scanning dependencies of target useSophus
[ 50%] Building CXX object CMakeFiles/useSophus.dir/useSophus.cpp.o
[100%] Linking CXX executable useSophus
CMakeFiles/useSophus.dir/useSophus.cpp.o:在函数‘main’中:
useSophus.cpp:(.text+0xd1):对‘Sophus::SO3::SO3(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&)’未定义的引用
useSophus.cpp:(.text+0xf4):对‘Sophus::SO3::SO3(double, double, double)’未定义的引用
useSophus.cpp:(.text+0x126):对‘Sophus::SO3::SO3(Eigen::Quaternion<double, 0> const&)’未定义的引用
useSophus.cpp:(.text+0x1d2):对‘Sophus::SO3::log() const’未定义的引用
useSophus.cpp:(.text+0x232):对‘Sophus::SO3::hat(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)’未定义的引用
useSophus.cpp:(.text+0x27c):对‘Sophus::SO3::hat(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)’未定义的引用
useSophus.cpp:(.text+0x295):对‘Sophus::SO3::vee(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&)’未定义的引用
useSophus.cpp:(.text+0x341):对‘Sophus::SO3::exp(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)’未定义的引用
useSophus.cpp:(.text+0x361):对‘Sophus::SO3::operator*(Sophus::SO3 const&) const’未定义的引用
useSophus.cpp:(.text+0x41a):对‘Sophus::SE3::SE3(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)’未定义的引用
useSophus.cpp:(.text+0x43a):对‘Sophus::SE3::SE3(Eigen::Quaternion<double, 0> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)’未定义的引用
useSophus.cpp:(.text+0x4cf):对‘Sophus::SE3::log() const’未定义的引用
useSophus.cpp:(.text+0x52f):对‘Sophus::SE3::hat(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)’未定义的引用
useSophus.cpp:(.text+0x586):对‘Sophus::SE3::hat(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)’未定义的引用
useSophus.cpp:(.text+0x59f):对‘Sophus::SE3::vee(Eigen::Matrix<double, 4, 4, 0, 4, 4> const&)’未定义的引用
useSophus.cpp:(.text+0x642):对‘Sophus::SE3::exp(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)’未定义的引用
useSophus.cpp:(.text+0x662):对‘Sophus::SE3::operator*(Sophus::SE3 const&) const’未定义的引用
useSophus.cpp:(.text+0x67b):对‘Sophus::SE3::matrix() const’未定义的引用
CMakeFiles/useSophus.dir/useSophus.cpp.o:在函数‘Sophus::operator<<(std::ostream&, Sophus::SO3 const&)’中:
useSophus.cpp:(.text._ZN6SophuslsERSoRKNS_3SO3E[_ZN6SophuslsERSoRKNS_3SO3E]+0x2e):对‘Sophus::SO3::log() const’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/useSophus.dir/build.make:94: recipe for target 'useSophus' failed
make[2]: *** [useSophus] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/useSophus.dir/all' failed
make[1]: *** [CMakeFiles/useSophus.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

ch6/g2o_curve_fitting/CMakeLists.txt issue

After checking cmake_modules/FindG2O.cmake, I think the following part of the CMakeLists.txt of g2o_curve_fitting should be adjusted:

  1. ${G2O_INCLUDE_DIRS} should be ${G2O_INCLUDE_DIR}, which is a variable generated by FindG2O.
target_link_libraries( curve_fitting 
    ${OpenCV_LIBS}
    g2o_core g2o_stuff
)

should be

target_link_libraries( curve_fitting 
    ${OpenCV_LIBS}
    ${G2O_CORE_LIBRARY} ${G2O_STUFF_LIBRARY}
)

Without modifying 1, I can still build the code without problem. It's because /usr/local/include is in my default header search path.
Without modifying 2, I got the following error when run curve_fitting (since my library load path does not contain /usr/local/lib )

error while loading shared libraries: libg2o_core.so: cannot open shared object file: No such file or directory

使用单应矩阵估计相机姿态问题

我使用RGB匹配点,用findHomography求解H,通过H分解求出四个R、T,然后求解出欧拉角。现在问题是,不知道怎么从四组R里面选取出我需要的那一组。
已知:

  1. 传感器用的是Xtion,可以知道深度,然后用法向量么?麻烦了解的帮我详细说一下。
    我看到高博在《视觉SLAM》书里有说,带入检测深度,恕我愚钝,未想明白。
  2. 为什么有时候分解H出来的只有一组值,有时候有四组?我用的是OpenCV3的decomposeHomographyMat函数。

如果这里不方便写,大家也可以在知乎分享,不胜感激。
知乎链接

ch12 vocabulary.yaml.gz

the vocabulary.yaml.gz that I create is different from yours ,but they are very similar .here I put some difference when I extract the file .
this is original:
%YAML:1.0
vocabulary:
k: 10
L: 5
scoringType: 0
weightingType: 0
nodes:
- { nodeId:1, parentId:0, weight:0.,
descriptor:"0 32 27 159 99 205 118 146 238 119 125 72 94 230 121 238 182 228 126 239 23 237 197 184 37 239 54 110 170 128 47 174 121 221 " }

this is mine:
%YAML:1.0
vocabulary:
k: 10
L: 5
scoringType: 0
weightingType: 0
nodes:
- { nodeId:1, parentId:0, weight:0.,
descriptor:dbw3 0 32 27 159 99 205 118 146 238 119 125 72 94 230 121 238 182 228 126 239 23 237 197 184 37 239 54 110 170 128 47 174 121 221 }

please notice the last two line,it add the word "dbw3",I do not know why .for the difference, the next program can not recognize the file.please help me fix this

cs.h:No such file or diretory

高老师你好,当我运行ch7/pose_estimation_3d2d.cpp时,其中include <g2o/solvers/csparse/linear_solver_csparse.h>,出现cs.h:No such file or diretory,自己尝试后发现解决不了,希望百忙中能抽空回复下我的问题,谢谢。

useSophus.cpp:8:24: fatal error: sophus/so3.h

高博你好:
在实践Sophus中 报错fatal error: sophus/so3.h: No such file or directory #include "sophus/so3.h"

Sophus:
安装过程:
git checkout a621ff
mkdir build
cd build
cmake ..
make

useSophus.cpp的CMakeLists.txt Sophus配置find_package( Sophus REQUIRED )
include_directories( ${Sophus_INCLUDE_DIRS} )

系统
ubuntu14.04
请问怎么解决这个错误。 电脑中配置过lsd_slam。

课后习题

高博是否可以提供一下课后的习题一些参考。
例如第三讲中的最后一题小萝卜头的位姿。

ch4 CMakeLists问题

CMakeLists中好像没有加Eigen,因此make不能通过...
报错如下:
fatal error: Eigen/Core: 没有那个文件或目录
#include <Eigen/Core>

第九章Project运行出现段错误,怎么解决?

Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `bin/run_vo config/default.yaml'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0xb77a4501 in myslam::Frame::Frame(long, double, Sophus::SE3, std::shared_ptrmyslam::Camera, cv::Mat, cv::Mat) () from /home/dan/work/project/0.4/lib/libmyslam.so
(gdb) bt
#0 0xb77a4501 in myslam::Frame::Frame(long, double, Sophus::SE3, std::shared_ptrmyslam::Camera, cv::Mat, cv::Mat) () from /home/dan/work/project/0.4/lib/libmyslam.so
#1 0xb77a47ef in myslam::Frame::createFrame() () from /home/dan/work/project/0.4/lib/libmyslam.so
#2 0x0804b4d6 in main ()

Sophus库无法正常编译安装,导致凡是有Sophus库的项目都不能正常运行?

CMake Warning (dev) at CMakeLists.txt:76 (GET_TARGET_PROPERTY):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

The LOCATION property should not be read from target "Sophus". Use the
target name directly with add_custom_command, or use the generator
expression $<TARGET_FILE>, as appropriate.

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:57 (ADD_LIBRARY):
Policy CMP0038 is not set: Targets may not link directly to themselves.
Run "cmake --help-policy CMP0038" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Target "Sophus" links to itself.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring done
CMake Warning (dev) at CMakeLists.txt:57 (ADD_LIBRARY):
Policy CMP0038 is not set: Targets may not link directly to themselves.
Run "cmake --help-policy CMP0038" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Target "Sophus" links to itself.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:57 (ADD_LIBRARY):
Policy CMP0038 is not set: Targets may not link directly to themselves.
Run "cmake --help-policy CMP0038" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Target "Sophus" links to itself.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:57 (ADD_LIBRARY):
Policy CMP0038 is not set: Targets may not link directly to themselves.
Run "cmake --help-policy CMP0038" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.

Target "Sophus" links to itself.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/gr/Sophus/build


因为是新人不知道如何修改Sophus库使其正常运行,求教大神。。

第9章0.4部分代码的问题

第9章0.4代码中visual_odometry.cpp中checkEstimatedPose成员函数中T_r_c = ref_->T_c_w_ * T_c_w_estimated_.inverse();是不是应该写成T_r_c = T_c_w_estimated_ref_->T_c_w_.inverse();
因为这里的T_c_w_estimated_相当于当前帧的T_c_w_,由于curr_->T_c_w_=T_r_c
ref_->T_c_w_
此式两端同时右乘ref_->T_c_w_.inverse(),即变为T_r_c = T_c_w_estimated_*ref_->T_c_w_.inverse();
是这样子来的吗?新手,如有不对的地方还请高博指点

ch5点云拼接auto& d:data编译出错

有遇到如下编译报错的小伙伴么,还在学C++,学的不够多,不知如何改正,求指点,谢谢你们!
/home/zjc19941015/slambook/ch55/joinMap.cpp:31:12: error: ISO C++ forbids declaration of ‘d’ with no type [-fpermissive]
for (auto& d:data)
^
/home/zjc19941015/slambook/ch55/joinMap.cpp:31:14: error: range-based ‘for’ loops are not allowed in C++98 mode
for (auto& d:data)
^

想问问关于Kdevelop的使用

按照第二章的步骤操作了
想要调试时会出现无法启动调试器
“/home/pc/ch2/useHello.cpp”不能运行。请确认您指定的路径名无误。

ch4 page71 笔误

高博您好,
第四章71页最下边的图4-1,在三维变换中李代数那个block里面,最后的\zeta^{^}矩阵表达式右下角是否应该为1?

关于第八章稀疏直接法代码的一个问题

// check x,y is in the image
if ( x-4<0 || ( x+4 ) >image_->cols || ( y-4 ) <0 || ( y+4 ) >image_->rows )
{
_error ( 0,0 ) = 0.0;
this->setLevel ( 1 );
}

这段代码中的4是个经验数值?按理说x应该可以取0到cols-1之间的啊

ch4 useSophus 编译错误

ubuntu 16.04, 用的是非模板版本Sophus库,错误如下,请帮忙看一下,谢谢!

[ 50%] Linking CXX executable useSophus
CMakeFiles/useSophus.dir/useSophus.cpp.o: In function main': useSophus.cpp:(.text+0xd1): undefined reference to Sophus::SO3::SO3(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&)'
useSophus.cpp:(.text+0xf4): undefined reference to Sophus::SO3::SO3(double, double, double)' useSophus.cpp:(.text+0x126): undefined reference to Sophus::SO3::SO3(Eigen::Quaternion<double, 0> const&)'
useSophus.cpp:(.text+0x1d2): undefined reference to Sophus::SO3::log() const' useSophus.cpp:(.text+0x232): undefined reference to Sophus::SO3::hat(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)'
useSophus.cpp:(.text+0x27c): undefined reference to Sophus::SO3::hat(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)' useSophus.cpp:(.text+0x295): undefined reference to Sophus::SO3::vee(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&)'
useSophus.cpp:(.text+0x341): undefined reference to Sophus::SO3::exp(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)' useSophus.cpp:(.text+0x361): undefined reference to Sophus::SO3::operator*(Sophus::SO3 const&) const'
useSophus.cpp:(.text+0x41a): undefined reference to Sophus::SE3::SE3(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)' useSophus.cpp:(.text+0x43a): undefined reference to Sophus::SE3::SE3(Eigen::Quaternion<double, 0> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)'
useSophus.cpp:(.text+0x4cf): undefined reference to Sophus::SE3::log() const' useSophus.cpp:(.text+0x52f): undefined reference to Sophus::SE3::hat(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)'
useSophus.cpp:(.text+0x586): undefined reference to Sophus::SE3::hat(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)' useSophus.cpp:(.text+0x59f): undefined reference to Sophus::SE3::vee(Eigen::Matrix<double, 4, 4, 0, 4, 4> const&)'
useSophus.cpp:(.text+0x642): undefined reference to Sophus::SE3::exp(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)' useSophus.cpp:(.text+0x662): undefined reference to Sophus::SE3::operator*(Sophus::SE3 const&) const'
useSophus.cpp:(.text+0x67b): undefined reference to Sophus::SE3::matrix() const' CMakeFiles/useSophus.dir/useSophus.cpp.o: In function Sophus::operator<<(std::ostream&, Sophus::SO3 const&)':
useSophus.cpp:(.text._ZN6SophuslsERSoRKNS_3SO3E[_ZN6SophuslsERSoRKNS_3SO3E]+0x2e): undefined reference to `Sophus::SO3::log() const'
collect2: error: ld returned 1 exit status
CMakeFiles/useSophus.dir/build.make:94: recipe for target 'useSophus' failed
make[2]: *** [useSophus] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/useSophus.dir/all' failed
make[1]: *** [CMakeFiles/useSophus.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

在使用Sophus的程序中,为何CmakeLists没有显示引用Eigen的路径就能顺利编译呢?

高博您好,想请问下Sophus的操作中,源代码中有#include<Eigen/Core>。

但为何CmakeLists中未引入Eigen的路径就能顺利编译成功了呢?

从原理上我觉得是否要显示的引入所有第三库的路径?(除非库的头文件在系统PATH里)

麻烦您抽空解答一下。

谢谢您了。

小智

CmakeLists:

cmake_minimum_required( VERSION 2.8 )
project( useSophus )

# 为使用 sophus,您需要使用find_package命令找到它
find_package( Sophus REQUIRED )
include_directories( ${Sophus_INCLUDE_DIRS} )

add_executable( useSophus useSophus.cpp )
target_link_libraries( useSophus ${Sophus_LIBRARIES} )

ch6 g2o_curve_fitting 运行报错

高博您好,我在第六章运行的g2o_curve_fitting的程序时报错,前面生成的x,y点是正确的,到图优化的部分显示:
bool g2o::OptimizableGraph::Edge::resolveParameters(): edge not registered with a graph
addEdge: FATAL, cannot resolve parameters for edge 0x17a719
solve time cost = 2.103e-05 seconds.
estimated model: 0 0 0

配置环境:ubuntu14.14, github上下载的最新的g2o,最新的eigen3,以及g2o需要的qt5.

第三章visualizeGeometry

您好:
我编译第三章事例程序visualizeGeometry的过程中出现如下错误,请问高博是不是我Pangolin的库安装的有问题?
slambook/ch3/visualizeGeometry/visualizeGeometry.cpp:93:28: error:
no viable conversion from 'pangolin::OpenGlMatrix' to 'Matrix<double, 4, 4>'
Matrix<double,4,4> m = matrix;

project 运行报错

高博您好,我在实验第九章/0.2时,按照您的要求编译好了OpenCV3, 在数据集中生成了associate.py 文件,但运行bin/run_vo config/default.yaml 显示:segmentation fault
请问这可能是哪里出现了问题?
谢谢

pose_estimation_3d2d中的一个疑问

有一句代码理解不了,求高博答疑~

bundleAdjustment函数的最后一行

cout<<"T="<<endl<<Eigen::Isometry3d ( pose->estimate() ).matrix() <<endl;

pose->estimate()的返回值是SE3Quat,它怎么能作为参数传给Eigen::Isometry3d的构造函数呢?它们之间并没有继承关系呀?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.