Repository navigation
Conversation
|
Are there practical use cases for this? I know the |
|
I'm sure there are, although I'm not too interested in it, what I really want is supporting eg. string comparisons in ifs (may submit a patch for that sometime). That would allow us to combine many duplicate launch files where only little details change (eg. depending on the robot). |
Since repeated executions of the same command may actually return different results.
|
The shell substitution this PR adds is conceptionally problematic since it encourages platform specific code in launch files. Since you already mentioned that you actually don't need that "power" for your use case a more specific solution should be developed. Depending on how severe the change / extension to roslaunch should be it might be worth to go through a community review via the REP process (http://www.ros.org/reps/rep-0000.html). |
|
Well, launch files are platform specific. One problem we have here is that we have a copy of all launch files for each robot/model, because there are mostly subtle differences between them; this is not at all optimal, since there's a lot of duplication and files can get out of sync. This could be avoided if roslaunch implemented: a) string comparison, and b) integer comparisons (<, >, =). Since those could be combined with "env" it would let us unify most launch files. Would this (string and integer comparisons) require a REP or should I just submit a patch? |
|
Launch files are not by design platform specific. And actually a lot of launch files are definitely not. Current launch files only support simple conditions (see http://wiki.ros.org/roslaunch/XML#if_and_unless_attributes). If you would like to work on a pull request which adds the proposed comparisons that would be great and imo does not require a REP. It might be good to discuss the way you want to realize it before diving into the code to avoid work in the "wrong" direction. Please also consider providing the corresponding documentation for the wiki page once it the pull request is done. |
|
Hi Dirk, Thanks for your response. My idea was adding substitutions, for instance: "$(streq a b)", "$(eq a b)", "$(lt a b)" and "$(le a b)" (or maybe "$(cmp a OP b)" with OP \in {<,>,<=,>=,==}). This would require support for substitution nesting, which I've implemented here: RainCT@779e83f (I'll open a pull request for this once I've tested it a bit). |
|
This is replaced by #382 and a to-be-written pull request adding the comparison functions. Therefore closing this ticket. |
This is an updated version of the patch by raywilhe in #102.