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

It looks like you're trying to publish the OpenCV image directly. From what I can recall, you need to convert it to an Image message before you can publish it. To do that use, cv_bridge. Here's a brief example that should help you get started (I've included only the bare minimum, for more info see the tutorial on the wiki)

from cv_bridge import CvBridge


bridge = CvBridge()


pub.publish(bridge.cv2_to_imgmsg(frame, "bgr8"))