Skip to content
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 NodeOptions parameter to init function of controller_interface #382

Merged
merged 6 commits into from
May 3, 2021
Merged

Add NodeOptions parameter to init function of controller_interface #382

merged 6 commits into from
May 3, 2021

Conversation

AugusteBourgois
Copy link
Contributor

This allows for finer tuning of the NodeOptions of the controller_interface object.
For example, this allows to declare parameters from YAML files directly with the options allow_undeclared_parameters and automatically_declare_parameters_from_overrides

@bmagyar
Copy link
Member

bmagyar commented Apr 17, 2021

Are you using this already in one of your controllers? Would be good to have a link here to support the argument

@bmagyar bmagyar marked this pull request as ready for review April 17, 2021 10:11
Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AugusteBourgois can you please show us an example of this being used? Otherwise I'm happy to merge

@AugusteBourgois
Copy link
Contributor Author

My controller is hosted on a private repo of my company unfortunately. However I can certainly implement a minimal working example if you like.

@bmagyar
Copy link
Member

bmagyar commented Apr 23, 2021

Yeah an example could really help nailing this functionality, especially if you can make it as a test.

Note: the new function is currently not being called from anywhere. How'd that change in your opinion?

@AugusteBourgois
Copy link
Contributor Author

I added an example in the test folder. I believe that a controller should be able to play with its own node options, in particular when it comes to declaring parameters from overrides from example.
The ControllerInterface::init(const std::string &, rclcpp::NodeOptions) function will therefore be used in the overridden MyController::init functionif necessary to change the node options.

Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor changes

controller_interface/CMakeLists.txt Outdated Show resolved Hide resolved
controller_interface/test/test_controller_with_options.cpp Outdated Show resolved Hide resolved
controller_interface/test/test_controller_with_options.cpp Outdated Show resolved Hide resolved
@bmagyar bmagyar requested a review from destogl May 3, 2021 09:36

namespace controller_with_options
{
controller_interface::return_type ControllerWithOptions::init(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not move controllers implementations into header file so that cpp has only tests inside. @bmagyar what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good, just one small nit-pick.

@bmagyar
Copy link
Member

bmagyar commented May 3, 2021

Rebased for good measure before merge

@bmagyar bmagyar merged commit 1c5ba1a into ros-controls:master May 3, 2021
@AugusteBourgois AugusteBourgois deleted the add_nodeoptions_init_controller_interface branch May 3, 2021 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants