修改钢针到达抓料点位后再收缩和在震动点不走的问题
This commit is contained in:
@ -29,10 +29,6 @@ class Catch:
|
|||||||
self.shake_Q = False
|
self.shake_Q = False
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.catch_status == CatchStatus.CNone:
|
if self.catch_status == CatchStatus.CNone:
|
||||||
self.shake_continue.SetReset()
|
|
||||||
# self.robotClient.sendIOControl(self.robotClient.con_ios[1], 0,emptyList='1')
|
|
||||||
close(0, 1, 0)
|
|
||||||
self.is_send_take_command = False
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.catch_status == CatchStatus.CTake:
|
if self.catch_status == CatchStatus.CTake:
|
||||||
|
|||||||
@ -37,8 +37,9 @@ class Detect:
|
|||||||
return
|
return
|
||||||
target_position, noraml_base = getPosition(*xyz, *uvw, None, points)
|
target_position, noraml_base = getPosition(*xyz, *uvw, None, points)
|
||||||
|
|
||||||
|
|
||||||
position = Real_Position().init_position(*target_position[:3], *noraml_base[:3])
|
position = Real_Position().init_position(*target_position[:3], *noraml_base[:3])
|
||||||
position.Z = position.Z + 200
|
position.Z = position.Z
|
||||||
self.detect_position = position
|
self.detect_position = position
|
||||||
self.detect_status = DetectStatus.DOk
|
self.detect_status = DetectStatus.DOk
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ from Model.Position import Real_Position, Detection_Position
|
|||||||
from enum import Enum, IntEnum
|
from enum import Enum, IntEnum
|
||||||
from COM.COM_Robot import RobotClient, DetectType
|
from COM.COM_Robot import RobotClient, DetectType
|
||||||
from Model.RobotModel import CMDInstructRequest, MoveType
|
from Model.RobotModel import CMDInstructRequest, MoveType
|
||||||
from Trace.handeye_calibration import getxyz
|
from Trace.handeye_calibration import getPosition
|
||||||
from Util.util_math import get_distance
|
from Util.util_math import get_distance
|
||||||
from Util.util_time import CRisOrFall
|
from Util.util_time import CRisOrFall
|
||||||
from Vision.camera_coordinate_dete import Detection
|
from Vision.camera_coordinate_dete import Detection
|
||||||
@ -133,16 +133,15 @@ class FeedLine:
|
|||||||
for i in range(len(self.feeding_to_end)):
|
for i in range(len(self.feeding_to_end)):
|
||||||
if self.feeding_to_end[i].status == FeedStatus.FTake.value:
|
if self.feeding_to_end[i].status == FeedStatus.FTake.value:
|
||||||
if position != None:
|
if position != None:
|
||||||
xyz = getxyz(position.X, position.Y, position.Z, position.a, position.b, position.c)
|
befor_take_position = Real_Position().init_position(position.X,
|
||||||
befor_take_position = Real_Position().init_position(xyz[0],
|
position.Y,
|
||||||
xyz[1],
|
position.Z+dynamic_height,
|
||||||
xyz[2],
|
|
||||||
position.U,
|
position.U,
|
||||||
position.V,
|
position.V,
|
||||||
position.W)
|
position.W)
|
||||||
after_take_position = Real_Position().init_position(xyz[0],
|
after_take_position = Real_Position().init_position(position.X,
|
||||||
xyz[1],
|
position.Y,
|
||||||
xyz[2],
|
position.Z+dynamic_height,
|
||||||
position.U,
|
position.U,
|
||||||
position.V,
|
position.V,
|
||||||
position.W)
|
position.W)
|
||||||
|
|||||||
@ -59,12 +59,12 @@ status = 6
|
|||||||
linetype = 0
|
linetype = 0
|
||||||
|
|
||||||
[Position9]
|
[Position9]
|
||||||
x = 1430.492554
|
x = 1427.58313
|
||||||
y = 1765.717407
|
y = 1724.46875
|
||||||
z = 1832.536255
|
z = 1831.32312
|
||||||
u = 1.57702
|
u = 1.923308
|
||||||
v = 4.174215
|
v = 3.454441
|
||||||
w = -87.506783
|
w = -87.299934
|
||||||
id = 9
|
id = 9
|
||||||
order = 9
|
order = 9
|
||||||
lineid = 1
|
lineid = 1
|
||||||
@ -72,12 +72,12 @@ status = 7
|
|||||||
linetype = 0
|
linetype = 0
|
||||||
|
|
||||||
[Position10]
|
[Position10]
|
||||||
x = 1375.01416
|
x = 1339.699585
|
||||||
y = 1702.021973
|
y = 1702.385742
|
||||||
z = 2117.369385
|
z = 2197.976318
|
||||||
u = 8.211453
|
u = 9.554496
|
||||||
v = 4.232689
|
v = 7.15853
|
||||||
w = -100.153625
|
w = -99.243294
|
||||||
id = 10
|
id = 10
|
||||||
order = 10
|
order = 10
|
||||||
lineid = 1
|
lineid = 1
|
||||||
@ -202,12 +202,12 @@ status = 8
|
|||||||
linetype = 0
|
linetype = 0
|
||||||
|
|
||||||
[Position11]
|
[Position11]
|
||||||
x = 1244.785156
|
x = 1331.740112
|
||||||
y = 1848.819702
|
y = 1787.211548
|
||||||
z = 2307.201416
|
z = 2307.181641
|
||||||
u = -34.622036
|
u = -34.621368
|
||||||
v = 19.413801
|
v = 19.412609
|
||||||
w = -129.918442
|
w = -132.657135
|
||||||
id = 11
|
id = 11
|
||||||
order = 12
|
order = 12
|
||||||
lineid = 1
|
lineid = 1
|
||||||
|
|||||||
@ -10,6 +10,10 @@ class Position:
|
|||||||
self.U = 0.0
|
self.U = 0.0
|
||||||
self.V = 0.0
|
self.V = 0.0
|
||||||
self.W = 0.0
|
self.W = 0.0
|
||||||
|
self.a = 0.0
|
||||||
|
self.b = 0.0
|
||||||
|
self.c = 0.0
|
||||||
|
|
||||||
|
|
||||||
def compare(self,position,is_action=False):
|
def compare(self,position,is_action=False):
|
||||||
distance = math.sqrt((self.X-position.X)**2+
|
distance = math.sqrt((self.X-position.X)**2+
|
||||||
|
|||||||
@ -59,9 +59,9 @@ smooth = 9
|
|||||||
dynamic_height = 350.0
|
dynamic_height = 350.0
|
||||||
|
|
||||||
[Speed]
|
[Speed]
|
||||||
debug_speed = 50
|
debug_speed = 80
|
||||||
feed_speed = 550
|
feed_speed = 100
|
||||||
reset_speed = 35
|
reset_speed = 80
|
||||||
|
|
||||||
[Origin]
|
[Origin]
|
||||||
x = 204.996765
|
x = 204.996765
|
||||||
|
|||||||
@ -76,7 +76,7 @@ def getPosition(x,y,z,a,b,c,rotation,points):
|
|||||||
# 单位化方向向量
|
# 单位化方向向量
|
||||||
short_edge_direction = edge_vector / np.linalg.norm(edge_vector)
|
short_edge_direction = edge_vector / np.linalg.norm(edge_vector)
|
||||||
|
|
||||||
delta = 0#沿法向量方向抬高和压低,-指表示抬高,+值表示压低
|
delta = -200#沿法向量方向抬高和压低,-指表示抬高,+值表示压低
|
||||||
angle = np.asarray([a,b,c])
|
angle = np.asarray([a,b,c])
|
||||||
noraml = camera2robot[:3, :3]@angle
|
noraml = camera2robot[:3, :3]@angle
|
||||||
normal_vector = noraml / np.linalg.norm(noraml)
|
normal_vector = noraml / np.linalg.norm(noraml)
|
||||||
@ -90,7 +90,7 @@ def getxyz(x,y,z,a,b,c):
|
|||||||
target = np.asarray([x, y, z, 1])
|
target = np.asarray([x, y, z, 1])
|
||||||
camera2robot = np.loadtxt('./Trace/com_pose2.txt', delimiter=' ')
|
camera2robot = np.loadtxt('./Trace/com_pose2.txt', delimiter=' ')
|
||||||
target_position_raw = np.dot(camera2robot, target)
|
target_position_raw = np.dot(camera2robot, target)
|
||||||
delta = -200 # 沿法向量方向抬高和压低,-指表示抬高,+值表示压低
|
delta = -500 # 沿法向量方向抬高和压低,-指表示抬高,+值表示压低
|
||||||
angle = np.asarray([a, b, c])
|
angle = np.asarray([a, b, c])
|
||||||
noraml = camera2robot[:3, :3] @ angle
|
noraml = camera2robot[:3, :3] @ angle
|
||||||
normal_vector = noraml / np.linalg.norm(noraml)
|
normal_vector = noraml / np.linalg.norm(noraml)
|
||||||
|
|||||||
2236
log/log.log
2236
log/log.log
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user