Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion controller_interface/src/controller_interface_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ return_type ControllerInterfaceBase::init(
// no rclcpp::ParameterValue unsigned int specialization
auto_declare<int>("update_rate", static_cast<int>(params.controller_manager_update_rate));
auto_declare<bool>("is_async", false);
auto_declare<int>("thread_priority", -100);

realtime_tools::AsyncFunctionHandlerParams::declare(
impl_->node_, "async_parameters.", impl_->ctrl_itf_params_.update_rate);
Comment on lines +103 to +104

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not use async_params_.declare?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I figured the parameters are a property of the node that declares them, and this should only be a utility function. Also for loading parameters from yaml.

So it goes something like this:

  1. in init, node is just being created, so we declare the parameters. There is no async_params_ member yet.
  2. after init, parameters are loaded from yaml file
  3. then in configure(), the parameters are read and stored in async_params_.

that is why declare() is a static function, and not tied to the async_params_ instance. The instance does not even exist in init, so we might miss param setting from yaml.

}
catch (const std::exception & e)
{
Expand Down
Loading