default message handling [closed]
Hello everybody, I would like to know if there is a way to handle default values messages. Here is the situation. I have a subscriber and a publisher both written in c++ that read and write at different speeds. The publisher is very slow with respect to the subscriber. Since the subscriber if very fast happens often that the topic is empty. This causes the retrieval of continuous default messages that are very ambiguous (the string is default set to "0" and this is actually a problem) is there a way to check if the topic is empty and throw away the message? thanks Andrea
I'm not sure if I follow. If there is no message on the topic, your subscriber will not receive an empty one, not matter how "fast" it is. Maybe show some code to illustrate what you are doing.
If there is no message on a topic the subscriber gets a default value of the type of message it is looking for. I am adding some code in the question
@demmein yes you were right. It was a side effect of some other code. Sorry for the silly question ;)
If your problem is solved please mark your question as closed or something similar!
Yes, I forgot. Thanks for reminding