Ask Your Question

Alternatives for (not working) nested substitution arguments for roslaunch

asked 2013-09-20 11:43:36 -0500

updated 2013-09-20 11:44:00 -0500

I´m currently changing the launch file setup on a project and would like to do something like

<include file="$(find $(env ROBOT_TYPE)_config)/launch/planning_config.launch">

This doesn´t appear to be possible. There is a workaround by creating one launch file per robot type and referencing that, but I was wondering if there are other options that I missed and that do not require creating one launch file per robot type. I´m hoping I´m missing some otherwise obvious simple alternative here ;)

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2013-09-22 03:51:26 -0500

I've had the same issue and never found a real solution. One thing that may be a work around is to use xacro ( ) to generate the launch files for each robot. You can run xacro from makefiles (at least in rosbuild you could ).

edit flag offensive delete link more

answered 2016-06-03 21:50:58 -0500

juztamau5 gravatar image

updated 2016-06-04 02:00:42 -0500

gvdhoorn gravatar image

See my answer to a similar question here:

This is now made possible by a feature added to roslaunch version 1.12.1, released April 18, 2016. (ATM the debian repos are at version 1.12.0, so you'll either have to wait or download the github sources)

roslaunch 1.12.1 adds support for evaluation of arbitrary python expressions using the syntax $(eval <expression>). With this change, the following is possible:

<include file="$(eval find(env('ROBOT_TYPE') + '_config') + '/launch/planning_config.launch')">
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: 2013-09-20 11:43:36 -0500

Seen: 606 times

Last updated: Jun 04 '16