ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
5

Does roslaunch support topic remapping from command line?

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

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~

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
7

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

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

Comments

Defining an arg is probably the best solution available.

joq gravatar image joq  ( 2013-02-18 07:30:34 -0500 )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 image Po-Jen Lai  ( 2013-02-18 14:00:54 -0500 )edit
1

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 image Po-Jen Lai  ( 2013-02-18 14:03:08 -0500 )edit

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

joq gravatar image joq  ( 2013-02-18 14:12:09 -0500 )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 image dornhege  ( 2013-02-18 23:36:59 -0500 )edit

Thanks for your help~

Po-Jen Lai gravatar image Po-Jen Lai  ( 2013-02-20 15:29:01 -0500 )edit
1

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

RafBerkvens gravatar image RafBerkvens  ( 2013-10-01 02:24:58 -0500 )edit
1

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

davinci gravatar image

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

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

edit flag offensive delete link more
0

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

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

Comments

So you mean roslaunch supports only remapping by remap tag?

Po-Jen Lai gravatar image Po-Jen Lai  ( 2013-02-17 19:05:57 -0500 )edit

Yeah i guess..

ayush_dewan gravatar image ayush_dewan  ( 2013-02-17 21:39:10 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 9,592 times

Last updated: Feb 17 '13