I'd like to use launch-prefix to pipe the stdout of a program (netcat) to the stdin of a ros node.
It works fine when launched from rosrun:
netcat 10.0.0.10 8001 | rosrun foo stdin_to_msg.py
I can also copy the command line that roslaunch generates (determined by ps -aux | grep stdin_to_msg.py) and run that successfully, but when run in the launch file the stdout from netcat is sent to the stdout of the roslaunch terminal if output="screen" (or nowhere if not, or a log file?), and the node itself never starts.
<node name="stdin_to_msg" pkg="foo" type="stdin_to_msg.py"
launch-prefix="netcat 10.0.0.10 8001 |" output="screen"/>
Probably I can wrap this in a bash script and run that from roslaunch, but I'm curious if there is an in-launch solution.
Originally posted by lucasw on ROS Answers with karma: 8729 on 2017-09-19
Post score: 0