7 Because some functions in roslib.names cannot be referred in the original
8 rxlaunch code, the codes of those function are copied here. This class
9 should not be used for any other purpose than to be used within this .py
21 Test if name is a global graph resource name. 116 117
22 @param name: must be a legal name in canonical form 118
24 @return: True if name is a globally referenced name (i.e. /ns/name) 120
27 return name
and name[0] == NamesSurrogate.SEP
31 ''' 126 Test if name is a private graph resource name. 127 128
32 @param name: must be a legal name in canonical form 129
33 @type name: str 130 @return bool: True if name is a privately
34 referenced name (i.e. ~name) 131 '''
35 return name
and name[0] == NamesSurrogate.PRIV_NAME
41 http://ros.org/rosdoclite/groovy/api/roslib/html/python/roslib.names-pysrc.html#ns_join
42 since roslib.names is not found for some reason, and also the entire
43 module seems deprecated.
45 Join a namespace and name. If name is unjoinable (i.e. ~private or
46 162 /global) it will be returned without joining 163 164
47 @param ns: namespace ('/' and '~' are both legal). If ns is the empty
48 string, name will be returned. 165
50 @param name str: a legal name 167
51 @return str: name concatenated to ns, or name if it's 168 unjoinable. 169
54 if NamesSurrogate.is_private(name)
or NamesSurrogate.is_global(name):
56 if ns == NamesSurrogate.PRIV_NAME:
57 return NamesSurrogate.PRIV_NAME + name
60 if ns[-1] == NamesSurrogate.SEP:
62 return ns + NamesSurrogate.SEP + name