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.
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.
Done in the last commit. Updated docs accordingly
|
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
.paramsfile 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.