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

Support custom rclcpp::NodeOptions #417

Open
wants to merge 2 commits into
base: ros2
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Aggregator(rclcpp::NodeOptions options);


DIAGNOSTIC_AGGREGATOR_PUBLIC
virtual ~Aggregator();

Expand Down
5 changes: 4 additions & 1 deletion diagnostic_aggregator/src/aggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<rclcpp::Node>(
"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),
Expand Down