xdspacelab / openvslam

OpenVSLAM: A Versatile Visual SLAM Framework
https://openvslam.readthedocs.io/
2.97k stars 869 forks source link

Error compiling ros for Openvslam (related to g2o) #209

Open duguowei1000 opened 4 years ago

duguowei1000 commented 4 years ago

Hi guys, i am not sure if this is g2o issue or openvslam. But just trying my luck here. i am trying to compile ros package in openvslam.

Steps as per instruction in https://openvslam.readthedocs.io/en/master/ros_package.html:

cd /path/to/working/dir git clone https://github.com/RainerKuemmerle/g2o.git cd g2o git checkout 9b41a4ea5ade8e1250b9c1b279f3a9c098811b5a mkdir build && cd build cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DCMAKE_CXX_FLAGS=-std=c++11 \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_UNITTESTS=OFF \ -DBUILD_WITH_MARCH_NATIVE=ON \ -DG2O_USE_CHOLMOD=OFF \ -DG2O_USE_CSPARSE=ON \ -DG2O_USE_OPENGL=OFF \ -DG2O_USE_OPENMP=ON \ .. make -j4 make install

cd /path/to/openvslam/ros catkin_make \ -DBUILD_WITH_MARCH_NATIVE=ON \ -DUSE_PANGOLIN_VIEWER=ON \ -DUSE_SOCKET_PUBLISHER=OFF \ -DUSE_STACK_TRACE_LOGGER=ON \ -DBOW_FRAMEWORK=DBoW2


Error generated after "catkin_make step": ... gw1604@gw1604:~/vslamopen/ros$ catkin_make \

-DBUILD_WITH_MARCH_NATIVE=ON \
-DUSE_PANGOLIN_VIEWER=ON \
-DUSE_SOCKET_PUBLISHER=OFF \
-DUSE_STACK_TRACE_LOGGER=ON \
-DBOW_FRAMEWORK=DBoW2

Base path: /home/gw1604/vslamopen/ros Source space: /home/gw1604/vslamopen/ros/src Build space: /home/gw1604/vslamopen/ros/build Devel space: /home/gw1604/vslamopen/ros/devel Install space: /home/gw1604/vslamopen/ros/install

Running command: "make cmake_check_build_system" in "/home/gw1604/vslamopen/ros/build"

Running command: "make -j8 -l8" in "/home/gw1604/vslamopen/ros/build"

[ 0%] Built target std_msgs_generate_messages_nodejs [ 0%] Built target sensor_msgs_generate_messages_eus [ 0%] Built target std_msgs_generate_messages_eus [ 0%] Built target std_msgs_generate_messages_lisp [ 0%] Built target sensor_msgs_generate_messages_nodejs [ 0%] Built target sensor_msgs_generate_messages_py [ 0%] Built target geometry_msgs_generate_messages_nodejs [ 0%] Built target sensor_msgs_generate_messages_lisp [ 0%] Built target sensor_msgs_generate_messages_cpp [ 0%] Built target geometry_msgs_generate_messages_cpp [ 0%] Built target std_msgs_generate_messages_cpp [ 0%] Built target geometry_msgs_generate_messages_py [ 0%] Built target geometry_msgs_generate_messages_lisp [ 0%] Built target std_msgs_generate_messages_py [ 0%] Built target geometry_msgs_generate_messages_eus [ 0%] Built target rosgraph_msgs_generate_messages_py [ 0%] Built target roscpp_generate_messages_lisp [ 0%] Built target roscpp_generate_messages_nodejs [ 0%] Built target rosgraph_msgs_generate_messages_eus [ 0%] Built target roscpp_generate_messages_eus [ 0%] Built target rosgraph_msgs_generate_messages_nodejs [ 0%] Built target roscpp_generate_messages_cpp [ 0%] Built target roscpp_generate_messages_py [ 0%] Built target rosgraph_msgs_generate_messages_cpp [ 0%] Built target rosgraph_msgs_generate_messages_lisp [ 20%] Built target cv_bridge [ 33%] Built target video_publisher [ 53%] Built target image_publisher [ 73%] Built target cv_bridge_boost [ 80%] Linking CXX executable /home/gw1604/vslamopen/ros/devel/lib/openvslam/run_slam [ 86%] Linking CXX executable /home/gw1604/vslamopen/ros/devel/lib/openvslam/run_localization /home/gw1604/vslamopen/build/lib/libopenvslam.so: undefined reference to g2o::OptimizableGraph::addVertex(g2o::OptimizableGraph::Vertex*, g2o::HyperGraph::Data*)' /home/gw1604/vslamopen/build/lib/libopenvslam.so: undefined reference tog2o::OptimizationAlgorithmLevenberg::OptimizationAlgorithmLevenberg(std::unique_ptr<g2o::Solver, std::default_delete >)' /home/gw1604/vslamopen/build/lib/libopenvslam.so: undefined reference to g2o::OptimizableGraph::addEdge(g2o::OptimizableGraph::Edge*)' /home/gw1604/vslamopen/build/lib/libopenvslam.so: undefined reference tog2o::OptimizableGraph::addVertex(g2o::OptimizableGraph::Vertex, g2o::HyperGraph::Data)' /home/gw1604/vslamopen/build/lib/libopenvslam.so: undefined reference to g2o::OptimizationAlgorithmLevenberg::OptimizationAlgorithmLevenberg(std::unique_ptr<g2o::Solver, std::default_delete<g2o::Solver> >)' /home/gw1604/vslamopen/build/lib/libopenvslam.so: undefined reference tog2o::OptimizableGraph::addEdge(g2o::OptimizableGraph::Edge*)' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status openvslam/src/CMakeFiles/run_localization.dir/build.make:155: recipe for target '/home/gw1604/vslamopen/ros/devel/lib/openvslam/run_localization' failed openvslam/src/CMakeFiles/run_slam.dir/build.make:155: recipe for target '/home/gw1604/vslamopen/ros/devel/lib/openvslam/run_slam' failed make[2]: [/home/gw1604/vslamopen/ros/devel/lib/openvslam/run_localization] Error 1 make[2]: [/home/gw1604/vslamopen/ros/devel/lib/openvslam/run_slam] Error 1 CMakeFiles/Makefile2:2051: recipe for target 'openvslam/src/CMakeFiles/run_slam.dir/all' failed make[1]: [openvslam/src/CMakeFiles/run_slam.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... CMakeFiles/Makefile2:1989: recipe for target 'openvslam/src/CMakeFiles/run_localization.dir/all' failed make[1]: [openvslam/src/CMakeFiles/run_localization.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: [all] Error 2 Invoking "make -j8 -l8" failed


Appreciate if any one has any idea( even just pointing out if it is g2o or Openvslam issue. Thanks!

Shashika007 commented 4 years ago

@duguowei1000 try the newer version of g2o without checking out 9b41a4ea5ade8e1250b9c1b279f3a9c098811b5a branch.

jungladicitta commented 4 years ago

@duguowei1000 try the newer version of g2o without checking out 9b41a4ea5ade8e1250b9c1b279f3a9c098811b5a branch.

I tried. It didnt help

jungladicitta commented 4 years ago

@duguowei1000 Looks like I have similar issue. Have you solved it?

duguowei1000 commented 4 years ago

hi @jungladicitta , have you solved it?

jungladicitta commented 4 years ago

@duguowei1000 have solved, but looks like there is another issue now, look up at the last comments there

Hsu-Hsin commented 4 years ago

@duguowei1000 have solved, but looks like there is another issue now, look up at the last comments there How did you solve it? I mean where are last comments that you said? @jungladicitta