Summary of the Second Edition of the Fourteenth Lecture on Visual SLAM

I spent some time during the winter vacation to go through the second version of Slam. It was too troublesome to install the library files. I always broke the Ubuntu system due to memory problems, and I had to install it three or four times. Here, I record the installation pitfalls of the second version. If unfortunately I have to reinstall in the future, I will leave it for reference.

1 SLAM source code download

Clone the code of Gao Xiang slam version 2 from the github website:

git clone https://github.com/gaoxiang12/slambook2

After downloading, it is found that the third-party library 3rdparty is empty. Use the following command to obtain the submodule:

git submodule init
git submodule update

2 Kdevelop installation

sudo apt-get install kdevelop

Insert image description here

3 Install opencv3.4.1

Reference blog: Ubuntu16.04 installation opencv3.4.1
Download: opencv-3.4.1.zip

According to slam second edition P108, first install OpenCV dependencies:

sudo apt-get install build-essential libgtk2.0-dev libvtk5-dev libjpeg-dev libtiff5-dev libjasper-dev libopenexr-dev libtbb-dev

Note that the libtiff4-dev given in the book is only libtiff5-dev in ubuntu16.04.

Unzip opencv-3.4.1.zip, create a directory build, then enter the build directory and open the terminal. Execute the cmake command.

cd  opencv-3.4.1/
mkdir build
cd  build 
cmake ..
make -j4
sudo make install

4 Install Pangolin

Read README.txt and install dependencies first:

sudo apt-get install libglew-dev
sudo apt-get install ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavdevice-dev
sudo apt-get install libdc1394-22-dev libraw1394-dev
sudo apt-get install libjpeg-dev libpng12-dev libtiff5-dev libopenexr-dev

Some dependencies overlap with those of OpenCV.

5 Some chapter compilation issues

ch4 Lie groups and Lie algebras

In the example folder, the C++11 standard is not used in Cmakelists. Add: at the beginning of Cmakelists.txt:

add_compile_options(-std=c++11)

Insert image description here

ch8 visual odometer 2

Cmakelists.txt requires that the OpenCV version is greater than 4. I compiled it with 3.4.1 and it ran smoothly. Any version greater than this should be feasible.

Insert image description here

ch9 install Meshlab

Install Meshlab and use Meshlab to open the point cloud file.ply:

sudo apt-get install meshlab

ch10 g2o_viewer

Lecture 10: When using g2o_viewer to view pose images, an error is reported:

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

sudo gedit /etc/ld.so.conf
#添加如下代码:
/usr/local/lib
sudo ldconfig

ch11 dictionary and loopback detection

1. When using the second version of the source code to create a dictionary, an error message appears:
no rule to make target '/usr/local/lib/libDBow3.so'.
Just change the static library libDBow3.a in CMakeList.txt to the dynamic library libDBow3.so.

2. It was found that there were differences between running feature_trainning and loop_closure and the results given in the book. feature_trainning output a lot of numbers that I don’t know what they mean.

Insert image description here
3. After using a large dictionary for loop_closure, the similarity distinction is even worse.

Insert image description here
I looked at the slambook2 discussion area on Gao Xiang's github homepage, and some people mentioned these issues. Like me, they all used the DBoW3 third-party library provided by slambook2.

This lecture on loopback detection corresponds to lecture 12 in slambook1. Someone mentioned that you can get the correct results by using the code of slambook1. It is unclear what the problem is, and the discussion forum has not provided an answer.

Insert image description here

ch12 install PCL

Ubuntu16.04 installs the PCL point cloud library. I used the source code installation method before, and installed several versions but failed. Use the following step to install PCL. You can directly install the compiled point cloud library PCL-1.7:

sudo apt-get install libpcl-dev

Guess you like

Origin blog.csdn.net/slender_1031/article/details/113704389