update 完成所有投料逻辑,IO点位控制,急停控制
This commit is contained in:
24
test7.py
Normal file
24
test7.py
Normal file
@ -0,0 +1,24 @@
|
||||
class Position:
|
||||
def __init__(self):
|
||||
self.X = 0.0
|
||||
self.Y = 0.0
|
||||
self.Z = 0.0
|
||||
self.U = 0.0
|
||||
self.V = 0.0
|
||||
self.W = 0.0
|
||||
|
||||
def init_data(self, X, Y, Z, U, V, W):
|
||||
self.X = X
|
||||
self.Y = Y
|
||||
self.Z = Z
|
||||
return self
|
||||
|
||||
detect_pos_list = []
|
||||
detect_pos_list.append(Position().init_data(0.0, 0.0, 3, 0.0, 0.0, 0.0))
|
||||
detect_pos_list.append(Position().init_data(0.0, 0.0, 1, 0.0, 0.0, 0.0))
|
||||
detect_pos_list.append(Position().init_data(0.0, 0.0, 8, 0.0, 0.0, 0.0))
|
||||
z_diff, max_z_index = (lambda pts: (
|
||||
max(pts, key=lambda p: p.Z).Z - min(pts, key=lambda p: p.Z).Z,
|
||||
pts.index(max(pts, key=lambda p: p.Z))
|
||||
))(detect_pos_list)
|
||||
print(z_diff, max_z_index)
|
||||
Reference in New Issue
Block a user