def get_topic_type(topic): """ Returns the type of the specified ROS topic """ # If the topic is published, return its type topic_type, _, _ = rosservice_get_topic_type(topic) if topic_type is None: # Topic isn't published so return an empty string return "" return topic_type
def get_topic_type(topic): """ Returns the type of the specified ROS topic """ # If the topic is published, return its type topic_type, _, _ = rosservice_get_topic_type(topic) if topic_type is None: # Topic isn't published so return an empty string return "" return topic_type
def get_topic_type(topic, topics_glob): """ Returns the type of the specified ROS topic """ # Check if the topic is hidden or public. if any(fnmatch.fnmatch(str(topic), glob) for glob in topics_glob): # If the topic is published, return its type topic_type, _, _ = rosservice_get_topic_type(topic) if topic_type is None: # Topic isn't published so return an empty string return "" return topic_type else: # Topic is hidden so return an empty string return ""