Jannkar / turtle_nest

Ros 2 Package Creator
Apache License 2.0
98 stars 5 forks source link

Support for ROS 2 parameters? #7

Closed guillaumeautran closed 1 week ago

guillaumeautran commented 3 weeks ago

As part of the UI, would it a good idea to add automatic parameter creation? Especially when one wants to create a list of parameters that can be dynamically changed at runtime, a lot of boiler plate code needs to be setup. Adding all that as part of the UI could simplify things even further.

raitzjm commented 3 weeks ago

@guillaumeautran This not be exactly what you are looking for, but have you looked in to this library? https://github.com/PickNikRobotics/generate_parameter_library

it is a nice library to avoid re-writing boiler plate all the time for parameters

guillaumeautran commented 3 weeks ago

I was not aware of this library. Will give it a try and see how it could simplify my projects. Thanks for sharing!

Jannkar commented 3 weeks ago

Thanks for the suggestion!

Yes, I would definitely want to add an option to create the parameter file, which would enforce the best practices on the file location, naming, etc. and would also simplify the creation process by automatically adding the file to CMakeLists.txt or setup.py

I haven't yet decided if the tool should also allow adding the parameters to the file. Most likely when the user creates a new package, they don't yet know all the parameters they will need to eventually add for the Node, so they will anyway need to manually add the parameters straight to the file. So from this point of view, it might not be worth of adding parameters to the GUI, considering the complexity of all the possible parameter options (types, nested parameters, etc.) the GUI should also be able to handle.

But since you brought up the dynamic parameters, I think from this point of view it could make sense to provide a basic example on how to do it. So I'll look into it. I would even investigate if it would make sense to integrate the PickNik's package which @raitzjm linked.

guillaumeautran commented 3 weeks ago

Yes, a sample parameter (or a couple of them) would bootstrap adding more and provide "best practice" for (less experienced) users. There is definitely value in it.

Jannkar commented 1 week ago

The support for parameter files has been implemented in #12 . If the user now selects the "Create Parameter file" option, the following things will happen:

For now, I postponed adding an option to generate a dynamic parameter example. I would open another issue for it and make this feature to be under "advanced options".

Closing this for now. If you happen to test the parameter creation, let me know what are your thoughts on it :grin:

guillaumeautran commented 1 week ago

Thanks @Jannkar !