ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

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
2

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 ( http://wiki.ros.org/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
1

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: http://answers.ros.org/question/35283...

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

Question Tools

1 follower

Stats

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

Seen: 717 times

Last updated: Jun 04 '16