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

How to encode special characters in a launch file <param> element

asked 2011-11-21 00:32:45 -0500

billmania gravatar image

In the following example, I would like to have the value of the parameter "myString" to contain only two ASCII characters: CarriageReturn and LineFeed. How do I specify them in the definition of a parameter in a launch file?

<param name="myString" type="string" value="\r\n"/>

I've searched for the definition for all of the "special characters" but have not yet found the right combination of search terms.

edit retag flag offensive close merge delete

Comments

BTW, what is your actual use case here? I mean, \r\n is not your typical parameter, so I was wondering if there is another way to achieve what you need.
roehling gravatar image roehling  ( 2011-11-22 17:14:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-11-21 19:03:31 -0500

updated 2011-11-21 19:06:28 -0500

Usually, you would encode CR and LF as the XML entities &#13; and &#10; respectively. However, roslaunch trims whitespace (including CR/LF) from the beginning and the end of a parameter string value (which is unfortunate and possibly a bug), and seems to apply the XML end-of-line handling (convert CR+LF and CR to LF) even to these encoded entities (which would be a bug in the XML parser).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-11-21 00:32:45 -0500

Seen: 913 times

Last updated: Nov 21 '11