Problems encountered during the reproduction process of ORB-SLAM3 and their solutions

Because the environment is relatively clean, there are relatively few problems encountered, but every problem has been solved perfectly.
My environment is just after installing Ubuntu20.04, and I have performed the first things that need to be done after installing the Ubuntu system . a subsequent environment.

1. Version check

Because the environmental requirements of ORB-SLAM3 are somewhat different from ORB-SLAM2, some versions that are too low may cause errors.
Therefore, before starting, let's check the version of the library in your environment.
Note: Using Ubuntu20.04

1.1 Opencv version detection

Execute the following command and you can find that the version is 4.2.0

pkg-config --modversion opencv
# 4.2.0
//或者
opencv_version
# 4.2.0

1.2 Eigen version detection

Execute the following command:

whereis eigen3
# 我的是在/usr/include/eigen3
gedit /usr/include/eigen3/Eigen/scr/Core/util/Macros.h

The first few lines of the file are as follows, meaning my Eigen version is 3.3.7

#ifndef EIGEN_MACROS_H
#define EIGEN_MACROS_H

#define EIGEN_WORLD_VERSION 3
#define EIGEN_MAJOR_VERSION 3
#define EIGEN_MINOR_VERSION 7

1.3 Check Python version

  1. Execute the following command:
xiaoduan@fighter:~$ python3 --version
Python 3.8.10
  1. You can also type python in the terminal and press the tab key twice to see your own python version.

1.4 Others

  1. In terms of c++, mine is c++11.
  2. DBoW2 and g2o exist directly in the project file and do not need to be installed manually. They will be installed automatically during the compilation process.
  3. Pangolin is not installed yet.

2. Problems encountered during compilation and their solutions

2.1 Problems encountered by ./build.sh

1. Question 1:

The error shown below appears:

Insert image description here
Cause Analysis:

The versions don't match, so just change the version.

Solution:

Open the file /home/xiaoduan/project/source2/orb_slam3/CMakeLists.txt
and change the following two contents:

  • The version of Opencv in line 33 is changed to 4
  • Line 41 Eigen's version is changed to 3

2. Question 2:

Error display:

‘slots_reference’ was not declared in this scope 1180 | cow_copy_type<list_type, Lockable>

Reason analysis:
Because mine is C++11, C++11 here does not support some compilations of this project. Just change the C++ version to C++14.

Solution: Enter the following command in the terminal

sed -i 's/++11/++14/g' CMakeLists.txt

3. Question three:

Error display:

./Monocular/mono_euroc: error while loading shared libraries: libpango_windowing.so: cannot open shared object file: No such file or directory

Cause Analysis:

原因一:The location of the running folder is wrong. Pay attention to the location when you run the command to ensure that the running file can be found.
原因二:Configuration file does not take effect

Solution:

For the first case, just cd to the corresponding folder. For the second situation, execute the following command:

sudo ldconfig

2.2 Problems encountered by ./build_ros.sh

1. Question 1:

Error display:

Error: the rosdep view is empty: call ‘sudo rosdep init‘ and ‘rosdep update‘

Cause Analysis:

Because ROS is installed with one click, rosdep is not initialized, so you only need to execute the prompt statement in the terminal error message.

Solution:

Execute the following command:

sudo rosdep fix-permissions
sudo rosdep init
rosdep update

Note: This process may always fail due to network problems, so just do it a few more times. If it doesn't work, run sudo apt install python2 and re-execute it.

2. Question 2:

Error display:

‘slots_reference’ was not declared in this scope 1180 | cow_copy_type<list_type, Lockable>

Cause Analysis:

The versions don't match, so just change the version.

Solution:

Open the file /home/xiaoduan/project/source2/orb_slam3/Examples_old/ROS/ORB_SLAM3/CMakeLists.txt
and change the following two contents:

  • The version of Opencv in line 33 is changed to 4
  • Line 41 Eigen's version is changed to 3

3. Question three:

Error display:

fatal error: sophus/se3.hpp: No such file or directory
29 | #include <sophus/se3.hpp>

Cause Analysis:

The location of the sophus file cannot be found, just add it.

Solution:

打开文件
/home/xiaoduan/project/source2/orb_slam3/Examples_old/ROS/ORB_SLAM3/CMakeLists.txt
第49行加入
${PROJECT_SOURCE_DIR}/../../../Thirdparty/Sophus

4. Question 4:

Error display:

/usr/local/include/sigslot/signal.hpp:1180:65: error: ‘slots_reference’ was not declared in this scope cow_copy_type<list_type, Lockable> ref = slots_reference();

Reason analysis:
Because mine is C++11, C++11 here does not support some compilations of this project. Just change the C++ version to C++14.

Solution:
Enter the following command in the terminal

sed -i 's/++11/++14/g' CMakeLists.txt

5. Question 5:

Error display:

4. Question 4:

Error display:

/usr/local/include/sigslot/signal.hpp:1180:65: error: ‘slots_reference’ was not declared in this scope cow_copy_type<list_type, Lockable> ref = slots_reference();

Cause analysis:
Sophus::SE3f, cv::MAT, Eigen::Vector3f type conversion error is reported. It should be that it cannot be converted directly, but there is another way.

Solution: Enter the following command in the terminal

sed -i 's/++11/++14/g' CMakeLists.txt

Reason analysis:
Because mine is C++11, C++11 here does not support some compilations of this project. Just change the C++ version to C++14.

Solution: For the
solution, please refer to the article Detailed process of ORB-SLAM3 reproduction - Configuration installation and ROS and script running - 2.4 in Ubuntu20.04. Just follow the steps in 2.4 to modify the source code.

So far, these are all the problems I have encountered.

Guess you like

Origin blog.csdn.net/qq_44164791/article/details/132652174