subscriber fails
I have a ros application that subscribes to a published topic, when starting the application every now and then the subscriber will not go into the callback associated with it. I know this because I am subscribing to periodic data and I have a counter in the callback, sometimes the counter is not being incremented. I do not see any errors doing roswtf and using rostopic info on the topic shows that the subscriber is properly subscribed. I am only able to recover from it by detecting it and then restarting the system. I am currently testing to see if the ros::Subscriber returns false when it is initialized when this problem occurs (havent gotten the error to happen yet). My question is, is there any way I can know if this problem happens and if so, is there any way I can recover from it? Also, is there any way to prevent this from happening?
Could you share your code here?