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

image_transport::Subscriber image_sub_;

while(1) { image_sub_=it_.subscribe("/ardrone/image_raw", 1,imageCallback); ...... }

and in the end of imageCallback function I add this code, "image_sub_.shutdown()"

The final result seems, the subscriber will shutdown, but never resubscribe.

image_transport::Subscriber image_sub_;

while(1) { image_sub_=it_.subscribe("/ardrone/image_raw", 1,imageCallback); ros::spin(); ...... }

and in the end of imageCallback function I add this code, "image_sub_.shutdown()"

The final result seems, the subscriber will shutdown, but never resubscribe.