Пример #1
0
    def __init__(self, drone_type="Bebop2", ip_address=None):
        """
        Create a new Bebop object.  Assumes you have connected to the Bebop's wifi

        """
        self.drone_type = drone_type

        self.drone_connection = WifiConnection(self,
                                               drone_type=drone_type,
                                               ip_address=ip_address)

        # intialize the command parser
        self.command_parser = DroneCommandParser()

        # initialize the sensors and the parser
        self.sensors = BebopSensors()
        self.sensor_parser = DroneSensorParser(drone_type=drone_type)
Пример #2
0
    def __init__(self, address="", use_wifi=False):
        """
        If you need BLE: Initialize with its BLE address - if you don't know the address, call findMambo
        and that will discover it for you.
        You can also connect to the wifi on the FPV camera.  Do not use this if the camera is not connected.  Also,
        ensure you have connected your machine to the wifi on the camera before attempting this or it will not work.
        :param address: unique address for this mambo (can be ignored if you are using wifi)
        :param use_wifi: set to True to connect with wifi instead of BLE
        """
        self.address = address
        self.use_wifi = use_wifi
        if (use_wifi):
            self.drone_connection = WifiConnection(self, drone_type="Mambo")
            # initialize groundcam
            self.groundcam = MamboGroundcam()
            # groundcam delete
            list = self.groundcam.get_groundcam_pictures_names()
            print("deleting pictures")
            for file in list:
                self.groundcam._delete_file(file)
        else:
            if (BLEAvailable):
                self.drone_connection = BLEConnection(address, self)
            else:
                self.drone_connection = None
                color_print(
                    "ERROR: you are trying to use a BLE connection on a system that doesn't have BLE installed.",
                    "ERROR")
                return

        # intialize the command parser
        self.command_parser = DroneCommandParser()

        # initialize the sensors and the parser
        self.sensors = MinidroneSensors()
        self.sensor_parser = DroneSensorParser(drone_type="Minidrone")