ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

bash script output to param

asked 2016-09-06 05:41:14 -0500

neobonde gravatar image

Is there a way to take the output of a bash script and use it as a param in a ros launch file. The script should also run in the same launch file

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-09-06 06:07:06 -0500

gvdhoorn gravatar image

I think roslaunch/XML/param's command attribute should do what you want:

command="$(find pkg-name)/exe '$(find pkg-name)/arg.txt'" (optional)

The output of the command will be read and stored as a string. It is strongly recommended that you use the package-relative $(find)/file.txt syntax to specify file arguments. You should also quote file arguments using single quotes due to XML escaping requirements.

I'm not sure what you mean with:

The script should also run in the same launch file

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-09-06 05:41:14 -0500

Seen: 551 times

Last updated: Sep 06 '16