Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Add substitution nesting#382

Closed
RainCT wants to merge 7 commits intoros:indigo-develfrom
RainCT:nesting
Closed

Add substitution nesting#382
RainCT wants to merge 7 commits intoros:indigo-develfrom
RainCT:nesting

Conversation

@RainCT
Copy link
Copy Markdown

@RainCT RainCT commented Mar 31, 2014

Rationale:

RainCT added 7 commits March 24, 2014 17:44
Note that the only user-visible change with this branch is that "$(foo",
ie. a missing closing parentheses, will throw an exception.
(Unrelated to substitution nesting)

Commit 82f6fed moved test files from roslaunch
to a new test_roslaunch package, but didn't update the path to the "rosmaster.test"
file in the test_roslaunch_deps_main().

The test was still passing, but it wasn't testing what it was supposed
to (ie. that it fails with files from a different package; it was just
throwing non-existent file).
@ros-pull-request-builder
Copy link
Copy Markdown
Member

Can one of the admins verify this patch?

@dirk-thomas
Copy link
Copy Markdown
Member

@ros-pull-request-builder
Copy link
Copy Markdown
Member

Test passed.
Refer to this link for build results: http://jenkins.ros.org/job/_pull_request-indigo-ros_comm/3/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you replace the exceptions with assertions (here and several more times)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already checked in the wrapper function _find_hack(). Similarly, _find_executable()/etc are only called by _find(), not directly.

@RainCT
Copy link
Copy Markdown
Author

RainCT commented Jun 9, 2014

Hi Dirk,

Thanks for the review!

Sorry about the delay, I was travelling when I got the notification and completely forgot to go back to it.

@RainCT
Copy link
Copy Markdown
Author

RainCT commented May 22, 2015

Friendly ping.

@efernandez
Copy link
Copy Markdown
Contributor

@dirk-thomas What is preventing this to be merged? I think this is a good feature and I'd be happy to help with the missing part if any/needed.

@dirk-thomas
Copy link
Copy Markdown
Member

While the patch implements an interesting feature it significantly changes the internal structure of roslaunch. The current tests are not sufficient to ensure that this big change does not break existing launch files. Therefore the PRs hasn't been merged.

There are a few other PRs regarding new features in roslaunch and they are all pending for the same reason.

I am aware that this is not a satisfactory answer. But stability for Indigo is very important.

To move forward on this (and other similar PRs) I think one option would be to get more user with plenty of (complex) roslaunch files to try these changes and confirm that it doesn't break anything for them.

@gerkey
Copy link
Copy Markdown
Contributor

gerkey commented Dec 1, 2015

Could we accomplish the same thing using the pyparsing module? E.g., this simple parser:

from pyparsing import *
d =  '$(find $(arg robot)_description)/robots/upload_$(arg robot).launch'
OneOrMore(nestedExpr(opener='$(') + Word(printables, excludeChars=['$'])).parseString(d)

yields:

([(['find', (['arg', 'robot'], {}), '_description'], {}), '/robots/upload_', (['arg', 'robot'], {}), '.launch'], {})

@rethink-rlinsalata
Copy link
Copy Markdown
Contributor

+1, to the nested substitution feature. This would make a big difference in our use cases (very much along the same lines as the '$(robot_model)_description' examples discussed above). Not having this has meant we have had to make launch files (robot) platform specific, and install/devel specific, which really shouldn't be.

@dirk-thomas Considering the original substitution xml test launch file is still part of the tests, I'm curious what else you see is missing to ensure this feature doesn't break existing launch files?

(also, to @gerkey 's point - I agree it would be good improvement to leverage a dedicated Parsing library for parsing in roslaunch. However, at this point I think it would be better to add this valuable feature first, incrementally upon the implementation that already exists. Then, doing a library refactor could be tested against stably reproducing the same set of features / behavior.)

@rethink-imcmahon
Copy link
Copy Markdown

+1 from me as well. We spent a while searching for any documentation or ROS answers regarding nested args today, and I was surprised this hasn't come up more often.

The python evaluation addition to xacro was a huge boost to its usefulness, which @rhaschke appears to have brought to roslaunch with #707 . I was able to construct an incredibly configurable gripper xacro with 8x different swappable fingers and fingertips with this feature ros/xacro#54

@dirk-thomas
Copy link
Copy Markdown
Member

I will close this in favor if the current PR #762 (which is a follow up of #707 mentioned in the previous comment).

@dirk-thomas dirk-thomas closed this Mar 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants