catkin_make ros-pkg failed

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

catkin_make ros-pkg failed

mencoa
System: Ubuntu 14.04 with ROS Indigo (as VMware Guest OS)
RTAB-Map Version: r1966

Issue:
Followed Issue 8 (https://code.google.com/p/rtabmap/issues/detail?id=8) workaround, I compiled & installed OpenCV 2.4.9 and then the rtabmaplib, both were successful and I can run the rtabmap (as standalone). However it failed when compiling ros-pkg.

Here is the catkin_make (second try) log:


cvlab@cvlab-VM:~/Works/programs/ros$ catkin_make
Base path: /home/cvlab/Works/programs/ros
Source space: /home/cvlab/Works/programs/ros/src
Build space: /home/cvlab/Works/programs/ros/build
Devel space: /home/cvlab/Works/programs/ros/devel
Install space: /home/cvlab/Works/programs/ros/install
####
#### Running command: "make cmake_check_build_system" in "/home/cvlab/Works/programs/ros/build"
####
####
#### Running command: "make -j4 -l4" in "/home/cvlab/Works/programs/ros/build"
####
[  0%] Built target sensor_msgs_generate_messages_py
[  0%] [  0%] Built target geometry_msgs_generate_messages_py
Built target std_msgs_generate_messages_py
[  0%] Built target _rtabmap_generate_messages_check_deps_ResetPose
[  0%] Built target _rtabmap_generate_messages_check_deps_InfoEx
[  0%] Built target _rtabmap_generate_messages_check_deps_MapData
[  0%] Built target _rtabmap_generate_messages_check_deps_Info
[  0%] Built target _rtabmap_generate_messages_check_deps_PublishMap
[  0%] Built target _rtabmap_generate_messages_check_deps_GetMap
[  0%] Built target _rtabmap_generate_messages_check_deps_Bytes
[  0%] Built target _rtabmap_generate_messages_check_deps_KeyPoint
[  0%] [  1%] Built target sensor_msgs_generate_messages_cpp
Built target rtabmap_gencfg
[  1%] Built target geometry_msgs_generate_messages_cpp
[  1%] Built target _rtabmap_generate_messages_check_deps_NodeData
[  1%] [  1%] [  1%] Built target std_msgs_generate_messages_cpp
[  1%] Built target sensor_msgs_generate_messages_lisp
Built target std_msgs_generate_messages_lisp
Built target geometry_msgs_generate_messages_lisp
[ 18%] [ 32%] Built target rtabmap_generate_messages_py
[ 46%] Built target rtabmap_generate_messages_lisp
Built target rtabmap_generate_messages_cpp
[ 47%] Built target visual_odometry
[ 47%] Built target rtabmap_generate_messages
Linking CXX executable /home/cvlab/Works/programs/ros/devel/lib/rtabmap/camera
[ 80%] Built target rtabmap_ros
Linking CXX executable /home/cvlab/Works/programs/ros/devel/lib/rtabmap/data_player
Linking CXX executable /home/cvlab/Works/programs/ros/devel/lib/rtabmap/data_recorder
Linking CXX executable /home/cvlab/Works/programs/ros/devel/lib/rtabmap/grid_map_assembler
/usr/local/lib/libopencv_nonfree.so.2.4.9: undefined reference to `cv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/cvlab/Works/programs/ros/devel/lib/rtabmap/camera] Error 1
make[1]: *** [rtabmap/CMakeFiles/camera.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/local/lib/libopencv_nonfree.so.2.4.9: undefined reference to `cv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/cvlab/Works/programs/ros/devel/lib/rtabmap/data_player] Error 1
make[1]: *** [rtabmap/CMakeFiles/data_player.dir/all] Error 2
/usr/local/lib/libopencv_nonfree.so.2.4.9: undefined reference to `cv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/cvlab/Works/programs/ros/devel/lib/rtabmap/grid_map_assembler] Error 1
make[1]: *** [rtabmap/CMakeFiles/grid_map_assembler.dir/all] Error 2
/usr/local/lib/libopencv_nonfree.so.2.4.9: undefined reference to `cv::ocl::integral(cv::ocl::oclMat const&, cv::ocl::oclMat&)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/cvlab/Works/programs/ros/devel/lib/rtabmap/data_recorder] Error 1
make[1]: *** [rtabmap/CMakeFiles/data_recorder.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed


I also tried OpenCV 2.4.10, but still the same error.

Could you pls advice how to deal with it? Thank you
Reply | Threaded
Open this post in threaded view
|

Re: catkin_make ros-pkg failed

matlabbe
Administrator
I've reproduced the problem (with OpenCV 2.4.9). A workaround here is to disable OpenCL from OpenCV build. But it is strange that the standalone rtabmap libraries can be compiled without problems. It may have a difference with the compiler options between the standalone and catkin builds. Another related post here.
Reply | Threaded
Open this post in threaded view
|

Re: catkin_make ros-pkg failed

alexr
Hi Mathieu,
I am facing exactly the same problem with the OpenCV 2.4.9 build from source. When running catkin_make it gives the same build errors.

I tried to rebuild by turning off the opencl but same problem persists.

I want to know whether just using the binaries will affect the performance of rtabmap on ros and when playing the database on the standalone rtabmap application.

I have recently migrated to ros indigo and am stuck now.

Also installing an older version of OpenCV will be good. What are your opinions on using an older version of opencv instead for example 2.4.5 or even 2.4.2?

Thanks
Alex
------ Alex
Reply | Threaded
Open this post in threaded view
|

Re: catkin_make ros-pkg failed

matlabbe
Administrator
Hi Alex,

I tested again and I've modified the rtabmap_ros CMakeLists.txt to explicitly look for OpenCV and set the its libraries found before linking to catkin libraries (which indirectly include OpenCV binaries from cv_bridge). Normally, no specific requirements should be taken when building OpenCV (no need to disable OpenCL). It should be installed in "/usr/local" though (default install path), to be found by the package before the binaries installed in "/usr" (the PATH should have /usr/local/bin before /usr/bin, which is already the default).

See this commit: https://github.com/introlab/rtabmap_ros/commit/fa06d3050df0eb8d107a12e0c0159919891e1964

So just update rtabmap_ros, and catkin_build again.

cheers

Reply | Threaded
Open this post in threaded view
|

Re: catkin_make ros-pkg failed

alexr
Hi Mathieu,

With the new fix, i was able to build the rtabmap without problems with opencv 2.4.9 . Thanks.

Regards
Alex

------ Alex