ROS2 - Galactic: undeclare_parameter raises an exception
In ROS2-Galactic, the following lines:
rcl_interfaces::msg::ParameterDescriptor desc;
declare_parameter("aa", 5, desc);
undeclare_parameter("aa");
raise the following exception:
parameter 'aa' has invalid type: cannot undeclare an statically typed parameter
The following code fixes that:
rcl_interfaces::msg::ParameterDescriptor desc;
desc.dynamic_typing=true;
declare_parameter("aa", 5, desc);
undeclare_parameter("aa");
Is this a result of PR#1522:Enforce static parameter types?
I was under the impression that the idea behind the PR was to prevent an unintentional change of the parameter's type, not to prevent its destruction. Is the way I came up with in my example the proper way to declare parameters which I intend to undeclare later on in the program?