RainerKuemmerle / g2o

g2o: A General Framework for Graph Optimization
3.07k stars 1.1k forks source link

vcpkg version doesn't work with ORB-SLAM2 #412

Open RollingIsland opened 4 years ago

RollingIsland commented 4 years ago

I installed g2o with vcpkg successfully but when I tried to build ORB-SLAM2 it went wrong. Has the code been updated in vcpkg? Or what else possible reason for the error shown below? QHLRA7%JPBQZ0OD}Z5`NE49

mgladkova commented 4 years ago

You don't need to install g2o separately to run ORB-SLAM2 since it has the source code in the subfolder Thirdparty. Just make sure that g2o is compiled (see build.sh script).

RollingIsland commented 4 years ago

@mgladkova Thanks for your kind reply! Well, I wonder whether it's no need to install g2o separately, or it's just wrong not to use the g2o code in ORB-SLAM2? I'm new to SLAM & g2o library.

mgladkova commented 4 years ago

In this context I am more inclined to say that it is highly recommended to use the g2o version provided by ORB-SLAM2, unless you would like to dig into the code of ORB-SLAM2 and make it compatible with the vcpkg version of g2o.

sjulier commented 4 years ago

We haven't done it with vcpkg, but under Linux and macOS we regularly change the version shipped with ORBSLAM and CCM-SLAM. There are several reasons, including the fact that the older version of g2o triggers a lot of warnings in Eigen.

Chaning the code just takes a few minutes of work. The main difficulties are:

  1. The graph now uses std::unique_ptr for creating the components. If you look at the examples in g2o you can see how to do it - basically it's the same sets of classes, but they need to be wrappped and moved.
  2. ORBSLAM uses a "compressed" version of a subset of the types libraries. If you switch to standard g2o, you just need to change the directories in the include statements.
RollingIsland commented 4 years ago

@sjulier Thanks for your reply! I will try as you told.

sjulier commented 4 years ago

Let me know what happens. I haven't tried vcpkg. It's on my list to try.