Pangolin installation error resolution

Pangolin installation error resolution

Visual SLAM fourteen lectures require $3.7 sessions.

In the local slambook2/3rdparty folder git submodule update, this version is consistent with the version in the book.

First you need to install OpenGL

And Cmake, C++11, etc.,
then create a build folder and compile it internally:

mkdir build
cd build
cmake ..
make

If nothing unexpected happens, an error will be reported:

  • include/pangolin/gl/colour.h:57:18: error: ‘numeric_limits’ is not a member of ‘std’
    57 | std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN(),
  • include/pangolin/utils/picojson.h:383:12: note: in definition of macro ‘GET
    383 | return var ;
  • include/pangolin/utils/picojson.h:390:124: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    390 | ->type_ = number_type, const_cast<value*>(this)->u_.number_ = u_.int64_), u_.number_))
    

I changed a few files and it passed the compilation. The specific changes are:

  • include/pangolin/gl/gl.h, include/pangolin/gl/colour.h These two files, add
#include <stdexcept>
#include <limits>
  • Add C++11 to the corresponding CMakeLists.txt
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
  • include/pangolin/utils/picojson.h file 390 lines plus 2 brackets
#ifdef PICOJSON_USE_INT64
GET(double,
    (type_ == int64_type && ((const_cast<value *>(this)->type_ = number_type), (const_cast<value *>(this)->u_.number_ = u_.int64_)),
     u_.number_))
GET(int64_t, u_.int64_)

If it doesn't work, an error will always be reported. For example, you have reinstalled the Eigen library. At this time, you may not be able to install the version of Pangolin specified in the book because of inconsistent versions. Then you only need to get a pangolin in another folder and compile it. You can refer to the readme for installation.

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

Some bloggers pointed out that direct git clone has various problems that lead to compilation, but you should use the release version compression package on GitHub instead of git clone.

Guess you like

Origin blog.csdn.net/NICAI001/article/details/128064465