ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Foreign Relay Spams Topic

asked 2013-08-27 03:38:35 -0500

jker gravatar image

updated 2013-08-27 07:33:21 -0500

I have two ROS masters running on the same machine (on different ports) that I want to publish/subscribe a topic between one another. I've been using Foreign Relays for this purpose, since I've successfully used them to communicate between robots on different machines. However, whenever I run my relay and publish once to it on master A, the receiving topic on master B gets spammed with that one message at a rate of approximately 40,000Hz. These are the same parameters I've used in the launch files in packages where foreign relays work as expected, so I'm not sure why they are behaving differently as the only difference is that they're communicating on the same computer.

Master A's .launch file:

<launch>
  <node name="generic_msg_foreign_relay" pkg="foreign_relay" type="foreign_relay"
        args="adv http: //localhost:11311 /test /test" respawn="true"/>
</launch>

Master B's .launch file:

<launch>
  <node name="respond_to_test_topic" pkg="testing"
        type="test_topic_node.py" output="screen" respawn="true"/>
</launch>

And to publish I've just manually done rostopic pub /test std_msgs/String 'testing' once (no change with the -1 argument either).

I have not yet looked into Multimaster because I was hoping to not have to use any new packages (and foreign relay seems more customizable in terms of declaring the masters on startup), but if that's the only solution it'll have to do. However I'd like to know first if anyone can reproduce what I'm seeing, and if anyone has an idea what the problem might be?

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-08-27 07:31:31 -0500

jker gravatar image

updated 2013-08-27 07:33:04 -0500

After some more testing, I've found that you cannot use a foreign relay that uses the same topic at both ends (at least not if you want it to work as intended and not spam the topic).


So instead of using args="adv http: //localhost:11311 /test /test"

I needed to use args="adv http: //localhost:11311 /testA /testB"

edit flag offensive delete link more

Comments

Can you give some details about how to use foreign relay??? I need to communicate between multiple robots.

ayush_dewan gravatar image ayush_dewan  ( 2013-09-07 09:55:39 -0500 )edit

did you have it to work?

Vinh K gravatar image Vinh K  ( 2016-07-20 16:21:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-08-27 03:38:35 -0500

Seen: 383 times

Last updated: Aug 27 '13