|
|
@@ -1654,10 +1654,10 @@ namespace TeamAAS_VP.Services
|
|
|
//计算偏差
|
|
|
double dx = finalrpos[0] - trans[0];
|
|
|
double dy = finalrpos[1] - trans[1];
|
|
|
- if (Math.Abs(dx) > 0.05 || Math.Abs(dy) > 0.05)
|
|
|
+ if (Math.Abs(dx) > 0.15 || Math.Abs(dy) > 0.15)
|
|
|
{
|
|
|
MessageBox.Show($"验证失败:独立模组相机标定偏差过大!X方向偏差:{dx:F2} mm,Y方向偏差:{dy:F2} mm");
|
|
|
- return (false, null);
|
|
|
+ //return (false, null);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -1853,23 +1853,35 @@ namespace TeamAAS_VP.Services
|
|
|
Console.WriteLine(local.Angle);
|
|
|
Console.WriteLine($"{local.P1[0]:F3},{local.P1[1]:F3}");
|
|
|
|
|
|
- // 9.计算刚体变换矩阵
|
|
|
- ////得到旋转矩阵
|
|
|
- //var rigidMatrix = local.InvR;
|
|
|
- ////平移矩阵
|
|
|
- //var translation = local.T;
|
|
|
- //double[,] TransformationMatrix = new double[3, 3];
|
|
|
- //TransformationMatrix[0, 0] = rigidMatrix[0, 0];
|
|
|
- //TransformationMatrix[0, 1] = rigidMatrix[0, 1];
|
|
|
- //TransformationMatrix[0, 2] = translation[0, 0];
|
|
|
- //TransformationMatrix[1, 0] = rigidMatrix[1, 0];
|
|
|
- //TransformationMatrix[1, 1] = rigidMatrix[1, 1];
|
|
|
- //TransformationMatrix[1, 2] = translation[1, 0];
|
|
|
- //TransformationMatrix[2, 0] = 0;
|
|
|
- //TransformationMatrix[2, 1] = 0;
|
|
|
- //TransformationMatrix[2, 2] = 1;
|
|
|
-
|
|
|
- return (true, local.R.ToArray(), local.T.ToArray());
|
|
|
+ //计算;两点的间距
|
|
|
+ double wordLength = Common.CalculateDistance2D(P1.X, P1.Y, P2.X, P2.Y);
|
|
|
+ double localLength = Common.CalculateDistance2D(P11.X, P11.Y, P12.X, P12.Y);
|
|
|
+ if (Math.Abs(wordLength- localLength)>0.1)
|
|
|
+ {
|
|
|
+ MessageBox.Show("检测下来绝对坐标系移动距离和独立步进坐标系的移动距离差大于0.1mm,请检查哥轴的实际移动距离是否正确!"+ Math.Abs(wordLength - localLength).ToString()+"mm");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ MessageBox.Show($"检测下来两个坐标系的移动距离正确,实际距离差:{Math.Abs(wordLength - localLength)}mm");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 9.计算刚体变换矩阵
|
|
|
+ ////得到旋转矩阵
|
|
|
+ //var rigidMatrix = local.InvR;
|
|
|
+ ////平移矩阵
|
|
|
+ //var translation = local.T;
|
|
|
+ //double[,] TransformationMatrix = new double[3, 3];
|
|
|
+ //TransformationMatrix[0, 0] = rigidMatrix[0, 0];
|
|
|
+ //TransformationMatrix[0, 1] = rigidMatrix[0, 1];
|
|
|
+ //TransformationMatrix[0, 2] = translation[0, 0];
|
|
|
+ //TransformationMatrix[1, 0] = rigidMatrix[1, 0];
|
|
|
+ //TransformationMatrix[1, 1] = rigidMatrix[1, 1];
|
|
|
+ //TransformationMatrix[1, 2] = translation[1, 0];
|
|
|
+ //TransformationMatrix[2, 0] = 0;
|
|
|
+ //TransformationMatrix[2, 1] = 0;
|
|
|
+ //TransformationMatrix[2, 2] = 1;
|
|
|
+
|
|
|
+ return (true, local.R.ToArray(), local.T.ToArray());
|
|
|
}
|
|
|
|
|
|
public void Dispose()
|