rcmutils.py
Go to the documentation of this file.
00001 import re
00002 from include.ros.rosConfigurator import getWhiteLists
00003 
00004 
00005 def toMsgType(msg):
00006     return msg.replace("msgs/", "msgs.msg.").replace("/", ".msg.")
00007 
00008 
00009 def getRobotConfig(robot_name="", topics=[]):
00010     white_lists = getWhiteLists()
00011     _topics = {
00012     }
00013     for topic in topics:
00014         _topic = "/" + robot_name + "/" + topic['name']
00015         pubsub = topic['type']
00016         if (white_lists[pubsub] is not None and re.search(white_lists[pubsub], _topic) is not None) or (white_lists[pubsub] is None):
00017             _topics[topic['name']] = {
00018                 "msg": toMsgType(topic["msg"]),
00019                 "type": pubsub
00020             }
00021     return {
00022         robot_name: {
00023             "topics": _topics
00024         }
00025     }


firos
Author(s): IƱigo Gonzalez, igonzalez@ikergune.com
autogenerated on Thu Jun 6 2019 17:51:04