Subscriber gets no messages
Hi,
I am almost going crazy ... I analyse a bag file and monitor a strange behaviour. When I use the code below I have to comment one of rospy.Subscriber(...) lines. Otherwise the Program gets no message and rxgraph shows no connection. But with only one subscriber (regardless of which) the code works well!
What is wrong in my idea?
Best wishes from Germany Enjoy the weekend
Poseidonius
import roslib; roslib.load_manifest('Localization')
import rospy
from std_msgs.msg import Float32
def callback(event, index):
print index
rospy.init_node('OdoMapper')
rospy.Subscriber("/OdoLeft", Float32, callback, 0) # one of them have to be commented
rospy.Subscriber("/OdoRight", Float32, callback, 1)
rospy.spin()