00001 #include "image_transport/camera_common.h"
00002 #include <boost/algorithm/string/classification.hpp>
00003 #include <boost/algorithm/string/split.hpp>
00004 #include <boost/algorithm/string/join.hpp>
00005 #include <vector>
00006
00007 namespace image_transport {
00008
00009 std::string getCameraInfoTopic(const std::string& base_topic)
00010 {
00011
00012 std::vector<std::string> names;
00013 boost::algorithm::split(names, base_topic, boost::algorithm::is_any_of("/"),
00014 boost::algorithm::token_compress_on);
00015
00016 while (names.back().empty())
00017 names.pop_back();
00018
00019 names.back() = "camera_info";
00020
00021 return boost::algorithm::join(names, "/");
00022 }
00023
00024 }