Subscribing to Multiple Nodes Publishing the Same Topic
Hi all,
I am having an issue that I'm not sure has been addressed. I am writing a node where I am attempting to subscribe to another two nodes that publish to the same topic (i.e. two lasers that are publishing to a topic with the same name). Going back and changing the topic names would be a little bit tricky, so I was wondering if there was a way to differentiate these two (i.e. write a subscriber that takes into account topic name and node-of-origin name when being instantiated.
Thanks
Edit: I'm confused how the syntax works for remapping and was wondering if I could ask for more help:
Originally, I have as a launch file:
<launch>
<node pkg="leg_detector" type="leg_detector" name="leg_detector_front" args="scan:=scan_front $(find leg_detector)/config/trained_leg_detector.yaml" output="screen"/>
<node pkg="leg_detector" type="leg_detector" name="leg_detector_rear" args="scan:=scan_rear $(find leg_detector)/config/trained_leg_detector.yaml" output="screen"/>
</launch>
I tried this:
<launch>
<node pkg="leg_detector" type="leg_detector" name="leg_detector_front" args="scan:=scan_front $(find leg_detector)/config/trained_leg_detector.yaml" output="screen"/>
<group>
<remap from="leg_tracker_measurements" to="leg_tracker_measurements_rear">
<node pkg="leg_detector" type="leg_detector" name="leg_detector_rear" args="scan:=scan_rear $(find leg_detector)/config/trained_leg_detector.yaml" output="screen"/>
</group>
</launch>
But it threw an invalid syntax error
'Close' your remap tag. <remap from="leg_tracker_measurements" to="leg_tracker_measurements_rear"/> or <remap from="leg_tracker_measurements" to="leg_tracker_measurements_rear"> </remap>