-
Notifications
You must be signed in to change notification settings - Fork 522
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
Required Info:
- Operating System:
- Ubunto Bionic
- Installation type:
- dashing sources
- Version or commit hash:
- master
Steps to reproduce issue
Setting to accept undeclared parameters and passing initial parameters:
std::vector<rclcpp::Parameter> initial_parameters =
{rclcpp::Parameter("my_string", std::string("str"))};
rclcpp::NodeOptions node_options;
node_options.allow_undeclared_parameters(true);
node_options.initial_parameters(initial_parameters);
auto node = std::make_shared<Node>("name", "ns", node_options);
node->get_parameter(param); // throwsThrows this:
12: terminate called after throwing an instance of 'rclcpp::ParameterTypeException'
12: what(): expected [string] got [not set]
On the other hand, setting the parameters after construction is happy:
rclcpp::NodeOptions node_options;
node_options.allow_undeclared_parameters(true);
auto node = std::make_shared<Node>("name", "ns", node_options);
node->set_parameters(initial_parameters);
node->get_parameter(param); // happyExpected behavior
No throw on both cases
Actual behavior
Throw on first case
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working