diff --git a/config.py b/config.py index 13d907d..bf343fa 100644 --- a/config.py +++ b/config.py @@ -10,28 +10,28 @@ MEAS_TO_MOVE = 2.0 # seconds MEAS_TO_RECEIVE = 2.5 # seconds CC_XY = [ - [149.6, -57], - [147.9, -32.5], - [147.1, -9.7], - [147.3, 12.5], - [148.9, 35], - [150.9, 58.2], - [178.9, -59.6], - [177.5, -34.9], - [177, -10.8], - [177.9, 12.7], - [178.7, 36.5], - [180.7, 60.4], - [210.1, -59.6], - [208.8, -35], - [208.2, -10.4], - [208.2, 13.7], - [208.6, 37.8], - [209.8, 62], - [239.5, -60.5], - [238.7, -35.7], - [237.7, -10.4], - [238.1, 15.1], - [239.1, 39.4], - [240, 64.4], + [146.6, -56.6], + [145.4, -33.2], + [145, -10.5], + [145, 11.7], + [146.5, 34], + [148.5, 57.2], + [176.5, -57.9], + [175.4, -34.2], + [174.5, -11.1], + [176, 12.1], + [176.6, 35.6], + [179.2, 59.4], + [206.9, -60], + [206, -35], + [206, -10.6], + [206, 13.5], + [207.7, 37.4], + [208.9, 61.8], + [237.8, -61.3], + [236.7, -36.2], + [236, -11.3], + [236, 13.7], + [237.2, 38], + [239.4, 63.2], ] diff --git a/dobot-base.svg b/dobot-base.svg new file mode 100644 index 0000000..8f76a2a --- /dev/null +++ b/dobot-base.svg @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dobot.py b/dobot.py index c7aa732..ef4b828 100644 --- a/dobot.py +++ b/dobot.py @@ -11,21 +11,13 @@ if self.device is None: raise RuntimeError("Failed to initialize Dobot.") print(f"Dobot found on {port}") + # (x, y, z, r, j1, j2, j3, j4) = self.device.pose() + # print(f"Current position: x={x}, y={y}, z={z}, r={r}") + self.device.speed(velocity=100.0, acceleration=100.0) def __del__(self): self.close() - def init(self): - if self.device is not None: - self.close() - self.device = pydobot.Dobot(port=self.port, verbose=self.verbose) - if self.device is None: - raise RuntimeError("Failed to initialize Dobot.") - # Set initial position to Z_UP - (x, y, z, r, j1, j2, j3, j4) = self.device.pose() - if z < 0: - self.device.move_to(x + 3, y, self.Z_UP, 0, wait=True) - def find_port(self): available_ports = list_ports.comports() dobot_port = [x for x in available_ports if "CH340" in x.description]