I'm not sure, if roslaunch supports that - just try it.
If it doesn't, you can use args for that:
<arg name="from_topic" />
<remap from="from_topic" to="$(arg from_topic)"/>
Command line syntax should stay the same.
Originally posted by dornhege with karma: 31395 on 2013-02-18
This answer was ACCEPTED on the original site
Post score: 7
Original comments
Comment by joq on 2013-02-18:
Defining an arg is probably the best solution available.
Comment by Po-Jen Lai on 2013-02-18:
Thanks~
I tried but it doesn't work, so I want to make sure if it was my problem or roslaunch doesn't support this function.
Comment by Po-Jen Lai on 2013-02-18:
I don't understand "Command line syntax should stay the same.". What does command line syntax look like?
Isn't it roslaunch [package name] [launch file name] chatter:=hello
?
Comment by joq on 2013-02-18:
That would be the syntax. But, in Christian's arg example: substitute "chatter" for "from_topic". His answer was more generic.
Comment by dornhege on 2013-02-19:
I meant that the command line remapping looks exactly the same as when remapping topics, although the underlying functionality (using args) is different.
Comment by Po-Jen Lai on 2013-02-20:
Thanks for your help~
Comment by RafBerkvens on 2013-10-01:
This example could be easier to understand if the arg name was 'to_topic'.
Comment by stfn on 2019-03-19:
https://github.com/ros/ros_comm/issues/1664