ROS2 transfer the same message on the same topic without redundancy
- On Node_1, I'm publishing to /telemetry.
- On Node_2, I'm subscribing on /telemetry & publishing the SAME message back on /telemetry (in order for Node_3 to receive it). I do not create a new message. I just publish back the one received.
- On Node_3, I'm subscribing to /telemetry.
----
- Node_1 & Node_2 are in Network_A.
- Node_2 & Node_3 are in Network_B.
----
As Node_2 is subscribing and publishing in the same topic, the message are going back and forth inside the node.
How do I make Node_2 not sending back to himself the message transferred ? I thought messages were not received twice so I assumed it would work. Seems like not.
UPDATE
After few check, if I create one message and publish it twice, then I'll receive it twice.
How can I avoid this ?