# Subscribing to publisher in concurrent Smach state

We have two concurrent sub state machines in a smach.Concurrence state, using ROS Kinetic. Let's say the two states A and B belong to different concurrent states, respectively. B has some updated data that I want to also have in A. Because of this answer from 2012, I'm assuming that this can't easily be done via userdata, which is why B has a number of publishers and A has the corresponding subscribers.

Here's the problem: The subscribers within A don't seem to work as expected. Most of the messages published by B don't arrive at all, except for one std_msgs.msg.String message which arrives up to 3 times in a row despite only being published once.

I used rostopic to verify that the messages that are not being received are indeed published. Using the Message Publisher in rqt results in all messages being received as I would expect.

Could this problem be due to us using smach.Concurrence? Is there maybe a better way of synchronizing data between two concurrent state machines without having to leave and re-enter them?

edit retag close merge delete