47 lines
1.1 KiB
Python
47 lines
1.1 KiB
Python
from Constant import position_accuracy
|
|
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 compare(self,position):
|
|
if self.X-position.X<position_accuracy and \
|
|
self.Y-position.Y<position_accuracy and \
|
|
self.Z - position.Z < position_accuracy and \
|
|
self.U - position.U < position_accuracy and \
|
|
self.V - position.V < position_accuracy and \
|
|
self.W - position.W < position_accuracy:
|
|
return True
|
|
else:
|
|
return False
|
|
pass
|
|
"""
|
|
摄像头识别位置和角度
|
|
"""
|
|
class Detection_Position(Position):
|
|
def __init__(self):
|
|
super().__init__()
|
|
|
|
def init_position(self,X,Y,Z,U,V,W):
|
|
self.X = X
|
|
self.Y = Y
|
|
self.Z = Z
|
|
self.U = U
|
|
self.V = V
|
|
self.W = W
|
|
|
|
|
|
class Real_Position(Position):
|
|
def __init__(self):
|
|
super().__init__()
|
|
|
|
def init_position(self, X, Y, Z, U, V, W):
|
|
self.X = X
|
|
self.Y = Y
|
|
self.Z = Z
|
|
self.U = U
|
|
self.V = V
|
|
self.W = W |