Coordination and Timing of MQTT messages
When starting up the two applications (gazebo workspace and this repository), one is always started first and sends its MQTT messages to some topic to which the other has not subscribed yet. That way, messages are lost. A concrete example is the initial robot config, in which ros2rag sends a message to the robot, which data should be sent.
Possible solutions include
Retain
Using the "retain" flag/feature of MQTT. Here, once the message is sent to the broker, every subscriber to that topic will receive this message right away.
- Pro: easy to implement
- Con: Possible inconsistencies if an "older" message is read, e.g., when both systems have been restarted, but the broker is still running
- Con: At most one retained message per topic
Coordinator service/model
We could implement a new, small model used to coordinate all other models, keep track of their state and maybe provide means to query the state of other systems.
- Pro: flexible
- Pro: possibly another "paradigm"
🙂 - Con: has to implemented