Hello
I have multiple subscriber calling the same callback function. How can
I determinate within my callback function the related topic name?
getPublisherName gives me the related publisher but not the topic?
for (unsigned int i = 0; i < topics.size(); i++) {
sub[i] = n_.subscribe(topics[i], 1000, &MyClass::callback, this);
}
void callback(const ros::MessageEvent<std_msgs::String const>& event)
{
const std::string& publisher_name = event.getPublisherName();
#Here comes the problem
const std::string& topic_name = event.?????????();
}
Thanks
Markus