def __init__(self, num_grippers=1, comport='/dev/ttyUSB0', baud=115200): assert num_grippers in [1, 2] try: self.ser = serial.Serial(comport, baud, timeout=0.2) except: self.init_success = False return self._gripper = [GripperIO(i) for i in range(num_grippers)] self._num_grippers = num_grippers self.init_success = True self._shutdown_driver = False
def __init__(self, num_grippers=1, comport='/dev/ttyUSB1', baud=115200): try: self.ser = serial.Serial(comport, baud, timeout=0.2) except: self.init_success = False return self._gripper = [] self._num_grippers = num_grippers for i in range(self._num_grippers): self._gripper.append(GripperIO(i)) self.init_success = True self._shutdown_driver = False
def __init__(self, num_grippers=1, movo_ip='10.66.171.5', rcv_timeout=0.1): self._shutdown_driver = False self._rcv_timeout = rcv_timeout """ Create the thread to run MOVO Linear actuator command interface """ self.tx_queue_ = multiprocessing.Queue() self.rx_queue_ = multiprocessing.Queue() self.comm = IoEthThread((movo_ip, 6238), self.tx_queue_, self.rx_queue_, max_packet_size=R85_PACKET_SIZE_BYTES) self._gripper = [] self._num_grippers = num_grippers for i in range(self._num_grippers): self._gripper.append(GripperIO(i)) self.init_success = True