32 bool getTopicBase(
const std::string& topic, std::string& topicBase) {
33 std::string tmp = topic;
34 int i = tmp.rfind(
'/');
36 while( (tmp.size() > 0) && (i >= (
int)(tmp.size()-1))) {
37 tmp = tmp.substr(0,tmp.size()-1);
47 topicBase = tmp.substr(i+1, tmp.size()-i-1);
60 std::cout << variant <<
"\n---\n";
63 int main(
int argc,
char **argv) {
65 printf(
"\nusage: echo TOPIC\n\n");
70 ROS_ERROR(
"Failed to extract topic base from [%s]", argv[1]);
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
Header file providing the Subscriber class interface.
void callback(const variant_topic_tools::MessageVariant &variant, const ros::Time &receiptTime)
variant_topic_tools::Subscriber subscriber
size_t subscriberQueueSize
ros::NodeHandlePtr nodeHandle
bool getTopicBase(const std::string &topic, std::string &topicBase)
std::string subscriberTopic
int main(int argc, char **argv)