Help in making node with OpenCV/cv_bridge and ROS Indigo
Greetings,
Running ROS Indigo
, Ubuntu 14.04
and catkin_simple
. My system has downloaded:
libopencv-dev
and ros-indigo-cv-bridge
I am trying to make a package that uses opencv's mouse button events. After making the package, I got the following errors related to opencv:
home/menon/juan/ros_workspace/hku_drc_class_sysu/catkin/src/vision_stack/steer_fitting/src/patch_select.cpp: In function \u2018void mouse_callback(int, int, int, int, void*)\u2019:
/home/menon/juan/ros_workspace/hku_drc_class_sysu/catkin/src/vision_stack/steer_fitting/src/patch_select.cpp:188:14: error: \u2018CV_EVENT_LBUTTONDOWN\u2019 was not declared in this scope
case CV_EVENT_LBUTTONDOWN:
^
/home/menon/juan/ros_workspace/hku_drc_class_sysu/catkin/src/vision_stack/steer_fitting/src/patch_select.cpp:197:14: error: \u2018CV_EVENT_LBUTTONUP\u2019 was not declared in this scope
case CV_EVENT_LBUTTONUP:
^
/home/menon/juan/ros_workspace/hku_drc_class_sysu/catkin/src/vision_stack/steer_fitting/src/patch_select.cpp: In function \u2018void onMouse(int, int, int, int, void*)\u2019:
/home/menon/juan/ros_workspace/hku_drc_class_sysu/catkin/src/vision_stack/steer_fitting/src/patch_select.cpp:489:18: error: \u2018CV_EVENT_LBUTTONDOWN\u2019 was not declared in this scope
if (event == CV_EVENT_LBUTTONDOWN)
^
/home/menon/juan/ros_workspace/hku_drc_class_sysu/catkin/src/vision_stack/steer_fitting/src/patch_select.cpp: In function \u2018int main(int, char**)\u2019:
/home/menon/juan/ros_workspace/hku_drc_class_sysu/catkin/src/vision_stack/steer_fitting/src/patch_select.cpp:613:36: error: \u2018CV_WINDOW_NORMAL\u2019 was not declared in this scope
namedWindow("image_window",CV_WINDOW_NORMAL); //window for openCV displays
^
make[2]: *** [vision_stack/steer_fitting/CMakeFiles/patch_select.dir/src/patch_select.cpp.o] Error 1
make[1]: *** [vision_stack/steer_fitting/CMakeFiles/patch_select.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j20 -l20" failed
Failed to build catkin packages!
My package.xml contains the following opencv related dependencies:
<build_depend>opencv2</build_depend>
<build_depend>cv_bridge</build_depend>
<build_depend>image_transport</build_depend>
<run_depend>opencv2</run_depend>
<run_depend>cv_bridge</run_depend>
<run_depend>image_transport</run_depend>
And my CMakeLists.txt looks as follows (patch_select is the node that uses opencv):
cmake_minimum_required(VERSION 2.8.3)
project(steer_fitting)
find_package(catkin_simple REQUIRED)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
find_package(PCL 1.7 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
catkin_simple()
# Executables
cs_add_executable(valve_fitting src/valve_fitting.cpp)
cs_add_executable(patch_select src/patch_select.cpp)
target_link_libraries(valve_fitting ${PCL_LIBRARIES})
target_link_libraries(patch_select ${OpenCV_LIBS})
cs_install()
cs_export()
And finally, these are the #includes in my code:
// OpenCV includes
#include <image_transport/image_transport.h> // don't need the transport headers for this routine;
#include <image_transport/subscriber_filter.h>
#include <cv_bridge/cv_bridge.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
...
using namespace cv;
I have read the migration guide and looked for others online, including this post: ( http://answers.ros.org/question/18510... ) but still not sure how to fix this. Any help is appreciated.
Are those all of the errors? I would either expect that you are unable to find a particular header (it would be the first error) or that you haven't included a header that you need. Either way I don't see anything
catkin
orcatkin_simple
related that would cause these compile errors.