remapping already remapped topics
Like the title says, is it possible to remap already remapped topics? So suppose you include another launch file in your main launch file and you want to remap some topics from the included launch file, but those topics have already been remapped in the include, which you don't want to change/cannot change. Is this possible and if so how? I tried a couple of different cases and nothing did work.
Example
talker.launch (with first remap)
<launch>
<node pkg="node_example" type="talker" name="talker">
<param name="a" value="1"/>
<param name="b" value="2)"/>
<param name="message" value="Hello World"/>
<param name="rate" value="2.0"/>
<remap from="example" to="chatter"/>
</node>
</launch>
main.launch (with remap of remapped chatter) <- does not work
<launch>
<remap from="/chatter" to="/foo"/>
<include file="$(find node_example)/launch/talker.launch">
</include>
</launch>
or main.launch <- does not work
<launch>
<group>
<remap from="/chatter" to="/foo"/>
<include file="$(find node_example)/launch/talker.launch"/>
</group>
</launch>
or main.launch <- does not work
<launch>
<include file="$(find node_example)/launch/talker.launch"/>
<remap from="/chatter" to="/foo"/>
</launch>
Still the topic is /chatter
and not /foo
.
Asked by antibus on 2019-05-21 10:31:59 UTC
Comments
Can you describe in more detail what you tried, including the launch files themselves. This should be possible but we can't help you unless you show us exactly what you've tried.
Asked by PeteBlackerThe3rd on 2019-05-21 10:38:20 UTC
Added example to question.
Asked by antibus on 2019-05-21 11:38:38 UTC
And if you spec:
from="/chatter" to="/foo"
?Asked by gvdhoorn on 2019-05-21 11:40:43 UTC
Does not help.
Asked by antibus on 2019-05-21 11:42:58 UTC
The wiki says:
So this should in theory be possible, I'd say. It depends probably on the order of the evaluation (parameters, e.g. are "are set in order (after includes are processed)").
Maybe you have to use the original name, i.e.
/example
in thefrom=
field?Asked by mgruhler on 2019-05-22 00:55:54 UTC
Nope, still
/chatter
even if with<remap from="/example" to="/foo"/>
inmain.launch
Asked by antibus on 2019-05-22 01:53:00 UTC
Just out of curiostiy, have you tried removing the remap from the included launch file (I know, this is not what you want to do in the end) and see if the remap is working with any of the ways you tried above?
Asked by mgruhler on 2019-05-22 02:39:10 UTC
Haven't tried it so far. Good point. Tried it now and it worked. The topic has been correctly remapped to
/foo
.Asked by antibus on 2019-05-22 02:42:33 UTC
So it is working for every example above or just some?
Have you also tested your last example (
include
beforeremap
) with using/example
in thefrom=
field?If not, this might help you to resolve your issue. If yes, I guess what you want to do is not possible due to the definition of "scope"...
Asked by mgruhler on 2019-05-22 03:54:24 UTC