18 Star 147 Fork 85

飞行器智能感知与控制 / learn_slam

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
LGPL-3.0

一步一步学SLAM

SLAM的全称是Simultaneous Localization and Mapping,同时定位与地图构建,就是通过激光或者视觉等传感器扫描环境,构建环境地图并同时给自己定位。这项技术是人工智能的感知部分,就是通过传感器将环境重建成数字模型并定位,从而实现AR、无人驾驶、自主探险等等应用。虽然经过了多年的发展,视觉SLAM取得了很大的进步,已逐步从实验室走向了应用,但是视觉SLAM仍然面临很多的挑战,例如动态环境下如何鲁邦的重建环境、如何实现与语义分割等有机融合、如何实现人类使用认知的方式完成精密三维重建等等。

cover

1. 为何学习SLAM?

随着机器人、AR、自动驾驶的爆发式增长,SLAM方向的需求量仍在上升,而相关从业者相对较少,具备扎实基础知识,强大编程实现能力的人更少。目前对SLAM技术需求强烈的公司包括:互联网公司如百度、腾讯、阿里、京东等,计算机视觉算法公司如旷世、虹软、商汤等,自动驾驶创业公司如图森、momenta、景驰、驭势、滴滴及各大汽车厂商等,无人机/机器人公司如大疆、思岚、高仙等,AR移动终端应用相关公司如三星、华为、悉见等。

SLAM的实现是一类复杂的程序,包括数学、操作系统、多线程、C++、STL、CMake、大量第三方库等等,因此通过学习SLAM能够掌握复杂软件系统的设计、程序高级技巧,有了这些能力与技巧,后续做其他项目就会变得简单。因此学习SLAM对《个人的综合能力》的提升有着非常显著的作用,希望大家能够脚踏实地、一步一步去学习。

2. 为什么学习SLAM比较难?

  1. 深度学习在检测、识别领域具有强大的能力,但是在涉及多视角几何相关的SLAM领域,深度学习的作用仍然有限。究其原因是因为在多视角几何为基础的SLAM领域,需要明确清晰的理论基础保证,而深度学习的「黑盒子」模型目前还不是特别有效。
  2. SLAM技术门槛较高。深度学习爆发后,很多非计算机视觉领域的从业者纷纷转而学习深度学习,由于深度学习本身黑盒子的特点,很多从业者不需要了解图像处理、计算机视觉的基础知识便可以得到一个相对较好的结果,因此入门门槛并不是很高。而SLAM需要非常多的数学、优化、数值计算、编程等技能,程序需要手工设计与实现,细节比较多,因此会卡住很多人。学习SLAM需要具备三维空间刚体变换、相机成像模型、特征点提取与匹配、多视角几何、光束平差、数值优化、程序优化等内容。这对于非该领域的从业者来说还是具有较高的门槛。
  3. 需要高超的编程水平:SLAM是一类比较复杂的软件系统,包括了大量的基础知识和技巧,主要有操作系统、多线程、C++编程、OpenGL。此外由于SLAM是一类实时处理的程序,因此对程序的性能优化有非常高的要求,因此比类似的技术structure from motion (SfM)难度高了不少。

3. 学习内容和需要达到的目标

SLAM的入门一直都是很多初学者的噩梦,但请不用怕,时至今日,它的理论和实践参考都已经非常完善,了解他们对于《个人的综合能力》提升非常大,可以将SLAM相关的知识分为以下几类:

  1. 几何理论: 多视图几何是认识SLAM中元素组成及其关联的核心,了解几何之后,即使不明白其具体的优化计算处理,也至少可以明白模块之间的输入输出,从而对大问题进行分解,是SLAM学习最基础的知识;
  2. 编程: Linux系统的使用及程序工程能力是SLAM实践的关键,正确使用工具能让你少走弯路;
  3. 计算机视觉(CV):SLAM的前端主要作用是获取高质量的观测信息,决定了系统鲁棒性,区别与SLAM专属的数学及图优化处理,前端的理解往往比较直观,但涉及大量的工程处理;
  4. 数学及优化: SLAM的后端决定了系统的整体精度,它涉及较多的数学,需要一定的耐心和钻研;

4. 如何学习SLAM?

Stage0: 基础知识学习(C++Linux

  • C++
    • 大部分的SLAM程序通过C++实现,由于需要很高的执行效率,因此大部分的程序使用了较多的C++技巧
    • 需要考虑如何评估自己的C++能力是否适应SLAM编程的需求,如果自己的能力不够,该如何学习?从哪里找资料去学习?
    • 如果C++能力比较弱,可以参考《一步一步学编程》学习C++编程、数据结构与算法、编程项目等练习
  • Linux
    • 由于大部分的SLAM系统开发都在Linux下面进行,因此非常有必要先把Linux的基本操作学会
    • 基本的命令,如何安装软件包,如何查找软件包等等
    • 如何在Linux下编译软件,如何使用CMake
    • 如何使用Linux下面的IDE,例如QtCreator,KDevelop等等

Stage1: OpenCV学习

Stage2: SfM基本原理

Stage3: SLAM十四讲与相关库

  • SLAM十四讲学习方法
    • 先快速把《SLAM十四讲》过一遍
    • 主要是相机成像,三维的点如何变成二维上的点,把这个里面的公式搞通了,后面的一些东西就容易理解,好多公式是基于相机成像模型来进行推导的。
    • 在进行学习的同时可以配合作业达到练习的效果。
  • 在看书学习的基础上,需要尝试自己独立编写处理模块,例如特征点提取,特征点匹配,初始化,三角化。。。

Stage4:阅读并改进已有的SLAM系统

  • 建议从 VINS-Fusion 开始学习
  • 如何编译程序?
  • 这个程序分成几个模块,各个模块都完成什么工作,模块之间是如何衔接的?
  • 能否将输入数据替换成自己录制的数据?能否把输出、显示改成自己的程序?
  • 通过一步一步的仿真、增加算法模块,在具体任务的牵引下完成对SLAM的改进,具体参考:SLAM练习开发项目

Stage5:在消化吸收已有SLAM实现的基础上,编写自己的SLAM系统

  • 在消化吸收已有SLAM程序的基础上,逐个模块替换成自己写的模块

5. 学习的建议

  1. 不要想从空白一步到位自己独立编写出一个SLAM系统,SLAM是一个非常复杂的软件系统,包含了大量的数学、编程知识、编程技巧的系统,需要先建立感性认识,然后熟悉各个技术模块,然后在有一点理解的基础上尝试集成、修改、改进等等
  2. 由于SLAM包含了大量的数学知识、编程知识,因此强烈建议采用广度优先的方法来学习,即首先建立整体的感性认识;然后针对每一个技术模块了解其目的、意义、调用的方法等等;然后通过整合的方式去理解整体的衔接、组织。在不断深入理解的过程中,深入学习各个部分的数学原理、公式推导、公式如何转化成程序等等。否则一上来扎入复杂的公式,很有可能迷失方向。
  3. **需要大量的编程练习!!!需要大量的编程练习!!!**SLAM其实真正难的并不完全是数学,通过库函数调用其实已经屏蔽了数学基本原理。最难的是需要比较高的编程技能,才能驾驭SLAM这类复杂的软件系统。因此如果自己觉得自己编程内功还欠火候,强烈建议同步练习编程的基本,自己设想一些不是太复杂,但是比较综合的小项目来练手。例如《Learn Programming》中的Stage4,Stage5的题目,通过项目、代码重构学习如何分析、处理比较复杂的问题。将这些知识与经验迁移到SLAM上,就是的学习SLAM程序没有那么难。
  4. 强烈建议各位可以从structure from motion (SfM) 开始学习,因SfM是批处理的方式,方便理解每一个步骤的操作。通过构建比较好的输入数据,可以单独实现、测试每一个步骤。

前辈们的经验分享:

6. 参考资料

6.1 SLAM实现

6.2 教程等

6.3 图书与学习资料

6.3 其他参考资料

GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.

简介

一步一步学SLAM 展开 收起
C++ 等 2 种语言
LGPL-3.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/pi-lab/learn_slam.git
git@gitee.com:pi-lab/learn_slam.git
pi-lab
learn_slam
learn_slam
master

搜索帮助