gaoxiang12 / slam_in_autonomous_driving

《自动驾驶中的SLAM技术》对应开源代码
1.76k stars 430 forks source link

SLAM in Autonomous Driving book (SAD book)

本书向读者系统介绍了惯性导航、组合导航、激光建图、激光定位、激光惯导里程计等知识。本仓库是书籍对应的源代码仓库,可以公开使用。

注意

本书的内容编排

本书的特点

希望您能喜欢本书的极简风格,发现算法的乐趣所在。

数据集

编译

适配Ubuntu18.04

为了在Ubuntu18.04上编译运行,需要安装gcc-9,并且使用对应版本的TBB。或者在docker环境下使用。

安装gcc-9

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++

#命令最后的1和10是优先级,如果使用auto选择模式,系统将默认使用优先级高的
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 1
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 1
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 10

检查版本

g++ -v

编译程序

mkdir build
cd build
cmake .. -DBUILD_WITH_UBUNTU1804=ON
make -j8

在docker环境下使用

docker build -t sad:v1 .
./docker/docker_run.sh

进入docker容器后

cd ./thirdparty/g2o
mkdir build
cd build
cmake ..
make -j8
cd /sad
mkdir build
cd build
cmake ..
make -j8

常见问题

  1. 图形界面在2023年以后特定型号的笔记本端导致桌面卡死(GL硬件兼容性):https://github.com/gaoxiang12/slam_in_autonomous_driving/issues/67
  2. 第5章test_nn编译时,gtest报gmock错误:https://github.com/gaoxiang12/slam_in_autonomous_driving/issues/18
  3. 编译器版本问题:https://github.com/gaoxiang12/slam_in_autonomous_driving/issues/4
  4. g2o编译问题(config.h找不到): https://github.com/gaoxiang12/slam_in_autonomous_driving/issues/95

TODO项

NOTES