00001 #include "names.h"
00002
00003 namespace openni_camera {
00004
00005
00006
00007
00008
00009
00010
00011
00012 std::string resolve(const ros::NodeHandle& nh, const std::string& name)
00013 {
00014
00015
00016 std::string resolved = nh.resolveName(name);
00017
00018
00019
00020 size_t slash = std::string::npos;
00021 while (true)
00022 {
00023 slash = resolved.find_last_of('/', slash);
00024 if (slash == 0)
00025 break;
00026
00027 std::string left = resolved.substr(0, slash);
00028 std::string right = resolved.substr(slash + 1);
00029 std::string remapped = ros::names::append(nh.resolveName(left), right);
00030 if (remapped != resolved)
00031 return remapped;
00032
00033 slash--;
00034 }
00035
00036 return resolved;
00037 }
00038
00039 }