-
Notifications
You must be signed in to change notification settings - Fork 914
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
Add $(dirname) to get directory of current launch file. #1103
Conversation
I support this proposal. Well done, Mike! My only thought is regarding the first bullet point:
Does this imply that Either way, this can be solved with a sentence in the docs :) |
The patch looks good to me. Can you please add some tests (probably to |
@IanTheEngineer Nope,
But might prefer to have something more like:
@dirk-thomas Yup, tests in progress. I'll add to the unit test, but I'm thinking it would also be worthwhile to add something a bit more end-to-end to the test_roslaunch package, basically an automated version of the demonstration posted in the proposal. One other bit of bikeshedding to do— the |
Very good point. I would rather avoid overriding Python keywords in that case. Maybe |
Changed to |
Great, thank you. When you have a chance can you please mention this new feature in the wiki and post a link here for future readers to find it. |
* Add $(dir) to get directory of current launch file. * Change $(dir) -> $(dirname) * Add simple tests for $(dirname) substitution. * Add xmlloader test for $(dirname).
I'm working on adding some test coverage for this, but the basic idea for usage is allowing stuff like:
Where the output is:
Some possible use-cases for this:
$(find)
— instead just$(dir)/other.launch
.eval
to make the a launch file do different things depending on where it's installed. For example<node .... if="$(eval dir().startswith('/opt'))" />
FYI @guillaumeautran @Jin-Myung