diff --git a/diagnostic_aggregator/include/diagnostic_aggregator/aggregator.hpp b/diagnostic_aggregator/include/diagnostic_aggregator/aggregator.hpp index 5f48dd6b..1d2c7e63 100644 --- a/diagnostic_aggregator/include/diagnostic_aggregator/aggregator.hpp +++ b/diagnostic_aggregator/include/diagnostic_aggregator/aggregator.hpp @@ -111,6 +111,13 @@ class Aggregator DIAGNOSTIC_AGGREGATOR_PUBLIC Aggregator(); + /*! + *\brief Constructor initializes with main prefix (ex: '/Robot') and custom node options + */ + DIAGNOSTIC_AGGREGATOR_PUBLIC + explicit Aggregator(rclcpp::NodeOptions options); + + DIAGNOSTIC_AGGREGATOR_PUBLIC virtual ~Aggregator(); diff --git a/diagnostic_aggregator/src/aggregator.cpp b/diagnostic_aggregator/src/aggregator.cpp index 4619ec29..6b60eee3 100644 --- a/diagnostic_aggregator/src/aggregator.cpp +++ b/diagnostic_aggregator/src/aggregator.cpp @@ -57,9 +57,12 @@ using diagnostic_msgs::msg::DiagnosticStatus; * @todo(anordman): make aggregator a lifecycle node. */ Aggregator::Aggregator() +: Aggregator(rclcpp::NodeOptions()) {} + +Aggregator::Aggregator(rclcpp::NodeOptions options) : n_(std::make_shared( "analyzers", "", - rclcpp::NodeOptions().allow_undeclared_parameters(true). + options.allow_undeclared_parameters(true). automatically_declare_parameters_from_overrides(true))), logger_(rclcpp::get_logger("Aggregator")), pub_rate_(1.0),