coordinate publisher and subscriber c++
how can I coordinate a subscriber and a publisher?I have to send a message(a position) to a robot with a publisher, then wait from the robot if he received the position(reading from a topic), and if he hadn't received it, publish the position again.
Would this not be something for which actions are better suited?
To prevent an xy-problem: could you describe what it is that you actually want to achieve (ie: instead of asking about an approach you've already chosen)?
well, I will try to explain in a better way..Ii have to write a starting message to an AUV through an acoustic channel for its positioning, then the robot has to say "yes, I received the starting message" and if yes my node shoud start sending messages to it with its absolute position.
Is it a request / reply kind of communication? In that case you might take a look at services in ROS. If the service takes a long time to execute, you might consider actions, as @gvdhoorn suggests.