Black image for an Image publisher with image_transport
I made a node retrieving an image with openCV explained on this ROS tutorial. The image is ten converted into a format suitable for ROS, using CV_bridge functions.
Problem is, there is no image that are published at all on the \camera topic. I tried visualizing it using
rosrun image_view image_view
But the only thing that appear is a black image. I also tried using rviz camera, but nothing appears; rviz indicate that no image is received:
Here is the code of the publisher:
And here is the CMakeLists.txt file:
I made a standalone version of the code for openCV, and it display image correctly using imshow. I do believe that the problems lies in the conversion of the openCV image to the format required by the ROS nodes, but I do not know where to look to solve such problem.