CMakeLists.txt and package.xml files of ros image to cv image conversion

asked 2016-08-10 12:17:30 -0500

skr_robo gravatar image

I have successfully built a node that can convert ros images to cv images based on tutorial given here. I had the following lines in my CMakeLists.txt :

find_package(OpenCV REQUIRED)

include_directories(
  ${catkin_INCLUDE_DIRS}
  ${OpenCV_INCLUDE_DIRS}
)

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

and the following in the package.xml :

<build_depend>OpenCV</build_depend>
<run_depend>OpenCV</run_depend>

The link given above says that opencv2 is to be added in package.xml. Out of curiosity, I removed all the above lines with the word OpenCV in both CMakeLists.txt and package.xml. I ran the catkin_make to compile my node again. It ran successfully and the node works fine too. I think it shouldn't. How is it able to know that the package requires opencv?

edit retag flag offensive close merge delete

Comments

are you sure you rebuild the package? please remove the build/devel/install directories to make extra sure and compile again.

Dimitri Schachmann gravatar imageDimitri Schachmann ( 2016-08-11 08:48:08 -0500 )edit

Yes, earlier, I had removed the folder roscv_conv (that's the name I gave for the package) in the build directory and tried it. But it worked. Now that you mentioned devel, I removed every folder that said roscv_conv except the one in src. I did catkin_make. It worked.

skr_robo gravatar imageskr_robo ( 2016-08-12 11:54:37 -0500 )edit

I am running this on ros Indigo in ubuntu 14.04 on a Jetson TX1.

skr_robo gravatar imageskr_robo ( 2016-08-12 12:00:58 -0500 )edit

I haven't removed image_transport and cv_bridge dependencies. Could this be because of that?

skr_robo gravatar imageskr_robo ( 2016-08-12 12:04:54 -0500 )edit
  1. I would recommend to remove the enitre build and devel directories and build everything from scratch. 2. You are using c++, right?
Dimitri Schachmann gravatar imageDimitri Schachmann ( 2016-08-15 03:51:58 -0500 )edit

Yes, I am using c++. I will try this.

skr_robo gravatar imageskr_robo ( 2016-08-18 17:07:43 -0500 )edit