[Resolved] Ubuntu 18.04 uses Pangolin error reporting causes and solutions, as well as Pangolin installation method, Visual SLAM Lecture 14 ch3 error reporting reasons analysis

1. Installation of Pangolin

The version we installed here is the version mentioned by Teacher Gao. If you follow Lecture 14, it is recommended to download this version. Don't search for other Pangolin installation methods. Otherwise, if there is a problem with the version, an error will be reported.

1. Download the function package and open the terminal

git clone https://github.com/stevenlovegrove/Pangolin.git

2. Start compiling

cd Pangolin
mkdir build
cd build
cmake ..
cmake --build .

3. This step is crucial! ! If you don't add it later, an error will be reported! ! ! (Continue running in the terminal where the above operation is completed) 

sudo make install

4. Then it is completed, you can verify it with the following code

cd Pangolin/build/examples/HelloPangolin
./HelloPangolin

The appearance of an image means that the installation is successful (if there is a problem with compilation later, please do not uninstall and reinstall Pangolin). Because I failed to compile a few times before, I always thought it was a problem with the Pangolin version, so I kept reinstalling. Later I found out that this version of Pangolin was fine. The problem lies below! ! Here’s a reminder, don’t do wasted work! ! !

2. Pangolin call failed

If an error is reported because of the sentence #include <pangolin/pangolin.h>

It means the file cannot be found! ! Note that there may be problems during installation! !

Go back to the build folder of the Pangolin folder, open the terminal and execute:

sudo make install

Its function is to generate a folder in your system so that Pangolin can be called during compilation!! 

3. Pangolin reports an error when compiling the code

     If you first encounter this problem, the main reason is that the Pangolin linked library cannot be found when compiling the file. The main reason is that the CMakeLists.txt file needs to be modified. It mainly needs to modify a few places. I will not write the rest of the ordinary addition of dependencies. I'm in... If I write too much, I will easily get confused...

find_package(Pangolin REQUIRED)

include_directories(
# include
  "/usr/include/eigen3"
  ${catkin_INCLUDE_DIRS}
  ${serial_INCLUDE_DIRS}
  ${eigen_INCLUDE_DIRS}
)

target_link_libraries( "你的文件名" 
${Pangolin_LIBRARIES}
${catkin_LIBRARIES}
)

Next, take a look at the results! !

 


 I wrote it myself so it's a bit complicated, but at least it's done hehe. If you have any optimizations, please discuss in the comment area! !

You're done! It’s not easy to write. If you succeed, please follow or like. Thank you~~


Guess you like

Origin blog.csdn.net/Callme_TeacherPi/article/details/125066039