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

Revision history [back]

click to hide/show revision 1
initial version

Values in launch-prefix are really used as prefixes: so instead of starting simply binary_a, the command line changes to whatever_you_had_in_launch_prefix binary_a. So whatever you have as a launch-prefix must result in a valid command line when concatenated with the name of the binary and the rest of the arguments.

Separate from this, your .launch file will still need to be valid XML (as that's what .launch files are), which is what your immediate problem is: you cannot embed " in an XML attribute like you do now. It can be done, but you'd probably end up with all sorts of XML entity substitutions which may be hard to get right.

Easiest way out would probably be to write a separate Bash script which takes care of all of this. Then you'd pass the path to the script as your launch-prefix and you can make your conditional logic as complex as a Bash script would allow.

(you're obviously not limited to Bash scripts, anything which is executable could be used)

Values in launch-prefix are really used as prefixes: so instead of starting simply binary_a, simply

binary_a [rest of args]

the command line changes to whatever_you_had_in_launch_prefix binary_a. to

$value_of_launch_prefix binary_a [rest of args]

So whatever you have as a launch-prefix must result in a valid command line when concatenated with the name of the binary and the rest of the arguments.

Separate from this, your .launch file will still need to be valid XML (as that's what .launch files are), which is what your immediate problem is: you cannot embed " in an XML attribute like you do now. It can be done, but you'd probably end up with all sorts of XML entity substitutions which may be hard to get right.

Easiest way out would probably be to write a separate Bash script which takes care of all of this. Then you'd pass the path to the script as your launch-prefix and you can make your conditional logic as complex as a Bash script would allow.

(you're obviously not limited to Bash scripts, anything which is executable could be used)