ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

problem with opencv and cv_bridge

asked 2012-02-01 19:56:24 -0500

metal gravatar image

updated 2014-04-20 14:09:22 -0500

ngrennan gravatar image

hi guys ,I am trying to interface ROS(diamondback) and opencv. I am working on ubuntu 10.04 . I followed the tutorial in the following link

http://www.ros.org/wiki/cv_bridge/Tutorials/UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages

I created a package with the following dependencies sensor_msgs,image_transport,opencv2,cv_bridge,roscpp,std_msgs.

I used the same program in the link above and copied it to the "src" folder as a CPP file. I compiled it using rosmake (after being done with cmake). This was my output:

[ rosmake ] No package specified. Building ['ardrone_kar']
[ rosmake ] Packages requested are: ['ardrone_kar']
[ rosmake ] Logging to directory/home/metallo/.ros/rosmake/rosmake_output-20120202-043021 [ rosmake ] Expanded args ['ardrone_kar'] to: ['ardrone_kar']
[ rosmake ] Checking rosdeps compliance for packages ardrone_kar. This may take a few seconds. Failed to find rosdep opencv2 for package ardrone_kar on OS:ubuntu version:10.10 WARNING: Rosdeps [u'opencv2'] could not be resolved [ rosmake ] rosdep check passed all system dependencies in packages
[rosmake-0] Starting >>> roslib [ make ]
[rosmake-0] Finished <<< roslib ROS_NOBUILD in package roslib
[rosmake-1] Starting >>> rosbuild [ make ]
[rosmake-1] Finished <<< rosbuild ROS_NOBUILD in package rosbuild No Makefile in package rosbuild [rosmake-2] Starting >>> cpp_common [ make ]
[rosmake-2] Finished <<< cpp_common ROS_NOBUILD in package cpp_common
[rosmake-3] Starting >>> xmlrpcpp [ make ]
[rosmake-0] Starting >>> std_msgs [ make ]
[rosmake-1] Starting >>> roslang [ make ]
[rosmake-2] Starting >>> roscpp_traits [ make ]
[rosmake-3] Finished <<< xmlrpcpp ROS_NOBUILD in package xmlrpcpp
[rosmake-1] Finished <<< roslang ROS_NOBUILD in package roslang No Makefile in package roslang [rosmake-0] Finished <<< std_msgs ROS_NOBUILD in package std_msgs
[rosmake-1] Starting >>> rostime [ make ]
[rosmake-2] Finished <<< roscpp_traits ROS_NOBUILD in package roscpp_traits
[rosmake-1] Finished <<< rostime ROS_NOBUILD in package rostime
[rosmake-0] Starting >>> rosgraph_msgs [ make ]
[rosmake-3] Starting >>> roscpp_serialization [ make ]
[rosmake-2] Starting >>> rosconsole [ make ]
[rosmake-0] Finished <<< rosgraph_msgs ROS_NOBUILD in package rosgraph_msgs
[rosmake-3] Finished <<< roscpp_serialization ROS_NOBUILD in package roscpp_serialization [rosmake-2] Finished <<< rosconsole ROS_NOBUILD in package rosconsole
[rosmake-1] Starting >>> rosclean [ make ]
[rosmake-0] Starting >>> rospy [ make ]
[rosmake-3] Starting >>> roscpp [ make ]
[rosmake-0] Finished <<< rospy ROS_NOBUILD in package rospy
[rosmake-3] Finished <<< roscpp ROS_NOBUILD in package roscpp
[rosmake-1] Finished <<< rosclean ROS_NOBUILD in package rosclean
[rosmake-2] Starting >>> rosgraph [ make ]
[rosmake-2] Finished <<< rosgraph ROS_NOBUILD in package rosgraph
[rosmake-0] Starting >>> rosparam [ make ]
[rosmake-0] Finished <<< rosparam ROS_NOBUILD in package rosparam
[rosmake-1] Starting >>> rosmaster [ make ]
[rosmake-1] Finished <<< rosmaster ROS_NOBUILD in package rosmaster
[rosmake-3] Starting >>> rosout [ make ]
[rosmake-3] Finished <<< rosout ROS_NOBUILD in package rosout
[rosmake-2] Starting >>> rosunit [ make ]
[rosmake-2] Finished <<< rosunit ROS_NOBUILD in package rosunit
[rosmake-0] Starting >>> tinyxml [ make ]
[rosmake-0] Finished <<< tinyxml ROS_NOBUILD in package tinyxml
[rosmake-3] Starting >>> roslaunch [ make ]
[rosmake-1] Starting >>> opencv2 [ make ]
[rosmake-2] Starting >>> pluginlib [ make ]
[rosmake-3] Finished <<< roslaunch ROS_NOBUILD in package roslaunch No Makefile in package roslaunch [rosmake-2] Finished <<< pluginlib ROS_NOBUILD in package pluginlib
[rosmake-3] Starting >>> rostest [ make ]
[rosmake-3] Finished <<< rostest ROS_NOBUILD in package rostest
[rosmake-3] Starting >>> topic_tools [ make ]
[rosmake-3] Finished <<< topic_tools ROS_NOBUILD in package topic_tools
[rosmake-3] Starting >>> rosbag [ make ]
[rosmake-0] Starting >>> message_filters [ make ]
[rosmake-1] Finished <<< opencv2 [PASS] [ 0.02 seconds ]
[rosmake-3] Finished <<< rosbag ROS_NOBUILD in package rosbag
[rosmake-3] Starting >>> rosbagmigration [ make ]
[rosmake-0] Finished <<< message_filters ROS_NOBUILD in package message_filters [rosmake-3] Finished <<< rosbagmigration ROS_NOBUILD in package rosbagmigration No Makefile in package rosbagmigration [rosmake-3] Starting >>> geometry_msgs [ make ]
[rosmake-3] Finished <<< geometry_msgs ROS_NOBUILD in package geometry_msgs
[rosmake-3] Starting >>> sensor_msgs [ make ]
[rosmake-3] Finished <<< sensor_msgs ROS_NOBUILD in ... (more)

edit retag flag offensive close merge delete

Comments

As @Patrick Mihelich said, please don't shout. There are many people reading this forum and keeping it nice to read it important. I have removed the shouting for you this time.
tfoote gravatar image tfoote  ( 2012-02-02 15:37:37 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-02-02 06:51:19 -0500

Patrick Mihelich gravatar image

Please don't shout.

The problem is you're compiling the trunk (or perhaps Electric) version of cv_bridge against your Diamondback install of sensor_msgs. Mixing packages from different ROS distros will almost always get you into trouble. In this case, in Electric we added support for some 16-bit encodings (BGR16, RGB16, etc.). So the Electric cv_bridge references those, but they aren't defined in the Diamondback sensor_msgs.

You're on Ubuntu, so you shouldn't need to compile cv_bridge at all. Just use the prebuilt debian package:

sudo apt-get install ros-diamondback-vision-opencv

If there's some ROS stack that you need to modify (and therefore install from source), make sure to check out the maintenance branch for whatever distro you're using. In this case that would be:

https://code.ros.org/svn/ros-pkg/stacks/vision_opencv/branches/vision_opencv-1.4

1.4 = Diamondback, 1.6 = Electric, and trunk is for active development (currently leading to Fuerte).

edit flag offensive delete link more

Comments

Patrick thanks for your response.I downloaded the vision_opencv-1.4
metal gravatar image metal  ( 2012-02-02 15:33:09 -0500 )edit
Patrick ,I installed ros electric in the same machine where diamondback was.The file I had problem with is able to build clearly now.But I cant create the driver file.I got the dependencies and also made proper changes in the cmake.txt. But the driver file is not getting created at all...
metal gravatar image metal  ( 2012-02-04 17:41:51 -0500 )edit

Question Tools

Stats

Asked: 2012-02-01 19:56:24 -0500

Seen: 2,667 times

Last updated: Feb 02 '12