How to pass inputs from bash script to a rosrun program?
Hey all,
I am trying to write a bash script to simulate user input into a rosrun package.
I'm trying to do something like this:
rosrun ros_package ros_executable
echo "input1" | ros_executable
sleep 10
echo "input2" | ros_executable
it depends a bit on what you are trying to accomplish, so maybe you could elaborate on your question... In the meantime, I'll point you towards
rosparam
which has a commandline interface that you can use to set parameters. Else, if yourros_executable
has a subscriber or service server you can use the ros cli to ping those (e.g.ros topic pub ...
orros service call ...
. Finally, you could write a launch file that applies the delays itself (see: #233353).