Topic remapping in launch.xml is not working for topic_tools/mux node
The documentation for topic_tools/mux says:
IMPORTANT: To avoid conflicting with other instances of mux, you should always remap the mux's node name to something descriptive, using the mux:=foo syntax on the command line.
And indeed if I run
$ rosrun topic_tools mux output input1 input2 mux:=foobar &
$ rosservice list
I can see through the service list that the node's services has been remapped to /foobar/add
and so on.
However if I put the equivalent entry in my launch.xml
:
<node name="mux" pkg="topic_tools" type="mux" args="output input1 input2">
<remap from="mux" to="foobar" />
</node>
then the remapping does not work; the service uses the default names of /mux/add
, etc.
The process list entries seem similar:
# roslaunch, not working
/opt/ros/noetic/lib/topic_tools/mux output input1 input2 mux:=foobar __name:=mux __log:=/root/.ros/log/1edcbb1e-ea9d-11ec-a797-0242ac110002/mux-7.log
# rosrun, working
/opt/ros/noetic/lib/topic_tools/mux output input1 input2 mux:=foobar
The behavior is baffling. When __name:=mux
is provided, the topic remapping does not work. But if I omit __name:=mux
or provide ANY name other than mux
the remapping succeeds.
I could possibly understand if the remapping mux:=foobar
caused __name:=mux
to become __name:=foobar
but it doesn't make sense for __name:=mux
to cause mux:=foobar
to be ignored.