예제 #1
0
def new_topic(topic, datatype):
    """
    Callback fired from TopicMontior mainloop.
    """
    print("Topic %s has been identified with datatype %s" % (topic, datatype))
    # We dont log rosout because they are Log objects not Data objects
    if topic.find("/rosout") == -1:
        RosThread.subscribe(topic, datatype, print_data)
예제 #2
0
 def _signal_handler(self, *args, **kwargs):
     """
     Shuts down the Logger
     """
     print("Shutting Down")
     self.running = False
     RosThread._signal_handler(*args, **kwargs)
     TopicMonitor._signal_handler(*args, **kwargs)
     print("Bye")
예제 #3
0
 def new_topic(self, topic, datatype):
     """
     A RosThread callback with notification of a new topic.
     """
     excluded = False
     for i in EXCLUDED_TOPICS:
         if topic.find(i) != -1:
             excluded = True
     if not excluded:
         RosThread.subscribe(topic, datatype, self.ros_message_callback)
예제 #4
0
def new_topic(topic, datatype):
    """
    Occurs when a new topic is detected.
    @param topic: The name of the topic
    @param datatype: The datatype of the topic
    """
    if topic == "/rosout" or topic == "/rosout_agg":
        pass
    else:
        topic_split = topic.split("/")            
        if len(topic_split) < 3:
            print('Topic %s does not meet standard!!')
            return
        if topic_split[2] == 'hardware':
            RosThread.subscribe(topic, datatype, parse_hardware_data)
        elif topic_split[1] == 'logic':
            #rosthread.subscribe(topic, datatype, parse_logic_data)
            pass
        elif topic_split[1] == 'command':
            #rosthread.subscribe(topic, datatype, parse_command_data)
            pass
예제 #5
0
def _signal_handler(*args, **kwargs):
    RosThread._signal_handler(*args, **kwargs)
    TopicMonitor._signal_handler(*args, **kwargs)    
    sys.exit(0)