Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Conversation

@AAlon
Copy link
Contributor

@AAlon AAlon commented Jan 17, 2019

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.

* @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,
Copy link
Contributor

@ross-desmond ross-desmond Jan 17, 2019

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_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments here

Copy link
Contributor

@ross-desmond ross-desmond left a 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_;
Copy link
Contributor

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.

@AAlon
Copy link
Contributor Author

AAlon commented Jan 22, 2019

Addressed feedback.

@AAlon AAlon merged commit 919d175 into aws-robotics:master Jan 22, 2019
AAlon added a commit that referenced this pull request Jan 22, 2019
mm318 added a commit that referenced this pull request Jan 28, 2019
mm318 added a commit that referenced this pull request Jan 29, 2019
mm318 added a commit that referenced this pull request Jan 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants