Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 417

Help in making node with OpenCV/cv_bridge and ROS Indigo

$
0
0
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: opencv2cv_bridgeimage_transportopencv2cv_bridgeimage_transport 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 // don't need the transport headers for this routine; #include #include #include #include ... using namespace cv; I have read the migration guide and looked for others online, including this post: (http://answers.ros.org/question/185105/add-opencv-to-indigo/) but still not sure how to fix this. Any help is appreciated.

Viewing all articles
Browse latest Browse all 417

Trending Articles