how to pass a string argument that contains white space?
I have a program that takes string as an argument, such as
$ ./say "hello world"
and would like to invoke this program from roslaunch.
Here is an example of the launch file:
< launch> < node name="say" pkg="say" type="say" args='\"hello world\"' /> < /launch>
When I check the command line argument with
$ roslaunch say.launch --args /say
the output is
PYTHONPATH=/opt/ros/diamondback/ros/core/roslib/src /home/k-okada/ros/diamondback/say/say "hello world" __name:=say
and this is ok to me. but when I try to start this program from launch file by
$ roslaunch say.launch
the argument corrupts. It seems that the roslaunch divide string arugment into each words as written in the log file
[roslaunch][INFO] 2011-07-01 13:35:10,808: process[hoge-1]: args[[u'/home/k-okad a/ros/diamondback/say/say', '"hello', 'world"', u'__name:= say']]
Changing the launch file to
< launch> < node name="say" pkg="say" type="say" args='\"hello\ world\"' /> < /launch>
worked, but if there are other solution, I would like to know that.