-
Notifications
You must be signed in to change notification settings - Fork 20
Parameter Namespacing: Refactoring using the ParameterPath object. #10
Conversation
| * @return string representing the full, resolved path of the parameter. | ||
| * @note If node_namespaces and parameter_path_keys are empty, an empty string would be returned. | ||
| */ | ||
| std::string get_resolved_path(char node_namespace_separator, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended to be able to convert ROS2->ROS1 paths as well? If not we should specify that in the constructor and deprecate it. This get_resolved_path almost is able to do both, and could be abused that way.
Here is an example of a confusing result of this API e.g.
std::string ros2_key_success = "key_ns.key"
auto ParameterPath key_1(ros2_key_success);
auto key_1_resolved = key_1.get_resolved_path('/','/',true); // = "key_ns/key"
std::string ros2_key_fail = "/node_name." + ros2_key_success
auto ParameterPath key_2(ros2_key_fail);
auto key_2_resolved = key_2.get_resolved_path('/','/',true); // = "/node_name.key_ns.key"It would be awesome if we could only support ROS1->ROS2 and not have a public API to "get_resolved_path". We can do this by putting get_resolved_path within the rosparamreader itself, that way each param reader (1 or 2) can choose how to format the parameter path, without exposing the confusing possibility above.
Does that make sense?
| } | ||
| } | ||
| private: | ||
| const std::vector<std::string> parameter_path_keys_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, just wondering about the placement of a function
| */ | ||
| const std::vector<std::string> parameter_path_keys_; | ||
| const std::vector<std::string> node_namespaces_; | ||
| mutable std::string name_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be mutable anymore.
…ientConfigurationProvider accordingly.
…ents remain unchanged if the query was unsuccessful.
…der API accepting ParameterPath.
|
Addressed feedback. |
Related change: aws-robotics/utils-ros1#3
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.