Ask Your Question

Does roslaunch support topic remapping from command line?

asked 2013-02-17 18:24:05 -0600

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


edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-02-17 23:29:01 -0600

dornhege gravatar image

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.

edit flag offensive delete link more


Defining an arg is probably the best solution available.

joq gravatar imagejoq ( 2013-02-18 07:30:34 -0600 )edit

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.

Po-Jen Lai gravatar imagePo-Jen Lai ( 2013-02-18 14:00:54 -0600 )edit

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?

Po-Jen Lai gravatar imagePo-Jen Lai ( 2013-02-18 14:03:08 -0600 )edit

That would be the syntax. But, in Christian's arg example: substitute "chatter" for "from_topic". His answer was more generic.

joq gravatar imagejoq ( 2013-02-18 14:12:09 -0600 )edit

I meant that the command line remapping looks exactly the same as when remapping topics, although the underlying functionality (using args) is different.

dornhege gravatar imagedornhege ( 2013-02-18 23:36:59 -0600 )edit

Thanks for your help~

Po-Jen Lai gravatar imagePo-Jen Lai ( 2013-02-20 15:29:01 -0600 )edit

This example could be easier to understand if the arg name was 'to_topic'.

RafBerkvens gravatar imageRafBerkvens ( 2013-10-01 02:24:58 -0600 )edit

answered 2013-02-17 21:08:29 -0600

davinci gravatar image

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

edit flag offensive delete link more

answered 2013-02-17 19:00:03 -0600

I dont think so. Using rosrun remapping can be done using terminal. If the value for remapping is variable then u can use that value as input argument to launch file and within launch file u do remapping using the input argument.

edit flag offensive delete link more


So you mean roslaunch supports only remapping by remap tag?

Po-Jen Lai gravatar imagePo-Jen Lai ( 2013-02-17 19:05:57 -0600 )edit

Yeah i guess..

ayush_dewan gravatar imageayush_dewan ( 2013-02-17 21:39:10 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-02-17 18:24:05 -0600

Seen: 6,400 times

Last updated: Feb 17 '13