0
$\begingroup$

Rosanswers logo

I have ROS Indigo on Ubuntu Trusty, and I'm following along with this tutorial http://wiki.ros.org/image_transport/Tutorials/PublishingImages. However, if I go along with the code exactly, catkin_make tells me that cv_bridge/CvBridge.h doesn't exist. If I replace CvBridge with cv_bridge, it has no problem finding the header file, but I get a problem with the following line:

  sensor_msgs::ImagePtr msg = sensor_msgs::cv_bridge::cvToImgMsg(image.Ipl(), "bgr8"); 

The message I get is "error: ‘sensor_msgs::cv_bridge’ has not been declared". Is CvBridge.h deprecated as of Indigo? If so, how do I accomplish what cvToImgMsg is supposed to do?


Originally posted by K. Zeng on ROS Answers with karma: 23 on 2014-10-08

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Looks like that tutorial is 4 years old, so sadly looks like the API has been broken since then.

If you take a look at the code api, you can see the correct method to call and the namespace as well. You should be able to call the .toImageMsg() method directly on the CvImage type.


Originally posted by paulbovbel with karma: 4518 on 2014-10-08

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by paulbovbel on 2014-10-08:
This tutorial looks more up to date http://wiki.ros.org/cv_bridge/Tutorials/UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages

Comment by ahendrix on 2014-10-08:
CvBridge.h was deprecated in Fuerte or Groovy, and was removed in Hydro. The cv_bridge tutorials are up to date, but I guess this tutorial didn't get updated along with the others.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.