Closed artivis closed 7 years ago
Hello @artivis, thanks for the idea. I have played around a little and come up with a possible solution in commit 718d617. Please have a look at it and see whether it works for you. After building the package and sourcing, you should be able to use the syntax you suggested:
rosrun rosparam_handler generate_yaml path/to/dummy.params
It will generate the yaml file in your current directory.
Things that I am not sure about yet:
Will the mock of the import always work? What if someone does
from rosparam_handler.parameter_generator_catkin import ParameterGenerator
Is there a better way to solve this?
Hi @cbandera !
This is great, thanks a lot for your work.
I will give it a shot asap and give you feedback.
As for your questions, I do not think that the yaml file should be generated at compilation for two simple reasons. First I believe that the user should pro-actively generate it, thus calling the command. The second point is actually the one you already raised, where would you put such file during compilation ? Will the user have to dig into the devel
folder to find it ? That wouldn't be very handy...
Just try this with a couple of .params
files I'm using and it works smoothly.
I'm not using all available features in these files so I couldn't assert that everything works but it definitely looks good.
To its current state, the scripts prints in the terminal the whole content of the dictionary. I suppose this is for debugging purpose.
I was looking for a way to generate a yaml file from a params file at any time (not only at compile time).
Expected workflow :
given the following
dummy.params
A command such as :
Would generate :
dummy.yaml
with all defined parameters with description and as much info as available.
Only parameters with default value would be un-commented.
The problem is that
dummy.params
is somewhat self-contained and I couldn't really find what would be the entry point for thegenerate_yaml
.Does that feature make sense to anyone else ? Any idea on how to approach the issue ?