ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Is there a C++ equivalent of rosgraph.names.ns_join?

Not really. If you look at the source code for names.cppfound at: https://docs.ros.org/en/indigo/api/roscpp/html/namespaceros_1_1names.html

std::string ros::names::append  (   const std::string &     left, const std::string &   right  )         Append one name to another.

Definition at line 118 of file names.cpp.

the append()is not an equivalent to ns_join() found in module rosgraph.names https://docs.ros.org/en/kinetic/api/rosgraph/html/rosgraph.names-pysrc.html

ns_join(ns, name)
source code 
Join a namespace and name. If name is unjoinable (i.e. ~private or /global) it will be returned without joining

    Parameters: ns (str) - namespace ('/' and '~' are both legal). If ns is the empty string, name will be returned. name, str - a legal name Returns: str