SubscriberStatusCallback not called in talker node
Hi, I am trying to implement the simple listener and talker as explained in ROS tutorial link http://wiki.ros.org/ROS/Tutorials/Wri... but I have done a small modification, the publishing to the topic will happen, whenever the listener node connects to the talker, otherwise the message will not be published.
Please check the below talker node implementation but some how the callback is not triggered whenever the listener is subscribed to the topic.
void Publisher::CreateTopic(const std::string &topicname, const std::size_t &queue)
{
const ros::SubscriberStatusCallback callback_conn = std::bind(&Publisher::SubscriberStatusCallback_connect, this, std::placeholders::_1);
const ros::SubscriberStatusCallback callback_discon = std::bind(&Publisher::SubscriberStatusCallback_Disconnect, this, std::placeholders::_1);
chatter_pb = handle.advertise<std_msgs::String>(topicname, queue, callback_conn, callback_discon);
}