Utilities.hpp
Go to the documentation of this file.
00001 /*
00002  * Utilities.hpp
00003  *
00004  *  Created on: Nov 11, 2013
00005  *      Author: blackpc
00006  */
00007 
00008 #ifndef UTILITIES_HPP_
00009 #define UTILITIES_HPP_
00010 
00011 #include <iostream>
00012 #include <vector>
00013 #include <boost/algorithm/string.hpp>
00014 #include <boost/lexical_cast.hpp>
00015 #include <ros/ros.h>
00016 
00017 using namespace std;
00018 
00019 class Utilities {
00020 public:
00021 
00022         static vector<string> getTopicNames(int robotsCount, string robotNsFormat, string topicName) {
00023                 vector<string> topics;
00024 
00025                 for (int i = 1; i < robotsCount + 1; i++) {
00026                         string newTopicName = robotNsFormat + "/" + topicName;
00027 
00028                         boost::replace_all(newTopicName, "{robotId}", boost::lexical_cast<string>(i));
00029                         topics.push_back(newTopicName);
00030                 }
00031 
00032                 return topics;
00033         }
00034 
00035 private:
00036 };
00037 
00038 
00039 
00040 
00041 
00042 #endif /* UTILITIES_HPP_ */


mr_tools
Author(s): Igor Makhtes
autogenerated on Fri Aug 28 2015 11:35:35