shupx / swarm_ros_bridge

A lightweight middle interface that enables specified ROS message transmission among swarm robots through socket communication

Home Page:https://wiki.ros.org/swarm_ros_bridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The nodehandle namespace of send_topics and recv_topics should be public

shupx opened this issue · comments

In ros_topics.yaml, you can specify the send_topics and recv_topics names in either an absolute or a relative way. However, the topic names will have a ros node name prefix if they are specified in a relative way. For example, - topic_name: chatter will result in the subscribe of /swarm_bridge_node/chatter topic.

This is because that the nodehandles of advertising and subscribe are public rather than private:

ros::NodeHandle nh("~");

subscriber = topic_subscriber(sendTopics[i].name, sendTopics[i].type, nh, i);

publisher = topic_publisher(recvTopics[i].name, recvTopics[i].type, nh);

This is unwanted and we need the prefix only be defined by <group ns=''> tag in the launch file.

So the nodehandles should be public.

This is fixed in commit c31fc94. Now relative send_topic and recv_topic names are also supported.