rostopic publishing strange behavior with remote rosmaster
I have a very strange and annoying problem. I followed the documentation setup http://wiki.ros.org/ROS/NetworkSetup to use a remote rosmaster. I can see the topic list, ssh from both computers...
But I have this problem :
node_A is on the computer 1 where roscore is running.
node_B is on the remote computer 2.
node_B listens to a topic published /info by node_A.
If I launch node_B then node_A, the callback in node_B which get the message from /info is never called.
If I run node_A first, node_B will work as expected.
I noticed that if I do rostopic echo /info in both computers then run node_A. I will see data on computer 1 but not on computer 2.
I did all they asked to check in the documentation so I have no idea where my configuration can be wrong.
Here is the code for the subscriber :
#!/usr/bin/env python
import rospy
from std_msgs.msg import Float32MultiArray
def array_callback(array):
print "Received errors"
print array.data[0], array.data[1]
rospy.init_node('erros_printer')
rospy.Subscriber("errors", Float32MultiArray, array_callback)
rospy.spin()
And the publisher :
#!/usr/bin/env python
import rospy
rospy.init_node('errors_sender')
pub = rospy.Publisher("errors", Float32MultiArray)
array = Float32MultiArray()
array.data.append("ok")
array.data.append("hello")
while True:
pub.publish(array)
Seems less of Configuration issue and more of subscriber publisher problem. Can you give more information on the code for them ?
I edited my question with a simplified version of my subscriber and publisher nodes