0
$\begingroup$

Rosanswers logo

Hi all,

The roslaunch page says that we can remap topic by simply adding this line to launch file.

<remap from="chatter" to="hello"/>

I want to ask if we can do the same thing in command line?

roslaunch <package name> <launch file name> chatter:=hello

Thanks~


Originally posted by Po-Jen Lai on ROS Answers with karma: 1371 on 2013-02-17

Post score: 5

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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

$\endgroup$
0
$\begingroup$

Rosanswers logo

That is possible (but not using roslaunch): rosrun rospy_tutorials talker chatter:=/wg/chatter

http://www.ros.org/wiki/Remapping%20Arguments


Originally posted by davinci with karma: 2573 on 2013-02-17

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.