Build PKG with opencv libs

asked 2015-05-06 05:30:20 -0500

I'm having multiple trouble to build some packages on ROS Indigo (Ubuntu 14.04) while I installed a long time ago OpenCV 3.0.0. One example pkg with which I'm having trouble is tum_ardron. But I have my own pkg in which I have a video feed based Kalman Filter tracking (implemented with OpenCV). The issue appears to be a linking mismatch between OpenCV versions. I have installed the 3.0.0 and the ROS catkin searches for a lib with v2.4.8 : No rule to make target '/usr/lib/x86_64-linux-gnu/libopencv_videostab.so.2.4.8', needed by '/home/UTworkSpace/devel/lib/Corridor/corridorDetect'. Stop.

My package was first created in ROS Fuerte and now I wan to migrate to Indigo without success. Does any one know how to fix it?

My build files are like :

CMakeList.txt

cmake_minimum_required(VERSION 2.8.3) project(Corridor)    
find_package(catkin REQUIRED COMPONENTS   ardrone_autonomy   cv_bridge   image_transport   roscpp )

find_package(OpenCV)
add_message_files(   FILES   corridorFlyCommand.msg )
generate_messages(    DEPENDENCIES    std_msgs  )

catkin_package()

include_directories(   ${catkin_INCLUDE_DIRS}   ${OpenCV_INCLUDE_DIRS}   )

add_executable(corridorDetect src/main.cpp)

target_link_libraries(corridorDetect   ${catkin_LIBRARIES}    ${OpenCV_LIBRARIES}  )

Package.xml

<package>

  <name>Corridor</name>   <version>3.1.0</version>

   <maintainer email="elod@todo.todo">ElodP</maintainer> 
   <description> Corridor image processing pkg  </description>
    <author>Robotics Research Group</author>   
    <license>BSD</license>
    <buildtool_depend>catkin</buildtool_depend> 
    <build_depend>ardrone_autonomy</build_depend> 
    <build_depend>cv_bridge</build_depend> 
    <build_depend>image_transport</build_depend>  
    <build_depend>opencv2</build_depend>   
    <build_depend>roscpp</build_depend>   
    <build_depend>rospy</build_depend>   
    <build_depend>std_msgs</build_depend>

    <run_depend>ardrone_autonomy</run_depend> 
    <run_depend>cv_bridge</run_depend>   
    <run_depend>image_transport</run_depend> 
    <run_depend>opencv2</run_depend>
    <run_depend>roscpp</run_depend>
    <run_depend>rospy</run_depend> 
  <run_depend>std_msgs</run_depend>
 </package>

And in my code header is like:

#include <iostream>
#include <fstream>
// for img processing 
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/video/tracking.hpp>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
// for Kalman filter
#include <opencv/cv.h>
// control masege includeing
#include <time.h>
#include <Corridor/corridorFlyCommand.h>

Finally my error massage after executing catkin_make:

Base path: /home/elod/UTworkSpace
Source space: /home/elod/UTworkSpace/src
Build space: /home/elod/UTworkSpace/build
Devel space: /home/elod/UTworkSpace/devel
Install space: /home/elod/UTworkSpace/install
WARNING: Package name "Corridor" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits and underscores.
WARNING: Package name "tagFollower" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits and underscores.
####
#### Running command: "make cmake_check_build_system" in "/home/elod/UTworkSpace/build"
####
####
#### Running command: "make -j4 -l4" in "/home/elod/UTworkSpace/build"
####
[  0%] [  0%] Built target std_msgs_generate_messages_lisp
Built target std_msgs_generate_messages_cpp
[  0%] Built target std_msgs_generate_messages_py
make[2]: *** No rule to make target `/usr/lib/x86_64-linux-gnu/libopencv_videostab.so.2.4.8', needed by `/home/elod/UTworkSpace/devel/lib/Corridor/corridorDetect'.  Stop.
make[1]: *** [Corridor/CMakeFiles/corridorDetect.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  0%] [  0%] Built target getnavdataproportional
Built target _Corridor_generate_messages_check_deps_corridorFlyCommand
[ 10%] Built target TapirSolver
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
edit retag flag offensive close merge delete

Comments

Also see https://github.com/ros-perception/ima... for detection of "2.4.8' apparently hardcoded in the ROS code.

Will Chamberlain gravatar image Will Chamberlain  ( 2018-09-27 04:55:26 -0500 )edit