Questions about openCV installation and tutorial
Hi everybody,
Question #1: I installed opencv opencv2 and cv_bridge as explained it the realtive sections. So I wrote a simple program to use opencv and I got lot of problems. Then I tried to simply copy and paste the script in the tutorial and I get now:
/home/wilhem/workspace_ros/src/cam_experiment/src/main.cpp: In function ‘void imageCallback(const ImageConstPtr&)’: /home/wilhem/workspace_ros/src/cam_experiment/src/main.cpp:43:3: error: ‘CvBridge’ is not a member of ‘sensor_msgs’ sensor_msgs::CvBridge bridge; ^ /home/wilhem/workspace_ros/src/cam_experiment/src/main.cpp:43:25: error: expected ‘;’ before ‘bridge’
sensor_msgs::CvBridge bridge; ^
here is my CMakeList.txt:
cmake_minimum_required(VERSION 2.8.3)
project(cam_experiment)
find_package(catkin REQUIRED COMPONENTS
#cv_brigde # I HAVE TO KEEP cv_bridge UNCOMMENTED OTHERWISE ERRORS APPEAR. MORE LATER
image_transport
roscpp
sensor_msgs
std_msgs
)
catkin_package(
CATKIN_DEPENDS cv_brigde image_transport roscpp sensor_msgs std_msgs
)
include_directories(
${catkin_INCLUDE_DIRS}
)
add_executable( cam_experiment src/main.cpp )
target_link_libraries( cam_experiment ${catkin_LIBRARIES} )
Question #2: if I try to specify in my CMakeLists.txt that I want to use cv_bridge I get the following problem and it didn t get compiled:
Could not find a package configuration file provided by "cv_brigde" with
any of the following names:cv_brigdeConfig.cmake cv_brigde-config.cmake
Add the installation prefix of "cv_brigde" to CMAKE_PREFIX_PATH or set "cv_brigde_DIR" to a directory containing one of the above files. If "cv_brigde" provides a separate development package or SDK, be sure it has been installed.
Question #3: After reading in the Q&A I found that running:
$ locate cv2.so | grep python
I get the following output:
/usr/lib/python2.7/dist-packages/cv2.so
which is definitely NOT in a ROS' folder. Maybe it is the problem, but since opencv is not more a package of ROS it must been installed from source. How to get the library linked and with a program compiled? Ah! I m running indigo and he webcam drivers are working in ROS.
Regards and nice sunday
Beyond the answers below, you might want to check that you are spelling bridge correctly. It shows up incorrectly in a few places in your question