-
Notifications
You must be signed in to change notification settings - Fork 166
Extend PythonExpression substitution to simplify the notation #600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b82ae1c
Extend PythonExpression substitution to simplify the notation
f5c41b2
Support automatic expanding LaunchConfiguration
ec0366f
Fix test_execute_process.py
93c4827
Refactor
c39c563
Refactor
83e059e
Revert "Support automatic expanding LaunchConfiguration"
205e7cc
Add empty check
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kenji-miyake I understand it's the easy path forward, but we can't merge a barely-implemented feature. IMHO, if we want
$(eval)to be able to use launch configurations as variables, we need to inject launch configurations ineval()'s local scope.CC @ivanpauno @wjwwood
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that sounds better, the current proposal is too ad-hoc.
Maybe this is a problem (?).
We probably need to modify the launch substitutions grammar to make it more flexible, which will require a bit of thinking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your reviews!
Is there any sample code that does this? Unfortunately, I'm not so familiar with the design concept of
launch. 😢Anyway, I'll drop expanding LaunchConfiguration from this PR for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted by 4cc38be.
@hidmic @ivanpauno Would you please teach me what else should I change? 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hidmic @ivanpauno Friendly ping. Could you review this again? 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hidmic Thank you for your comment!
Hmm, I didn't care about the case. But I guess just adding an eval with try-cache can support it? 🤔
Yes, I agree with that. (I've changed this to a draft for now.)
How can I build a consensus on the syntax and move things forward?
Are there any design concept documents or plans for the eval syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, how about adding
eqandnesubstitutions like #598?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kenji-miyake first of all, my apologies for the insane delay. I've been uber busy.
Now, circling back to this.
A concrete proposal is the way to go. You want to simplify notation by making
$(var name)andnameequivalent in$(eval ...)context. We agree with the intent, but we need a fully functional implementation i.e. not just for a few operators. One possible approach is to inject launch configurations inevalscope.That doesn't solve the quoting issue though. In
launchsubstitutions' grammar, arguments are delimited by spaces and so you need quotes to pass a single argument that includes a space e.g.'/my/very/unhelpful path'. Quotes must be dropped in these cases. When an$(eval)expression is not quoted, the parser will try to splitexpressioninto space delimited arguments, potentially dropping quotes from string literals, and the rest follows.The only easy way I see we could avoid this is by instructing the substitution parser to skip the entire
$(eval)expression. That means, no nested substitutions, tracking left and right parenthesis, and coming up with a special escaping mechanism for parenthesis so that something like$(anon $(eval data() + ')'))doesn't fall apart.IIRC there are no design documents about the syntax itself. Only the grammar.
That's definitely a simpler (better?) path forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hidmic Hi, welcome back! No problem, I know ROS maintainers are quite busy. 😢
And thank you for your detailed explanation. But it's super difficult for me... I have to learn the grammar a lot.
Oh, it's good to hear that. Can I send a new PR to add
eq/ne?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eq/neseem to be implemented in #649.