It's safe to Publish and Subscribe on same Topic?
Hi everybody, I am developing a framework where multiple identical nodes are running concurrently and each of them controls the movements of a different robot (3 robots for now). They all have a matrix describing the environment in which they are moving to plan the movements.
Each of them also has another matrix containing the number of times a certain position has been visited. What I want is that every node updates its map when one of the robots moves to a new position and to do this I was thinking of making them publishing and subscribing to the same topic their position, and in the callback function modify the "visitCountMatrix" accordingly.
Is this safe? If not, can you think of a different solution? Keep in mind that I want the controllers to be independent one from another, i.e. they cannot share a common matrix. Thanks! :)