0
$\begingroup$

Rosanswers logo

Hello,

We have many ROS nodes doing a fairly standard use of the publisher/subscriber mechanism as explained in the documentation. It is clear from ROS documentation that both the publishers and the subscribers can be started at any order and ROS will connect them.

In our case, we only receive messages in the subscriber if the publisher was launched first. And even if we do so, restarting the publisher will lead to the subscriber not receiving messages any more unless we also restart the subscriber.

As far as I understand from ROS documentation, this is unexpected. Where could I start for to troubleshoot this problem?

Thanks in advanced.


Originally posted by daniel_ctae on ROS Answers with karma: 16 on 2011-06-06

Post score: 0


Original comments

Comment by Lorenz on 2011-06-06:
Could it be a networking issue? Do your nodes run on different hosts? Is the local host name set correctly, i.e. can you ping it? You could try setting the environment variable ROS_IP to your local IP address.

Comment by Dimitar Simeonov on 2011-06-06:
are you using messages on a topic or services? I second bhaskara that if you give example it will be easier for people to help you. It sounds like it is possible that you have a logic bug, rather than a bug in the ROS communication infrastructure.

Comment by bhaskara on 2011-06-06:
Could you post a minimal example that reproduces this behavior?

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

This is a complete guess, but I'm guessing that you are using roslaunch to bring up your test cases. If so are you running roscore seperately? Because if you are not, when you "stop" the first roslaunch which you started it will take down the roscore which was started for you. After that all connected nodes will continue to communicate, but cannot reconnect. And the next launch will bring up the roscore with for you again, since it was not detected. But only nodes launched after the roscore will be able to connect with each other.

So if this is your case, run roscore seperately. Or make sure the first roslaunch you bring up stays up for the duration of your testing.


Originally posted by tfoote with karma: 58457 on 2011-06-06

This answer was NOT ACCEPTED on the original site

Post score: 3

$\endgroup$
0
$\begingroup$

Rosanswers logo

Hello again,

Thanks for the quick answers and comments. I will provide more information to each of them:

tfoote, I am indeed running the roscore separately as you suggest. Your guess could have explained perfectly what we are experiencing, but it must be something else. Thanks a lot.

Dimitar Simeonov, sorry I didn't clarify it but I meant messages on topics.
bhaskara, we have this behaviour in pretty much all our nodes with different source code combinations. Unfortunately I don't have access to the source code today, so I will post it tomorrow. Thanks.

Lorenz, yes, my nodes mainly run on different nodes. All the network setup seems correct to my but I am actually not setting the ROS_IP (I thought it was enough to set ROS_MASTER_UI). I will definitely try and report here. Thanks.


Originally posted by daniel_ctae with karma: 16 on 2011-06-07

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

Hello all,

As Lorenz suggested defining the ROS_IP solved my problem. I had different network interfaces (wlan0, eth0, etc) and I had to explicitly tell ROS which one to use. This is clearly explained in http://www.ros.org/wiki/ROS/EnvironmentVariables : "This setting is only needed in situations where you have multiple addresses for a computer and need to force ROS to a particular one. "

Problem solved. Thanks for your quick support.

Daniel.


Originally posted by daniel_ctae with karma: 16 on 2011-06-07

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.