コード例 #1
0
 def __init__(self):
     ImageHandler.__init__(self)
     self.detectedPos = []
     self.world = tello_center.service_proxy_by_class(
         tello_world.WorldService)
     #self.panda = tello_center.service_proxy_by_class(tello_panda.PandaService)  # type: tello_panda.PandaService
     self.preload = tello_center.service_proxy_by_class(
         tello_center.PreLoadService)  # type:tello_center.PreLoadService
     self.pos_handler = None
コード例 #2
0
 def __init__(self):
     tello_center.Service.__init__(self)
     self.thread = None
     self.startup = None
     self.call_exit = False
     self.backend = tello_center.service_proxy_by_class(tello_abs.TelloBackendService)
     self.box = None
コード例 #3
0
 def __init__(self):
     tello_center.Service.__init__(self)
     self.reactive = tello_center.service_proxy_by_class(
         tello_abs.ReactiveImageAndStateService)
     self.frame = None
     fourcc = cv2.VideoWriter_fourcc(*'XVID')
     self.out = cv2.VideoWriter('output.avi', fourcc, 60.0, (960, 720))
コード例 #4
0
 def __init__(self):
     tello_center.Service.__init__(self)
     self.logger = sl4p.Sl4p(YoloService.name)
     self.backend = tello_center.service_proxy_by_class(
         tello_abs.TelloBackendService
     )  # type: tello_abs.TelloBackendService
     self.task_loop = None
コード例 #5
0
 def __init__(self):
     tello_center.Service.__init__(self)
     self.backend = tello_center.service_proxy_by_class(TelloBackendService)
     self.thread = None
     self.lock = threading.Lock()
     self.img = None
     self.state = None
     self.handlers = []
コード例 #6
0
    def __init__(self):
        tello_center.Service.__init__(self)
        self.logger = sl4p.Sl4p(MainControl.name)
        self.backend = tello_center.service_proxy_by_class(tello_abs.TelloBackendService)  # type: tello_abs.TelloBackendService
        self.yolo = tello_center.service_proxy_by_class(tello_yolo.YoloService)  # type: tello_yolo.YoloService
        self.judge = tello_center.service_proxy_by_class(tello_judge_client.JudgeClientService)  # type:tello_judge_client.JudgeClientService
        self.stage = None
        self.args = None

        self.stage_wait_for_start = Stage('wait_for_start', func_do=self.wait_for_start)
        self.stage_find_fire = Stage('find_fire', func_do=self.search_fire)
        self.found_fire = None
        self.search_min = True

        self.stage_go_to_step2_start_pos = Stage('step2', func_do=self.step2)

        self.stage_land = Stage('land', func_do=self.land)
        self.stage_idle = Stage('idle', func_do=self.idle)
コード例 #7
0
 def __init__(self):
     tello_center.Service.__init__(self)
     self.server = tello_center.service_proxy_by_class(
         JudgeServerInterface)  # type: JudgeServerInterface
     self.targets = None
     self.targets_idx = {}
     self.fail = False
     self.chest_info = {
         1: JudgeClientService.ChestInfo(1),
         2: JudgeClientService.ChestInfo(2),
         3: JudgeClientService.ChestInfo(3),
         4: JudgeClientService.ChestInfo(4),
         5: JudgeClientService.ChestInfo(5)
     }
コード例 #8
0
 def __init__(self, handlers=None):
     tello_center.Service.__init__(self)
     self.reactive = tello_center.service_proxy_by_class(
         tello_abs.ReactiveImageAndStateService)
     self.image_thread = None
     self.processing = False
     self.image = None
     self.state = None
     self.lock = threading.Lock()
     self.id = 0
     self.handler_lock = threading.Lock()
     self.handlers = []  # type: list[ImageHandler]
     self.handlers.append(DrawStateHandler())
     if handlers is not None:
         for h in handlers:
             self.handlers.append(h)
コード例 #9
0
        @param chest_idx:
        @param obj_name:
        @return: CODE_ERROR_TARGET = 0, CODE_CONTINUE = 1, CODE_TASK_DONE = 2
        """
        if self.targets is None:
            self.targets = self.server.get_targets()
            for i in range(len(self.targets)):
                self.targets_idx[self.targets[i]] = i + 1

        self.chest_info[chest_idx].obj_name = obj_name
        return self.update_chest_info()


if __name__ == '__main__':
    logger = sl4p.Sl4p('__main__')
    tello_center.register_service(tello_center.ConfigService(config={}))
    tello_center.register_service(JudgeClientService())
    tello_center.register_service(JudgeServerLocal())
    tello_center.start_all_service()

    client = tello_center.service_proxy_by_class(
        JudgeClientService)  # type: JudgeClientService

    client.server.takeoff()
    client.server.seen_fire()
    logger.info(code2name[client.put_chest_info(1, NAME_BABY)])
    logger.info(code2name[client.put_chest_info(3, NAME_CAT)])
    logger.info(code2name[client.put_chest_info(2, NAME_GAS_TANK)])
    logger.info(code2name[client.put_chest_info(4, NAME_FILES)])
    logger.info(code2name[client.put_chest_info(5, NAME_PAINTING)])