Ask Your Question
0

rgbdslam_v2 build error indigo [closed]

asked 2014-08-20 01:45:42 -0500

Pat gravatar image

Hi, I'm trying to build RGBDSLAM_v2 http://felixendres.github.io/rgbdslam... under ros indigo I'm not sure if its possible in general. I get: fatal error: opencv2/nonfree/nonfree.hpp: Datei oder Verzeichnis nicht gefunden Seems that I have opencv2 installed (see dpkg output below). So why do I get this error?

...
[ 63%] [ 64%] [ 65%] Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/openni_listener.o
[ 66%] Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/loop_closing.o
Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/misc.o
Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/ColorOctomapServer.o
/home/ros/catkin_ws/src/rgbdslam_v2-hydro/src/misc.cpp:40:39: fatal error: opencv2/nonfree/nonfree.hpp: Datei oder Verzeichnis nicht gefunden
 #include "opencv2/nonfree/nonfree.hpp"
                                       ^
compilation terminated.
/home/ros/catkin_ws/src/rgbdslam_v2-hydro/src/openni_listener.cpp: In member function ‘void OpenNIListener::loadBag(std::string)’:
/home/ros/catkin_ws/src/rgbdslam_v2-hydro/src/openni_listener.cpp:271:91: error: ‘const struct tf::tfMessage_<std::allocator<void> >’ has no member named ‘__connection_header’
           boost::shared_ptr<std::map<std::string, std::string> > msg_header_map = tf_msg->__connection_header;
                                                                                           ^
[ 67%] Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/scoped_timer.o
[ 68%] Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/icp.o
[ 69%] Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/matching_result.o
make[2]: *** [rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/misc.o] Fehler 1
make[2]: *** Warte auf noch nicht beendete Prozesse...
make[2]: *** [rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/openni_listener.o] Fehler 1
make[1]: *** [rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/all] Fehler 2
make: *** [all] Fehler 2
Invoking "make" failed

$ dpkg -l *opencv*
Gewünscht=Unbekannt/Installieren/R=Entfernen/P=Vollständig Löschen/Halten
| Status=Nicht/Installiert/Config/U=Entpackt/halb konFiguriert/
         Halb installiert/Trigger erWartet/Trigger anhängig
|/ Fehler?=(kein)/R=Neuinstallation notwendig (Status, Fehler: GROSS=schlecht)
||/ Name                           Version              Architektur          Beschreibung
+++-==============================-====================-====================-==================================================================
ii  libopencv-calib3d-dev:amd64    2.4.8+dfsg1-2ubuntu1 amd64                development files for libopencv-calib3d
ii  libopencv-calib3d2.4:amd64     2.4.8+dfsg1-2ubuntu1 amd64                computer vision Camera Calibration library
ii  libopencv-contrib-dev:amd64    2.4.8+dfsg1-2ubuntu1 amd64                development files for libopencv-contrib
ii  libopencv-contrib2.4:amd64     2.4.8+dfsg1-2ubuntu1 amd64                computer vision contrib library
ii  libopencv-core-dev:amd64       2.4.8+dfsg1-2ubuntu1 amd64                development files for libopencv-core
ii  libopencv-core2.4:amd64        2.4.8+dfsg1-2ubuntu1 amd64                computer vision core library
ii  libopencv-dev                  2.4.8+dfsg1-2ubuntu1 amd64                development files for opencv
ii  libopencv-features2d-dev:amd64 2.4.8+dfsg1-2ubuntu1 amd64                development files for libopencv-features2d
ii  libopencv-features2d2.4:amd64  2.4.8+dfsg1-2ubuntu1 amd64                computer vision Feature Detection and Descriptor Extraction librar
ii  libopencv-flann-dev:amd64      2.4.8+dfsg1-2ubuntu1 amd64                development files for libopencv-flann
ii  libopencv-flann2.4:amd64       2.4.8+dfsg1-2ubuntu1 amd64                computer vision Clustering and Search in Multi-Dimensional spaces 
ii  libopencv-gpu-dev:amd64        2.4.8+dfsg1-2ubuntu1 amd64                development files for libopencv-gpu2.4
ii  libopencv-gpu2.4:amd64         2.4.8+dfsg1-2ubuntu1 amd64                computer vision GPU library
ii  libopencv-highgui-dev:amd64    2.4.8+dfsg1-2ubuntu1 amd64                development files for libopencv-highgui
ii  libopencv-highgui2.4:amd64     2.4.8+dfsg1-2ubuntu1 amd64                computer vision High-level GUI and Media I/O library
ii  libopencv-imgproc-dev:amd64    2.4 ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by 130s
close date 2020-09-21 01:02:36.560335

3 Answers

Sort by » oldest newest most voted
1

answered 2014-11-19 05:44:51 -0500

kp gravatar image

updated 2014-11-20 03:14:08 -0500

Regarding

boost::shared_ptr<std::map<std::string, std::string=""> > msg_header_map = tf_msg->__connection_header;
(*msg_header_map)["callerid"] = "rgbdslam";

__connection_header seems to be deprecated since Hydro and removed in Indigo, but I would agree that it may be not needed/important at all (only may be needed if you will have issues with bag file reading). Thread in roscpp github issues page: Remove _connection_header from message #3

For me also this change to CMakeLists.txt was needed:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,8 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
 set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
 #SET(CMAKE_CXX_FLAGS "-O3 -fPIC -std=c++0x")
 #For annotated profiling with perf: 
-SET(CMAKE_CXX_FLAGS "-ggdb -O3 -fPIC -std=c++0x")
+#SET(CMAKE_CXX_FLAGS "-ggdb -O3 -fPIC -std=c++0x")
+SET(CMAKE_CXX_FLAGS "-ggdb -O3 -fPIC")

 IF (${USE_GL2PS})
   add_definitions(-DGL2PS)
    @@ -41,7 +42,7 @@ ENDIF (${USE_GICP_BIN} OR ${USE_GICP_CODE})
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules/")
 #message(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
 find_package(catkin REQUIRED COMPONENTS pcl_conversions pcl_ros roscpp image_transport cv_bridge sensor_msgs 
-   geometry_msgs visualization_msgs std_msgs tf message_generation message_filters rosbag rosconsole)
+   geometry_msgs visualization_msgs std_msgs tf message_generation message_filters rosbag rosconsole    cmake_modules)

@@ -225,7 +225,7 @@ add_dependencies(rgbdslam rgbdslam_gencpp)
 #SET(G2O_LIBS ${G2O_LIBRARIES} cholmod cxsparse)
 #SET(LIBS_LINK GL GLU -lgl2ps ${G2O_LIBS} ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${GLUT_LIBRARY} ${OPE
 #Use specific version of cxsparse, to avoid linker warning about possible conflicts between versions 2
-SET(LIBS_LINK GL GLU cholmod /usr/lib/libcxsparse.so.2.2.3 ${G2O_LIBRARIES} ${QT_LIBRARIES} ${QT_QTOPE
+SET(LIBS_LINK GL GLU cholmod cxsparse ${G2O_LIBRARIES} ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY} ${GLUT_L
 #-lboost_signals -lrt -loctomap -loctomap_server -loctomath)

--- a/package.xml
+++ b/package.xml
@@ -41,6 +41,7 @@
   <!-- Use test_depend for packages you need only for testing: -->
   <!--   <test_depend>gtest</test_depend> -->
   <buildtool_depend>catkin</buildtool_depend>
+  <build_depend>cmake_modules</build_depend>
   <build_depend>pcl_conversions</build_depend>
   <build_depend>pcl_ros</build_depend>
   <build_depend>roscpp</build_depend>
@@ -56,6 +57,7 @@
   <run_depend>sensor_msgs</run_depend>
   <run_depend>octomap</run_depend>
   <run_depend>visualization_msgs</run_depend>
+  <run_depend>cmake_modules</run_depend>
   <!-- own stuff -->
   <build_depend>libpcl-all-dev</build_depend>
   <build_depend>tf</build_depend>

You can use ppa:xqms/opencv-nonfree PPA if you don't want to build from scratch and solve issues of:

  • satisfying other packages which are depending on stock OpenCV package
  • force to link again specific version of OpenCV.

PPA sources list is /etc/apt/sources.list.d/xqms-opencv-nonfree-trusty.list:

deb http://ppa.launchpad.net/xqms/opencv-nonfree/ubuntu trusty main
# deb-src http://ppa.launchpad.net/xqms/opencv-nonfree/ubuntu trusty main
edit flag offensive delete link more

Comments

I was able to compile it in that way by additionally set cmake flags to SET(CMAKE_CXX_FLAGS "-ggdb -O3 -fPIC -std=c++11") to use C++11 standard. but rgbdslam always crashes on startup. any ideas?

RodBelaFarin gravatar image RodBelaFarin  ( 2015-03-13 11:54:08 -0500 )edit
0

answered 2014-08-20 02:20:24 -0500

MarkyMark2012 gravatar image

I'd check the paths relative to your build environment and opencv2. The compiler can't find "#include "opencv2/nonfree/nonfree.hpp""

edit flag offensive delete link more

Comments

Checked already. I have nowhere nonfree.hpp in my system. Seems to be that its part from another opencv version. Now I don't know what to do.

ros@host1:~/catkin_ws$ sudo find / -name nonfree.hpp
[sudo] password for ros: 
ros@host1:~/catkin_ws$ sudo find / -type d -name opencv2
/usr/include/opencv2
ros@host1:~/catkin_ws$ ll /usr/include/opencv2
insgesamt 104
drwxr-xr-x  20 root root  4096 Aug 16 12:21 ./
drwxr-xr-x 128 root root 20480 Aug 17 13:49 ../
drwxr-xr-x   2 root root  4096 Aug 16 12:20 calib3d/
drwxr-xr-x   2 root root  4096 Aug 16 12:20 contrib/
drwxr-xr-x   2 root root  4096 Aug 16 12:20 core/
drwxr-xr-x   2 root root  4096 Aug 16 12:20 features2d/
drwxr-xr-x   2 root root  4096 Aug 16 12:20 flann/
drwxr-xr-x   3 root root  4096 Aug 16 12:21 gpu/
drwxr-xr-x   2 root root  4096 Aug 16 12:20 highgui/
drwxr-xr-x ...
(more)
Pat gravatar image Pat  ( 2014-08-20 03:22:51 -0500 )edit

I think you need to download these files specifically (Suspect someone can confirm)

https://code.google.com/p/qtphotomanager/source/browse/thirdparty/opencv/include/?r=74c8bb7f8fb62ef3819333ec46ac26a290b61ab7#https://code.google.com/p/qtphotomana...

and some info about it here (not ROS related but probably :

http://answers.opencv.org/question/19...

Might be worth commenting the file out and see how you get on

MarkyMark2012 gravatar image MarkyMark2012  ( 2014-08-20 03:58:50 -0500 )edit

Thanks Mark, that helped to pass the step regarding nonfree.hpp. Now there is stil below error present. Seems to be another version problem. Yet not clear how to fix that.

...
[ 63%] [ 64%] [ 65%] [ 66%] Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/openni_listener.o
Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/transformation_estimation_euclidean.o
Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/misc.o
Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/transformation_estimation.o
/home/ros/catkin_ws/src/rgbdslam_v2-hydro/src/openni_listener.cpp: In member function ‘void OpenNIListener::loadBag(std::string)’:
/home/ros/catkin_ws/src/rgbdslam_v2-hydro/src/openni_listener.cpp:271:91: error: ‘const struct tf::tfMessage_<std::allocator<void> >’ has no member named ‘__connection_header’
           boost::shared_ptr<std::map<std::string, std::string> > msg_header_map = tf_msg->__connection_header;
                                                                                           ^
[ 67%] Building CXX object rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/graph_manager2.o
make[2]: *** [rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/src/openni_listener.o] Fehler 1
make[2]: *** Warte ...
(more)
Pat gravatar image Pat  ( 2014-08-20 05:47:41 -0500 )edit
0

answered 2014-08-22 04:30:36 -0500

Pat gravatar image

updated 2014-08-22 04:31:51 -0500

So, problem regarding __connection_header I solved once by comment out the two lines dealing with msg_header_map (not sure if this code is really necessary). Afterwards it seems to compile fine. Now I'm running (could be expected) into another problem during linking getting error unresolved cv::SIFT::SIFT I'm using openCV 2.4 and since this version nonfree stuff was excluded from openCV. Not sure how to get now opencv_nonfree library to link. Any hint?

...
Linking CXX executable /home/ros/catkin_ws/devel/lib/rgbdslam/rgbdslam
CMakeFiles/rgbdslam.dir/src/misc.o: In Funktion `createDescriptorExtractor(std::string const&)':
misc.cpp:(.text+0x1433): Nicht definierter Verweis auf `cv::SIFT::SIFT(int, int, double, double, double)'
misc.cpp:(.text+0x1594): Nicht definierter Verweis auf `cv::SURF::SURF()'
misc.cpp:(.text+0x1604): Nicht definierter Verweis auf `cv::SURF::SURF()'
misc.cpp:(.text+0x173a): Nicht definierter Verweis auf `cv::SURF::SURF()'
CMakeFiles/rgbdslam.dir/src/misc.o: In Funktion `createDetector(std::string const&)':
misc.cpp:(.text+0x4ee0): Nicht definierter Verweis auf `cv::SIFT::SIFT(int, int, double, double, double)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/ros/catkin_ws/devel/lib/rgbdslam/rgbdslam] Fehler 1
make[1]: *** [rgbdslam_v2-hydro/CMakeFiles/rgbdslam.dir/all] Fehler 2
make: *** [all] Fehler 2
Invoking "make" failed
edit flag offensive delete link more

Comments

You need libopencv_nonfree.so google it and you'll find places to download it from - OpenCV installation instructions here: http://www.samontab.com/web/2012/06/i...

MarkyMark2012 gravatar image MarkyMark2012  ( 2014-08-22 06:32:55 -0500 )edit

Thanks again Mark. Meanwhile I got it from here https://code.google.com/p/myrobotlab/... and I was able to link. Unfortunatly I'm running in a new issue. If run my fresh compiled rgdbslam V2 I get a segmentation fault. Trying to gdb gives following output:

  (gdb) run
    Starting program: /home/ros/catkin_ws/devel/lib/rgbdslam/rgbdslam 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7fffd7cdc700 (LWP 28410)]
    [New Thread 0x7fffd74db700 (LWP 28411)]
    [New Thread 0x7fffd6cda700 (LWP 28412)]

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff7582a8c in boost::math::lanczos::lanczos_initializer<boost::math::lanczos::lanczos17m64, long double>::init::init() () from /usr/lib/libpcl_io.so.1.7
    (gdb) bt
#0  0x00007ffff7582a8c in boost::math::lanczos::lanczos_initializer<boost::math::lanczos::lanczos17m64, long double>::init::init() () from /usr/lib/libpcl_io.so.1.7
#1  0x00007ffff750d186 in ?? () from /usr/lib/libpcl_io.so.1.7
#2  0x00007ffff7dea13a ...
(more)
Pat gravatar image Pat  ( 2014-08-22 07:51:57 -0500 )edit

Difficult to say - similar problem here?? (resolved by recompiling PCL from scratch) http://www.pcl-users.org/Segfault-whe...

MarkyMark2012 gravatar image MarkyMark2012  ( 2014-08-22 08:12:02 -0500 )edit

I built pcl from source but it didn't solved the problem. Get still segfault at the same location. (to be sure I checked with ldd that new built pcl libs are used). It is bewitched! Any other other idea?

Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff7582a8c in boost::math::lanczos::lanczos_initializer<boost::math::lanczos::lanczos17m64, long double>::init::init() () from /usr/lib/libpcl_io.so.1.7
Pat gravatar image Pat  ( 2014-08-23 04:50:29 -0500 )edit

Here the complete gdp out using new built PCL

ros@host1:~/catkin_ws$ gdb /home/ros/catkin_ws/devel/lib/rgbdslam/rgbdslam core 
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/ros/catkin_ws/devel/lib/rgbdslam/rgbdslam...(no debugging symbols found ...
(more)
Pat gravatar image Pat  ( 2014-08-23 05:27:27 -0500 )edit

Regarding boost::shared_ptr<std::map<std::string, std::string=""> > msg_header_map = tf_msg->__connection_header; This header seems to be deprecated since Hydro and removed in Indigo, but I would agree that it may be not needed/important at all. thread

kp gravatar image kp  ( 2014-11-19 05:24:48 -0500 )edit

Hello Pat,

I have the same seg fault for pcl. Did you solve it?

Thanks

costashatz gravatar image costashatz  ( 2015-01-28 10:55:51 -0500 )edit

Any luck with the pcl seg fault so far?

kokirits gravatar image kokirits  ( 2015-06-08 03:11:01 -0500 )edit

Question Tools

5 followers

Stats

Asked: 2014-08-20 01:45:42 -0500

Seen: 4,464 times

Last updated: Nov 20 '14