Ask Your Question
0

How to get param value in to arg in roslaunch?

asked 2018-12-06 03:13:25 -0500

Tal gravatar image

updated 2018-12-06 03:13:54 -0500

I am using ros kinetic
I have ros parameter name "tal"

I want to get this param value into argument tag.

<arg name="tal_arg" value=??? />

I am using ros kinetic,
this post suggest to use eval, but I don't know how to do it.
Can you help?

edit retag flag offensive close merge delete

Comments

Did you try putting the value in double quotes?

Like this,

<arg name="foo" value="bar" />

as given in the link

pmuthu2s gravatar image pmuthu2s  ( 2018-12-06 03:25:51 -0500 )edit
2

I think the OP is asking how to put a dynamic parameter value into an argument not a literal value.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-12-06 03:34:12 -0500 )edit

I want to put the value of rosparm tal like $(param tal) into argument tal_arg.

Tal gravatar image Tal  ( 2018-12-06 03:39:17 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-12-06 03:36:56 -0500

The solution you linked to involves making a simple python node which reads the desired parameter value and prints it to stdout. You can then use the value="{eval scriptname.py}" syntax to run that node and put the value it outputs into the argument.

Hope this helps

edit flag offensive delete link more

Comments

where i can put this python scrip? There is other way besides the ways in the link?

Tal gravatar image Tal  ( 2018-12-06 03:41:34 -0500 )edit

Ideally it should be inside a catkin package in the src directory. If you don't already have a workspace with a package setup then I recommend having a look at the tutorials to set one up and create a simple node.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-12-06 03:45:54 -0500 )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

2 followers

Stats

Asked: 2018-12-06 03:13:25 -0500

Seen: 1,685 times

Last updated: Dec 06 '18