ros/ros_comm — pull request #473 by mikepurvis (2014-07-23 14:17:00+00:00)
Title: Support roslaunch XML on stdin.

This addresses #472.

My apologies for the whitespace modifications; if you feel strongly, I can revise the PR to reverse them. pep8 hates trailing whitespace, so my editor is set to strip it on save. Functionally, I believe this where it needs to be. Some example tests:

```bash
$ roslaunch
Usage: roslaunch [options] [package] [arg_name:=value...]

roslaunch: error: you must specify at least one input file

$ roslaunch -
... logging to /home/administrator/.ros/log/edd1c682-1272-11e4-8714-001c42910917/roslaunch-vm-precise2-3063.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Passed '-' as file argument, attempting to read roslaunch XML from stdin.
^CTraceback (most recent call last):
File "/home/administrator/roslaunch_ws/devel/bin/roslaunch", line 5, in
exec(fh.read())
File "", line 35, in
File "", line 279, in main
KeyboardInterrupt

$ roslaunch foo
[foo] is not a launch file name
The traceback for the exception was written to the log file

$ roslaunch rosserial_server socket.launch
[ launch occurs successfully ]

$ echo '' | roslaunch -
... logging to /home/administrator/.ros/log/35e04d4a-1273-11e4-bb24-001c42910917/roslaunch-vm-precise2-3250.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Passed '-' as file argument, attempting to read roslaunch XML from stdin.
... 14 bytes read successfully.

... loading XML
Launch string:

Exception: Invalid roslaunch XML syntax: no root tag
The traceback for the exception was written to the log file

$ echo '' | roslaunch -
... logging to /home/administrator/.ros/log/50488b34-1273-11e4-8288-001c42910917/roslaunch-vm-precise2-3262.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Passed '-' as file argument, attempting to read roslaunch XML from stdin.
... 79 bytes read successfully.

... loading XML
Added node of type [rosserial_server/socket_node] in namespace [/]
started roslaunch server http://vm-precise2:53924/
[ launch continues successfully ]
```

I've avoided modifying the `--help` output to mention this functionality, since it's a bit esoteric and the command-line help should stay simple and focused. I'll add a comment to the roslaunch wiki page once we're merged.