The most common API routines for getting information about your node and working with names are described below.
Accessing Node Information
See also: ros::this_node namespace API docs
ros::this_node::getName()
- Get the fully-qualified name of this node.
ros::this_node::getNamespace()
- Get the fully-qualified namespace of this node.
Manipulating Names
See also: ros::names namespace API docs, ros::NodeHandle::resolveName() API docs
std::string ros::NodeHandle::resolveName(const std::string& name, bool remap = true);
Resolve a name using the NodeHandle's namespace.
std::string ros::names::resolve(const std::string& name, bool remap = true);
- Resolve a name using the node's namespace.
std::string ros::names::append(const std::string& left, const std::string& right);
Append right to left.
std::string ros::names::clean(const std::string& name);
Remove duplicate / characters.
bool ros::names::validate(const std::string& name, std::string& error);
- Validate a name, returning an error string if invalid.