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

Revision history [back]

click to hide/show revision 1
initial version

I think that the problem is in the image variable, the error message says that it is of type "Subscriber". cvbridge takes the sensor_msgs/Image.msg as input not the subscriber.

Your callback should be something like: (where data is your image message)

  def callback(self,data):
      cv_image = self.bridge.imgmsg_to_cv2(data, "bgr8")

You may add try and except to raise any related exceptions. Review the cvbridge tutorial for more details.