MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / findTopicInMap

Function findTopicInMap

okvis_ros/src/dataset_convertor.cpp:320–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318}
319
320bool findTopicInMap(map<string, map<string, string>>& topic2info, // NOLINT
321 string topic_name,
322 map<string, map<string, string>>::iterator& element) { // NOLINT
323 element = topic2info.end();
324
325 bool res = false;
326 if (topic2info.find(topic_name) != topic2info.end()) {
327 element = topic2info.find(topic_name);
328 res = true;
329 } else {
330 size_t first_slash = topic_name.find_first_of("/");
331 if (first_slash == 0) {
332 if (topic2info.find(topic_name.substr(1)) != topic2info.end()) {
333 element = topic2info.find(topic_name.substr(1));
334 res = true;
335 }
336 } else {
337 if (topic2info.find("/" + topic_name) != topic2info.end()) {
338 element = topic2info.find("/" + topic_name);
339 res = true;
340 }
341 }
342 }
343 return res;
344}
345
346int main(int argc, char** argv) {
347 cout << colouredString("Initializing ROS node:", RED, BOLD) << endl;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected