|
|
@@ -1106,6 +1106,20 @@ namespace TeamAAS_VP.Services
|
|
|
{
|
|
|
return (false, null, null, null);
|
|
|
}
|
|
|
+ //计算相机与机器人坐标系的旋转矩阵
|
|
|
+ var robotCameraRotationMatrix = await AutoIdentifyRobotCameraRotationMatrix(calibrationInfo, robot, cancellationToken);
|
|
|
+ if (!robotCameraRotationMatrix.IsSuccess)
|
|
|
+ {
|
|
|
+ return (false, null, null, null);
|
|
|
+ }
|
|
|
+ //自动移动机器人至图像中心点位置
|
|
|
+ var autoMoveResult = await AutoMoveRobotToImageCenter(robot, robotCameraRotationMatrix.RotationMatrix, robotCameraRotationMatrix.PixelScaleX, robotCameraRotationMatrix.PixelScaleY, cancellationToken);
|
|
|
+ if (!autoMoveResult.IsSuccess)
|
|
|
+ {
|
|
|
+ return (false, null, null, null);
|
|
|
+ }
|
|
|
+ calibrationInfo.CenterPoint.X = (float)autoMoveResult.X;
|
|
|
+ calibrationInfo.CenterPoint.Y = (float)autoMoveResult.Y;
|
|
|
}
|
|
|
|
|
|
double IntervalX = calibrationInfo.Width / 2;
|
|
|
@@ -1887,6 +1901,8 @@ namespace TeamAAS_VP.Services
|
|
|
{
|
|
|
return (false, null, null);
|
|
|
}
|
|
|
+
|
|
|
+ //MessageBox.Show("模组移动Mark至相机中心点");
|
|
|
PointF P11 = new PointF(calibrationInfo.IndependentDownCameraMotionModulePoint.X, calibrationInfo.IndependentDownCameraMotionModulePoint.Y);
|
|
|
await Task.Delay(300);
|
|
|
|
|
|
@@ -1900,6 +1916,7 @@ namespace TeamAAS_VP.Services
|
|
|
{
|
|
|
return (false, null, null);
|
|
|
}
|
|
|
+ //MessageBox.Show("移动机器人至中心位置");
|
|
|
|
|
|
// 3.计算相机与机器人坐标系的旋转矩阵
|
|
|
var robotCameraRotationMatrix = await AutoIdentifyRobotCameraRotationMatrix(calibrationInfo, robot, cancellationToken);
|
|
|
@@ -1910,6 +1927,7 @@ namespace TeamAAS_VP.Services
|
|
|
pixelScaleX = robotCameraRotationMatrix.PixelScaleX;
|
|
|
pixelScaleY = robotCameraRotationMatrix.PixelScaleY;
|
|
|
RobotCameraRotationMatrix = robotCameraRotationMatrix.Item2;
|
|
|
+ //MessageBox.Show("相机与机器人坐标系的旋转矩阵");
|
|
|
|
|
|
// 4.自动移动机器人至图像中心点位置
|
|
|
var autoMoveResult = await AutoMoveRobotToImageCenter(robot, RobotCameraRotationMatrix, pixelScaleX, pixelScaleY, cancellationToken);
|
|
|
@@ -1917,6 +1935,7 @@ namespace TeamAAS_VP.Services
|
|
|
{
|
|
|
return (false, null, null);
|
|
|
}
|
|
|
+ //MessageBox.Show("移动机器人至图像中心点位置");
|
|
|
Console.WriteLine($"移动前:{autoMoveResult.X}");
|
|
|
|
|
|
// 5.记录当前机器人Tool 0下的坐标转换成工具坐标下的坐标,并记录下来
|
|
|
@@ -1941,6 +1960,7 @@ namespace TeamAAS_VP.Services
|
|
|
}
|
|
|
PointF P12 = new PointF(movePos.X, movePos.Y);
|
|
|
await Task.Delay(300);
|
|
|
+ //MessageBox.Show("移动独立模组至标定点位置");
|
|
|
|
|
|
// 7.自动移动机器人至图像中心点位置
|
|
|
autoMoveResult = await AutoMoveRobotToImageCenter(robot, RobotCameraRotationMatrix, pixelScaleX, pixelScaleY, cancellationToken);
|
|
|
@@ -1948,6 +1968,7 @@ namespace TeamAAS_VP.Services
|
|
|
{
|
|
|
return (false, null, null);
|
|
|
}
|
|
|
+ //MessageBox.Show("自动移动机器人至图像中心点位置");
|
|
|
|
|
|
// 8.记录当前机器人Tool 0下的坐标转换成工具坐标下的坐标,并记录下来
|
|
|
ToolCoord toolCoord1 = new ToolCoord();
|