From b2794d021fe143a4814ae30d47933247386f006f Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Wed, 25 Sep 2024 19:18:34 +0200 Subject: [PATCH] [ControllerInterface] Fix to properly propagate the controller NodeOptions (#1762) --- .../controller_interface/controller_interface_base.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/controller_interface/include/controller_interface/controller_interface_base.hpp b/controller_interface/include/controller_interface/controller_interface_base.hpp index c4a19fd8e3..74077969d3 100644 --- a/controller_interface/include/controller_interface/controller_interface_base.hpp +++ b/controller_interface/include/controller_interface/controller_interface_base.hpp @@ -185,14 +185,15 @@ class ControllerInterfaceBase : public rclcpp_lifecycle::node_interfaces::Lifecy CONTROLLER_INTERFACE_PUBLIC virtual rclcpp::NodeOptions define_custom_node_options() const { + rclcpp::NodeOptions node_options; // \note The versions conditioning is added here to support the source-compatibility with Humble #if RCLCPP_VERSION_MAJOR >= 21 - return rclcpp::NodeOptions().enable_logger_service(true); + node_options.enable_logger_service(true); #else - return rclcpp::NodeOptions() - .allow_undeclared_parameters(true) - .automatically_declare_parameters_from_overrides(true); + node_options.allow_undeclared_parameters(true); + node_options.automatically_declare_parameters_from_overrides(true); #endif + return node_options; } /// Declare and initialize a parameter with a type.