-
Notifications
You must be signed in to change notification settings - Fork 26
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
Feature load from another package #36
base: develop
Are you sure you want to change the base?
Feature load from another package #36
Conversation
pkg_path = rp.get_path(package_name) | ||
except ResourceNotFound: | ||
return None | ||
full_file_path = pkg_path + '/cfg/' + params_file_name |
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.
It might be handy to have the possibility to specify the relative path.
An extra param to the load_generator
(and affiliated functions) with default value : path='/cfg/'
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.
Done in the last commit. Updated docs accordingly
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.
Thanks 👍
Hi @awesomebytes, |
@artivis I clicked on Update, would that be enough? (CI is pending). |
I actually meant that your branch is based on branch |
@artivis asked me to take a look into how to expand one .params file with another one. The easiest way I found after tinkering a bit was to load from another .params file from another package, and then you can add your additional parameters.
As the documentation says, there is an example package: https://github.com/awesomebytes/imported_rosparam_handler_test that imports from https://github.com/cbandera/rosparam_handler_tutorial and adds a couple of parameters extra.
I needed to do a few hacky things for the sake of not touching any already written
.params
file but it works nicely (as far as I've tried).As improvements, instead of initializing, we could add a way of just expanding the parameters, and even remove some... but if that's not a real use case, there is no reason to implement it.
Also with this change one can test it's writing the .params file correctly by using an python (ipython please?) console as I needed to move to the generation step the error about having != 5 arguments.