def idle_task(self):
        '''handle missing waypoints'''
        if self.wp_period.trigger():
            # cope with packet loss fetching mission
            if self.master is not None and self.master.time_since('MISSION_ITEM') >= 2 and self.wploader.count() < getattr(self.wploader,'expected_count',0):
                seq = self.wploader.count()
                print("re-requesting WP %u" % seq)
                self.master.waypoint_request_send(seq)
        if self.module('console') is not None and not self.menu_added_console:
            self.menu_added_console = True
            self.module('console').add_menu(self.menu)
        if self.module('map') is not None and not self.menu_added_map:
            self.menu_added_map = True
            self.module('map').add_menu(self.menu)
def idle_task ( self ) : if self . wp_period . trigger ( ) : if self . master is not None and self . master . time_since ( 'MISSION_ITEM' ) >= 2 and self . wploader . count ( ) < getattr ( self . wploader , 'expected_count' , 0 ) : seq = self . wploader . count ( ) print ( "re-requesting WP %u" % seq ) self . master . waypoint_request_send ( seq ) if self . module ( 'console' ) is not None and not self . menu_added_console : self . menu_added_console = True self . module ( 'console' ) . add_menu ( self . menu ) if self . module ( 'map' ) is not None and not self . menu_added_map : self . menu_added_map = True self . module ( 'map' ) . add_menu ( self . menu )
handle missing waypoints