|
|
@@ -488,29 +488,21 @@ namespace TeamAAS_VP.Services
|
|
|
pixelScaleX = robotCameraRotationMatrix.PixelScaleX;
|
|
|
pixelScaleY = robotCameraRotationMatrix.PixelScaleY;
|
|
|
RobotCameraRotationMatrix = robotCameraRotationMatrix.Item2;
|
|
|
- //相机拍照并处理图像
|
|
|
- var photoResult = await CaptureAndProcessCallback();
|
|
|
- if (!photoResult.IsSuccess)
|
|
|
+
|
|
|
+ //自动移动机器人至图像中心点位置
|
|
|
+ var autoMoveResult = await AutoMoveRobotToImageCenter(robot, RobotCameraRotationMatrix, pixelScaleX, pixelScaleY, cancellationToken);
|
|
|
+ if (!autoMoveResult.IsSuccess)
|
|
|
{
|
|
|
return (false, null, 0, 0, 0, 0);
|
|
|
}
|
|
|
- PointF P0 = new PointF((float)(photoResult.X), (float)(photoResult.Y));
|
|
|
+ calibrationInfo.CenterPoint.X = (float)autoMoveResult.X;
|
|
|
+ calibrationInfo.CenterPoint.Y = (float)autoMoveResult.Y;
|
|
|
|
|
|
RPoint RobotU = calibrationInfo.CenterPoint.Clone();
|
|
|
RobotU.U += (float)calibrationInfo.Angle;
|
|
|
- //移动机器人中心点
|
|
|
- isFinished=await robot.CalibMotionAsync(calibrationInfo.CenterPoint, calibrationInfo.CenterPoint.Z);
|
|
|
- if (!isFinished)
|
|
|
- {
|
|
|
- return (false, null, 0, 0, 0, 0);
|
|
|
- }
|
|
|
- if (cancellationToken.IsCancellationRequested)
|
|
|
- {
|
|
|
- return (false, null, 0, 0, 0, 0);
|
|
|
- }
|
|
|
|
|
|
//机器人U轴旋转
|
|
|
- isFinished = await robot.CalibMotionAsync(RobotU, RobotU.Z);
|
|
|
+ isFinished = await robot.CalibMotionAsync(RobotU, RobotU.Z);
|
|
|
if (!isFinished)
|
|
|
{
|
|
|
return (false, null, 0, 0, 0, 0);
|
|
|
@@ -521,85 +513,45 @@ namespace TeamAAS_VP.Services
|
|
|
}
|
|
|
|
|
|
//相机拍照并处理图像
|
|
|
- photoResult = await CaptureAndProcessCallback();
|
|
|
+ var photoResult = await CaptureAndProcessCallback();
|
|
|
if (!photoResult.IsSuccess)
|
|
|
{
|
|
|
return (false, null, 0, 0, 0, 0);
|
|
|
}
|
|
|
PointF curPixel = new PointF((float)(photoResult.X), (float)(photoResult.Y));
|
|
|
|
|
|
- bool IsFinish = false;
|
|
|
- for (int i = 0; i < 10; i++)
|
|
|
+ autoMoveResult = await AutoMoveRobotToImageCenter(robot, RobotCameraRotationMatrix, pixelScaleX, pixelScaleY, cancellationToken);
|
|
|
+ if (!autoMoveResult.IsSuccess)
|
|
|
{
|
|
|
- //计算需要移动的偏移量,目的是逼近中心点
|
|
|
- double offsetx = (P0.X - curPixel.X) * pixelScaleX;
|
|
|
- double offsety = (P0.Y - curPixel.Y) * pixelScaleY;
|
|
|
- var pos = RobotCameraRotationMatrix.Inverse() * Vector<double>.Build.Dense(new double[] { offsetx, offsety });
|
|
|
-
|
|
|
- RobotU.X += (float)pos[0];
|
|
|
- RobotU.Y += (float)pos[1];
|
|
|
- //机器人移动
|
|
|
- isFinished = await robot.CalibMotionAsync(RobotU, RobotU.Z);
|
|
|
- if (!isFinished)
|
|
|
- {
|
|
|
- return (false, null, 0, 0, 0, 0);
|
|
|
- }
|
|
|
- if (cancellationToken.IsCancellationRequested)
|
|
|
- {
|
|
|
- return (false, null, 0, 0, 0, 0);
|
|
|
- }
|
|
|
+ return (false, null, 0, 0, 0, 0);
|
|
|
+ }
|
|
|
+ RobotU.X = (float)autoMoveResult.X;
|
|
|
+ RobotU.Y = (float)autoMoveResult.Y;
|
|
|
|
|
|
- photoResult = await CaptureAndProcessCallback();
|
|
|
- if (!photoResult.IsSuccess)
|
|
|
- {
|
|
|
- return (false, null, 0, 0, 0, 0);
|
|
|
- }
|
|
|
- curPixel = new PointF((float)(photoResult.X), (float)(photoResult.Y));
|
|
|
- offsetx = P0.X - curPixel.X;
|
|
|
- offsety = P0.Y - curPixel.Y;
|
|
|
- //await Console.Out.WriteLineAsync($"移动后的差异:{offsetx},{offsety}");
|
|
|
- if (Math.Abs(offsetx) < 1 && Math.Abs(offsetx) < 1)
|
|
|
- {
|
|
|
- //移动机器人至待机位置
|
|
|
- isFinished=await robot.CalibMotionAsync(calibrationInfo.CenterPoint, calibrationInfo.CenterPoint.Z);
|
|
|
- if (!isFinished)
|
|
|
- {
|
|
|
- return (false, null, 0, 0, 0, 0);
|
|
|
- }
|
|
|
- IsFinish = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- if (cancellationToken.IsCancellationRequested)
|
|
|
- {
|
|
|
- return (false, null, 0, 0, 0, 0);
|
|
|
- }
|
|
|
+ isFinished = await robot.CalibMotionAsync(calibrationInfo.CenterPoint, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0, 0, 0);
|
|
|
}
|
|
|
|
|
|
- if (IsFinish)
|
|
|
+ Vector<double> p0 = Vector<double>.Build.Dense(new double[] { calibrationInfo.CenterPoint.X, calibrationInfo.CenterPoint.Y });
|
|
|
+ Vector<double> p1 = Vector<double>.Build.Dense(new double[] { RobotU.X, RobotU.Y });
|
|
|
+ ToolCoord toolCoord = new ToolCoord();
|
|
|
+ double u1 = calibrationInfo.CenterPoint.U;
|
|
|
+ double u2 = RobotU.U;
|
|
|
+ if (robot.Brand == Enums.RobotBrand.Schneider)
|
|
|
{
|
|
|
- Vector<double> p0 = Vector<double>.Build.Dense(new double[] { calibrationInfo.CenterPoint.X, calibrationInfo.CenterPoint.Y });
|
|
|
- Vector<double> p1 = Vector<double>.Build.Dense(new double[] { RobotU.X, RobotU.Y });
|
|
|
- ToolCoord toolCoord = new ToolCoord();
|
|
|
- double u1 = calibrationInfo.CenterPoint.U;
|
|
|
- double u2 = RobotU.U;
|
|
|
- if (robot.Brand == Enums.RobotBrand.Schneider)
|
|
|
- {
|
|
|
- u1 *= -1;
|
|
|
- u2 *= -1;
|
|
|
- }
|
|
|
- toolCoord.ComputeTool(p0, p1, u1, u2);
|
|
|
- if (calibrationInfo.Tool == null)
|
|
|
- {
|
|
|
- calibrationInfo.Tool = new RobotTool();
|
|
|
- }
|
|
|
- calibrationInfo.Tool.X = toolCoord.X;
|
|
|
- calibrationInfo.Tool.Y = toolCoord.Y;
|
|
|
- return (true, RobotCameraRotationMatrix, calibrationInfo.Tool.X, calibrationInfo.Tool.Y, pixelScaleX, pixelScaleY);
|
|
|
+ u1 *= -1;
|
|
|
+ u2 *= -1;
|
|
|
}
|
|
|
- else
|
|
|
+ toolCoord.ComputeTool(p0, p1, u1, u2);
|
|
|
+ if (calibrationInfo.Tool == null)
|
|
|
{
|
|
|
- return (false, null, 0, 0, 0, 0);
|
|
|
+ calibrationInfo.Tool = new RobotTool();
|
|
|
}
|
|
|
+ calibrationInfo.Tool.X = toolCoord.X;
|
|
|
+ calibrationInfo.Tool.Y = toolCoord.Y;
|
|
|
+ return (true, RobotCameraRotationMatrix, calibrationInfo.Tool.X, calibrationInfo.Tool.Y, pixelScaleX, pixelScaleY);
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
@@ -672,18 +624,26 @@ namespace TeamAAS_VP.Services
|
|
|
{
|
|
|
//移动距离,单位mm
|
|
|
float distance = ((float)calibrationInfo.Height) / 3;
|
|
|
-
|
|
|
+ bool isFinished = false;
|
|
|
//-------------------------------------------P0-----------------------------------
|
|
|
//移动机器人至中心点
|
|
|
if (calibrationInfo.CameraMount == Enums.CameraMount.FixedDown && !calibrationInfo.FixedDownCameraNoReturnToHome)
|
|
|
{
|
|
|
- await robot.CalibMotionAsync(calibrationInfo.CenterPoint, null);
|
|
|
+ isFinished = await robot.CalibMotionAsync(calibrationInfo.CenterPoint, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
//关闭吸气
|
|
|
await robot.CalibOutIOAsync(false);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- await robot.CalibMotionAsync(calibrationInfo.CenterPoint, calibrationInfo.CenterPoint.Z);
|
|
|
+ isFinished = await robot.CalibMotionAsync(calibrationInfo.CenterPoint, calibrationInfo.CenterPoint.Z);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -696,7 +656,11 @@ namespace TeamAAS_VP.Services
|
|
|
if (calibrationInfo.CameraMount == Enums.CameraMount.FixedDown && !calibrationInfo.FixedDownCameraNoReturnToHome)
|
|
|
{
|
|
|
//移动机器人至待机位置
|
|
|
- await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ isFinished = await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//相机拍照并处理图像
|
|
|
@@ -711,7 +675,11 @@ namespace TeamAAS_VP.Services
|
|
|
if (calibrationInfo.CameraMount == Enums.CameraMount.FixedDown && !calibrationInfo.FixedDownCameraNoReturnToHome)
|
|
|
{
|
|
|
//移动机器人至P0
|
|
|
- await robot.CalibMotionAsync(RobotP0, null);
|
|
|
+ isFinished = await robot.CalibMotionAsync(RobotP0, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
{
|
|
|
return (false, null, 0, 0);
|
|
|
@@ -719,7 +687,11 @@ namespace TeamAAS_VP.Services
|
|
|
//打开吸气
|
|
|
await robot.CalibOutIOAsync(true);
|
|
|
//移动机器人至P1
|
|
|
- await robot.CalibMotionAsync(RobotP1, null);
|
|
|
+ isFinished = await robot.CalibMotionAsync(RobotP1, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
{
|
|
|
return (false, null, 0, 0);
|
|
|
@@ -727,12 +699,20 @@ namespace TeamAAS_VP.Services
|
|
|
//关闭吸气
|
|
|
await robot.CalibOutIOAsync(false);
|
|
|
//移动机器人至待机位置
|
|
|
- await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ isFinished = await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//移动机器人至P1
|
|
|
- await robot.CalibMotionAsync(RobotP1, RobotP1.Z);
|
|
|
+ isFinished= await robot.CalibMotionAsync(RobotP1, RobotP1.Z);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
@@ -752,7 +732,11 @@ namespace TeamAAS_VP.Services
|
|
|
if (calibrationInfo.CameraMount == Enums.CameraMount.FixedDown && !calibrationInfo.FixedDownCameraNoReturnToHome)
|
|
|
{
|
|
|
//移动机器人至P1
|
|
|
- await robot.CalibMotionAsync(RobotP1, null);
|
|
|
+ isFinished= await robot.CalibMotionAsync(RobotP1, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
{
|
|
|
return (false, null, 0, 0);
|
|
|
@@ -760,7 +744,11 @@ namespace TeamAAS_VP.Services
|
|
|
//打开吸气
|
|
|
await robot.CalibOutIOAsync(true);
|
|
|
//移动机器人至P2
|
|
|
- await robot.CalibMotionAsync(RobotP2, null);
|
|
|
+ isFinished= await robot.CalibMotionAsync(RobotP2, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
{
|
|
|
return (false, null, 0, 0);
|
|
|
@@ -768,12 +756,20 @@ namespace TeamAAS_VP.Services
|
|
|
//关闭吸气
|
|
|
await robot.CalibOutIOAsync(false);
|
|
|
//移动机器人至待机位置
|
|
|
- await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ isFinished= await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//移动机器人至P2
|
|
|
- await robot.CalibMotionAsync(RobotP2, RobotP2.Z);
|
|
|
+ isFinished= await robot.CalibMotionAsync(RobotP2, RobotP2.Z);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
{
|
|
|
@@ -793,7 +789,11 @@ namespace TeamAAS_VP.Services
|
|
|
if (calibrationInfo.CameraMount == Enums.CameraMount.FixedDown && !calibrationInfo.FixedDownCameraNoReturnToHome)
|
|
|
{
|
|
|
//移动机器人至P2
|
|
|
- await robot.CalibMotionAsync(RobotP2, null);
|
|
|
+ isFinished= await robot.CalibMotionAsync(RobotP2, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
{
|
|
|
return (false, null, 0, 0);
|
|
|
@@ -801,7 +801,11 @@ namespace TeamAAS_VP.Services
|
|
|
//打开吸气
|
|
|
await robot.CalibOutIOAsync(true);
|
|
|
//移动机器人至P0
|
|
|
- await robot.CalibMotionAsync(RobotP0, null);
|
|
|
+ isFinished= await robot.CalibMotionAsync(RobotP0, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
{
|
|
|
return (false, null, 0, 0);
|
|
|
@@ -809,12 +813,20 @@ namespace TeamAAS_VP.Services
|
|
|
//关闭吸气
|
|
|
await robot.CalibOutIOAsync(false);
|
|
|
//移动机器人至待机位置
|
|
|
- await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ isFinished= await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//移动机器人至P0
|
|
|
- await robot.CalibMotionAsync(RobotP0, RobotP0.Z);
|
|
|
+ isFinished= await robot.CalibMotionAsync(RobotP0, RobotP0.Z);
|
|
|
+ if (!isFinished)
|
|
|
+ {
|
|
|
+ return (false, null, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
{
|
|
|
@@ -1509,7 +1521,7 @@ namespace TeamAAS_VP.Services
|
|
|
Local = calibrationInfo.CenterPoint.Local,
|
|
|
Tool = calibrationInfo.CenterPoint.Tool
|
|
|
});
|
|
|
-
|
|
|
+ bool isSucceed = false;
|
|
|
List<Vector<double>> TestPos = new List<Vector<double>>();
|
|
|
for (int i = 0; i < rPoints.Count; i++)
|
|
|
{
|
|
|
@@ -1524,12 +1536,20 @@ namespace TeamAAS_VP.Services
|
|
|
//关闭吸气
|
|
|
await robot.CalibOutIOAsync(false);
|
|
|
//移动机器人至待机位置
|
|
|
- await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ isSucceed = await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ if (!isSucceed)
|
|
|
+ {
|
|
|
+ return (false, null);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//移动机器人至i
|
|
|
- await robot.CalibMotionAsync(rPoints[i], rPoints[i].Z);
|
|
|
+ isSucceed = await robot.CalibMotionAsync(rPoints[i], rPoints[i].Z);
|
|
|
+ if (!isSucceed)
|
|
|
+ {
|
|
|
+ return (false, null);
|
|
|
+ }
|
|
|
}
|
|
|
if (cancellationToken.IsCancellationRequested)
|
|
|
{
|
|
|
@@ -1550,7 +1570,11 @@ namespace TeamAAS_VP.Services
|
|
|
if (calibrationInfo.CameraMount == Enums.CameraMount.FixedDown)
|
|
|
{
|
|
|
//移动机器人至i
|
|
|
- await robot.CalibMotionAsync(rPoints[i], null);
|
|
|
+ isSucceed = await robot.CalibMotionAsync(rPoints[i], null);
|
|
|
+ if (!isSucceed)
|
|
|
+ {
|
|
|
+ return (false, null);
|
|
|
+ }
|
|
|
//打开吸气
|
|
|
await robot.CalibOutIOAsync(true);
|
|
|
}
|
|
|
@@ -1564,17 +1588,29 @@ namespace TeamAAS_VP.Services
|
|
|
if (calibrationInfo.CameraMount == Enums.CameraMount.FixedDown)
|
|
|
{
|
|
|
//移动机器人至待机位置
|
|
|
- await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ isSucceed = await robot.CalibMotionAsync(calibrationInfo.HomePoint, null);
|
|
|
+ if (!isSucceed)
|
|
|
+ {
|
|
|
+ return (false, null);
|
|
|
+ }
|
|
|
}
|
|
|
else if (calibrationInfo.CameraMount == Enums.CameraMount.MobileDown_IndependentXYPlatform)
|
|
|
{
|
|
|
//移动机器人至中心点
|
|
|
- await robot.CalibMotionAsync(calibrationInfo.CenterPoint, null);
|
|
|
+ isSucceed = await robot.CalibMotionAsync(calibrationInfo.CenterPoint, null);
|
|
|
+ if (!isSucceed)
|
|
|
+ {
|
|
|
+ return (false, null);
|
|
|
+ }
|
|
|
//移动独立模组偏移X距离
|
|
|
var movePos = calibrationInfo.IndependentDownCameraMotionModulePoint.Clone();
|
|
|
movePos.X += (float)calibrationInfo.IndependentDownCameraMotionModuleMoveX;
|
|
|
- await ((XYZU_Robot)robot).WaitCameraMoveFinishedAsync(calibrationInfo.CameraMotionModuleIndex, movePos);
|
|
|
- await Task.Delay(300);
|
|
|
+ isSucceed = await ((XYZU_Robot)robot).WaitCameraMoveFinishedAsync(calibrationInfo.CameraMotionModuleIndex, movePos);
|
|
|
+ if (!isSucceed)
|
|
|
+ {
|
|
|
+ return (false, null);
|
|
|
+ }
|
|
|
+ await Task.Delay(500);
|
|
|
//相机拍照获取像素坐标
|
|
|
var photoResult = await CaptureAndProcessCallback();
|
|
|
if (!photoResult.IsSuccess)
|
|
|
@@ -1594,8 +1630,8 @@ namespace TeamAAS_VP.Services
|
|
|
//平移向量
|
|
|
Vector<double> PT = Vector<double>.Build.Dense(new double[] { T[0, 2], T[1, 2] });
|
|
|
|
|
|
- Vector<double> p100 = Vector<double>.Build.Dense(new double[] { calibrationInfo.IndependentDownCameraMotionModulePoint.X, calibrationInfo.IndependentDownCameraMotionModulePoint.Y, 1 });
|
|
|
- Vector<double> p101 = Vector<double>.Build.Dense(new double[] { movePos.X, movePos.Y, 1 });
|
|
|
+ Vector<double> p100 = Vector<double>.Build.Dense(new double[] { calibrationInfo.IndependentDownCameraMotionModulePoint.X, calibrationInfo.IndependentDownCameraMotionModulePoint.Y });
|
|
|
+ Vector<double> p101 = Vector<double>.Build.Dense(new double[] { movePos.X, movePos.Y });
|
|
|
//计算独立模组坐标系下的坐标
|
|
|
Vector<double> pl1 = R.Inverse() * (rpos - PT);
|
|
|
Vector<double> pl2 = pl1 + (p101 - p100);
|
|
|
@@ -1609,7 +1645,11 @@ namespace TeamAAS_VP.Services
|
|
|
var trans = toolCoord1.GetToolnCoord(Vector<double>.Build.Dense(new double[] { calibrationInfo.CenterPoint.X, calibrationInfo.CenterPoint.Y }), u1);
|
|
|
|
|
|
//独立移动模组回到初始位置
|
|
|
- await ((XYZU_Robot)robot).WaitCameraMoveFinishedAsync(calibrationInfo.CameraMotionModuleIndex, calibrationInfo.IndependentDownCameraMotionModulePoint);
|
|
|
+ isSucceed = await ((XYZU_Robot)robot).WaitCameraMoveFinishedAsync(calibrationInfo.CameraMotionModuleIndex, calibrationInfo.IndependentDownCameraMotionModulePoint);
|
|
|
+ if (!isSucceed)
|
|
|
+ {
|
|
|
+ return (false, null);
|
|
|
+ }
|
|
|
|
|
|
//计算偏差
|
|
|
double dx = finalrpos[0] - trans[0];
|
|
|
@@ -1748,6 +1788,7 @@ namespace TeamAAS_VP.Services
|
|
|
return (false, null, null);
|
|
|
}
|
|
|
PointF P11 = new PointF(calibrationInfo.IndependentDownCameraMotionModulePoint.X, calibrationInfo.IndependentDownCameraMotionModulePoint.Y);
|
|
|
+ await Task.Delay(300);
|
|
|
|
|
|
double pixelScaleX = 0;
|
|
|
double pixelScaleY = 0;
|
|
|
@@ -1809,6 +1850,8 @@ namespace TeamAAS_VP.Services
|
|
|
var p2 = toolCoord1.GetToolnCoord(pf, currentRobotPos.U);
|
|
|
PointF P2 = new PointF((float)p2[0], (float)p2[1]);
|
|
|
CoordinateTransformer local = new CoordinateTransformer(P1, P2, P11, P12);
|
|
|
+ Console.WriteLine(local.Angle);
|
|
|
+ Console.WriteLine($"{local.P1[0]:F3},{local.P1[1]:F3}");
|
|
|
|
|
|
// 9.计算刚体变换矩阵
|
|
|
////得到旋转矩阵
|