Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thank @jayess. As you said pulisher was missing. The real program is as follows. In my program I subscribe depth values from Gazebo and are planning to publish pointclouds based on that data. However, although the program was activated while Gazebo was running, the callback function was ignored at first. And from the second lap only the callback function was called and the publisher stopped working.

ros::Subscriber sub = nh.subscribe("/pico_flexx_link/depth_registered/image_raw", 1000, messageCallback);

ros::Publisher pub = nh.advertise<PointCloud> ("points2", 1); /*This code was missing*/

PointCloud::Ptr msg (new PointCloud);