what is the fastest way to copy and ROS topic to another ROs topic based on some condition without having a node in between ? Is this possible ?
Copy? No.
Clarification: not without a node in between, remember: ROS has no broker, so nodes are the only entities that participate in actual communication. No nodes ->
no communication.
Redirect: yes.
But only at system startup time (in ROS 1, see #q31718: I don't believe this has changed).
Use remapping.
See #q303611 for a high-level explanation.
Edit: if copying is really a requirement, you could take a look at the relay
(and perhaps relay_field
) nodes from the topic_tools package.
Edit 2: there is a variant of topic_tools
that has been implemented as a nodelet: nodelet_topic_tools. It doesn't seem to provide a version of relay
, but if it did, that would seem to be the closest you could get to zero-copy runtime rewiring/remapping of ROS topics in ROS 1.