subscriber cannot receive topic on rospy
I made a node which has 1 action client, 5 subscribers and 1 publisher. I wrote its pseudo code is following. When I tried a certain sequence, one of the subscribers sub1 did not call its callback cb1 every time. If you know the reason why the subscriber did not call cb1, could you tell me how to fix?
In the sequence, topic1 was published 2 times, when topic1 had different parameters. When topic1 was published with parameter B before not be published with parameter C, sub1 received topic1. At this time, "[cb1]called" was displayed on a terminal. however, after that, when topic1 with parameter C was published, sub1 did not receive the topic and "[cb1]called" was not displayed. I confirmed the topic1 subscribed was published with using command-line "rostopic echo". The topic was published by rosbridge_websocket node. After sub1 missed topic1, when I tried command-line "rostopic pub /topic1 ...", sub1 received topic1 and cb1 was called. I do not why sub1 received topic1 in the case...
[ pseudo code ]
def cb1(p_msg):
rospy.loginfo("[cb1]called")
if(...):
...
else:
...
if name == 'main':
rospy.init_node("node_name", anonymous=True)
action_client = actionlib.SimpleActionClient('move_base', MoveBaseAction)
sub1 = rospy.Subscriber("topic1", type1, cb1)
sub2 = rospy.Subscriber("topic2", type2, cb2)
sub3 = rospy.Subscriber("topic3", type3, cb3)
sub4 = rospy.Subscriber("topic4", type4, cb4)
sub5 = rospy.Subscriber("topic5", type5, cb5)
cmd_vel_pub = rospy.Publisher("cmd_vel_mux/input/navi", Twist, queue_size=2)
rospy.spin()
Following figure shows whta I said.