This is a follow up from https://github.com/ros2/rclcpp/pull/495#issuecomment-485906580.
Currently how parameters and "sub-nodes" interact is not documented and is not consistent or tested. That needs to be documented, audited, and tested.
So, is this ticket basically tracking that sub nodes do not actually use the sub_namespace in the name of the parameter? For example:
auto subnode = parent->create_sub_node("controller_name");
std::string controller_type = subnode->declare_parameter<std::string>("type", "");
I would expect the parameter to be "controller_name/type", but instead "ros2 param list" shows only a parameter named "type"? Is this expected behavior? Is this a bug?
I am not sure about this either, I'd like to know.
I would expect the parameter to be "controller_name/type", but instead "ros2 param list" shows only a parameter named "type"?
currently, yes. only type is declared w/o namespace.
I think that this is bug, it should be extended with sub_namespace?
Yeah @mikeferguson I consider it a bug, or at least I think it will be surprising to most users.
The issue (why I didn't just fix it on the spot) is that the way the node class is separated into parts complicates this. The subnode feature was added to Node, but not to one of the components, meaning it's hard to use from the NodeParameters class. This is just my recollection of the issue, but maybe it's easier to fix now, I don't know off hand without trying to do it.