Пример #1
0
    def __init__(self, gpioController, config):
        self._gpioController  = gpioController
        self._config = config
        self._elevator = Elevator.Elevator(self._config, self._gpioController)
        self._gripper = Gripper.Gripper(self._gpioController, self._config)
        self._servoRotate = Servo.ServoDS3218_270(self._gpioController, self._config.servo_rotate.gpio)
        self._recordPlayer = RecordPlayer.RecordPlayer(self._gpioController, self._config.record_player.gpio_start, self._config.record_player.gpio_stop, self._config.record_player.gpio_light_barrier)

        self._lock = RLock()
        self._ready = False

        self.ROTATE_0 = self._config.servo_rotate.rotate_0
        self.ROTATE_180 = self._config.servo_rotate.rotate_180

        self.HOME_TO_BASE = self._config.elevator.home_to_base
        self.FLIPPED_DELTA = self._config.elevator.flipped_delta
Пример #2
0
    with GlobalGPIO.GlobalGPIO() as gpio:
        gripper = Gripper.Gripper(gpio, config)
        gripper.release()
        # sleep(2)
        #   gripper.grip()
        #   sleep(2)
        #    gripper.release()

        elevator = Elevator.Elevator(config, gpio)

        elevator.gotoHome()

        HOME_TO_BASE = 100000
        FLIPPED_DELTA = 18000

        servo_rotate = Servo.ServoDS3218_270(gpio, 17)

        #  gripper.grip()

        ROTATE_0 = 185.5
        ROTATE_180 = 6

        # slowly

        #  servo_rotate.setAngle(ROTATE_180)
        #  sleep(3)
        servo_rotate.setAngle(ROTATE_180)
        #  sleep(3)

        #  sleep(3)
        #   servo_rotate.setAngle(ROTATE_180)