Installing Pangolin on Ubuntu20 [pybind11 error report] [2023.07.12 test is valid] [Slam Lecture 14]

It took an afternoon to configure the Pangolin environment, and I kept encountering the error Unknown CMake command "pybind11_add_module". The author found a lot of tutorials during installation, but they did not completely solve my problem, so I inserted a tree for future generations to enjoy the shade.

installation steps

This part refers to Ubuntu20.04 - the process of installing ORB-SLAM3 from scratch in the new system (2022)

Install dependencies that may be required

# 安装Pangolin所需依赖
sudo apt install libgl1-mesa-dev
sudo apt install libglew-dev
# sudo apt install cmake # 注意以前装了就不需要安装了
sudo apt install libpython2.7-dev
# sudo apt install python-pip
# sudo python -mpip install numpy pyopengl Pillow pybind11
sudo apt install pkg-config
sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
# sudo apt install ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavdevice-dev
# sudo apt install libdc1394-22-dev libraw1394-dev
# sudo apt install libjpeg-dev libpng-dev libtiff5-dev libopenexr-dev

clone, compile and install

git clone https://github.com/stevenlovegrove/Pangolin.git  
# 或者用老版本
# git clone https://github.com/stevenlovegrove/Pangolin/tree/v0.6.git    
cd Pangolin
mkdir build && cd build
cmake ..
make -j4
sudo make install

cmakeeasy to run into problems at one step

Problem description: The pybind environment is missing

insert image description here
Prompt me that pybind11 is not installed

method exploration

Tried:

  1. After git clone pybind, compile and install with cmakepybind11

    For specific steps, see:
    pybind11 installation and library use (ubuntu20.14)

  2. pip install directlypybind11
  3. pip installation pytestand so on a series of things
  4. “sudo python -mpip install pybind11”

fruitless

The correct way ✅

In a word, Pangolin has a path to put third-party library files, but it pybind11 is empty! !
Therefore, clone it on github pybind11and put it in the corresponding position

Supplement:
It is possible to install pybind on the virtual machine (i.e. tried method 1) , but I think this step is not necessary, readers can try to skip this step

Find third-party libraries for Pangolin

Enter the Pangolin

find ./ -name pybind11

Find the location of the third-party library [I downloaded two versions of Pangolin]
Before the compilation is successful, there should be only one pybind11path
insert image description here
to enter the path, but it is empty .

download pybind11

After downloading on hithub: https://github.com/pybind/pybind11
, replace the above blank pybind11, and then cmake .., success!
 

If this article is helpful to you, please like/collect it~

Guess you like

Origin blog.csdn.net/weixin_51772802/article/details/131689582