Forward / remap multiple topics to a single topic?
Is there already a way to forward / aggregate multiple topics to a single topic?
I tried remapping with rostopic echo
, but found that the last remapping argument takes precedence.
Example in bash:
# Spin up unique publishers
rostopic pub -r 5 /test/a std_msgs/Float64 "data: 0.0" &
rostopic pub -r 5 /test/b std_msgs/Float64 "data: 20.0" &
# Echo with remapping
rostopic echo /test/c /test/c:=/test/a /test/c:=/test/b
The output shows '20.0', meaning b's data is the only one getting through.
For the time being, I wrote a script to aggregate the topics: topic_aggregator.py