This commit is contained in:
wangWking 2022-07-14 15:05:56 +08:00
parent b1f15e9ac5
commit 766db3a2d8
4 changed files with 5 additions and 4 deletions

1
mycobot_280/mycobot_280/scripts/listen_real.py Normal file → Executable file
View file

@ -1,4 +1,5 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
# encoding:utf-8
# license removed for brevity # license removed for brevity
import time import time
import math import math

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View file

@ -19,7 +19,7 @@ __version__ = "1.0"
class Object_detect(Movement): class Object_detect(Movement):
def __init__(self, camera_x = 170, camera_y = -10): def __init__(self, camera_x = 160, camera_y = -10):
# inherit the parent class # inherit the parent class
super(Object_detect, self).__init__() super(Object_detect, self).__init__()
# get path of file # get path of file
@ -76,9 +76,9 @@ class Object_detect(Movement):
self.HSV = { self.HSV = {
"yellow": [np.array([11, 115, 70]), np.array([40, 255, 245])], "yellow": [np.array([11, 115, 70]), np.array([40, 255, 245])],
"red": [np.array([0, 43, 46]), np.array([8, 255, 255])], "red": [np.array([0, 43, 46]), np.array([8, 255, 255])],
"green": [np.array([35, 43, 46]), np.array([77, 255, 255])], "green": [np.array([35, 43, 46]), np.array([77, 255, 255])], # [77, 255, 255]
"blue": [np.array([100, 43, 46]), np.array([124, 255, 255])], "blue": [np.array([100, 43, 46]), np.array([124, 255, 255])],
"cyan": [np.array([78, 43, 46]), np.array([99, 255, 255])], "cyan": [np.array([78, 43, 46]), np.array([99, 255, 255])], # np.array([78, 43, 46]), np.array([99, 255, 255])
} }
# use to calculate coord between cube and mycobot # use to calculate coord between cube and mycobot
self.sum_x1 = self.sum_x2 = self.sum_y2 = self.sum_y1 = 0 self.sum_x1 = self.sum_x2 = self.sum_y2 = self.sum_y1 = 0

View file

@ -30,7 +30,7 @@ __version__ = "1.0" # Adaptive seeed
class Object_detect(Movement): class Object_detect(Movement):
def __init__(self, camera_x = 165, camera_y = -5): def __init__(self, camera_x = 160, camera_y = -5):
# inherit the parent class # inherit the parent class
super(Object_detect, self).__init__() super(Object_detect, self).__init__()
# get path of file # get path of file