Add rcl_node_get_fully_qualified_name (ros2/rcl#255) (#712)

Signed-off-by: RARvolt <rarvolt@gmail.com>
This commit is contained in:
Tully Foote 2019-04-30 18:13:16 -07:00 committed by GitHub
parent 078d5ff662
commit e9101b49cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,18 +121,7 @@ NodeParameters::NodeParameters(
get_yaml_paths(&(options->arguments)); get_yaml_paths(&(options->arguments));
// Get fully qualified node name post-remapping to use to find node's params in yaml files // Get fully qualified node name post-remapping to use to find node's params in yaml files
const std::string node_name = node_base->get_name(); combined_name_ = node_base->get_fully_qualified_name();
const std::string node_namespace = node_base->get_namespace();
if (0u == node_namespace.size() || 0u == node_name.size()) {
// Should never happen
throw std::runtime_error("Node name and namespace were not set");
}
if ('/' == node_namespace.at(node_namespace.size() - 1)) {
combined_name_ = node_namespace + node_name;
} else {
combined_name_ = node_namespace + '/' + node_name;
}
// TODO(sloretz) use rcl to parse yaml when circular dependency is solved // TODO(sloretz) use rcl to parse yaml when circular dependency is solved
// See https://github.com/ros2/rcl/issues/252 // See https://github.com/ros2/rcl/issues/252