GrabBag/AppUtils/AppConfig/Inc/VrHandEyeCalibConfig.h

65 lines
2.0 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef VRHANDEYECALIBCONFIG_H
#define VRHANDEYECALIBCONFIG_H
#include <cstring>
/**
* @brief 手眼标定矩阵(多项目共用)
*
* 每台相机独立保存:标定矩阵、欧拉角顺序以及工具坐标轴绕 X/Y/Z 三轴的补偿旋转。
* 欧拉角顺序同时用于机器人法兰姿态的分解(输入)和工具姿态的合成(输出)。
* rotX/Y/Z : Tool rotation compensation composed with this matrix's eulerOrder.
* axialAngleMin/Max: Preferred axial direction angle range in the camera XY plane, degrees.
* outRotX/Y/Z: Robot 坐标系下施加的后补偿,按 Rx*Ry*Rz 合成(手眼变换之后、提欧拉角之前)
* 用于把"算法定义的工具系"修正到"机器人期望的 TCP 系",避免输出进入万向节锁。
*/
struct VrHandEyeCalibMatrix
{
int cameraIndex;
int calibType; // 0=眼在手外1=眼在手上
double matrix[16];
int eulerOrder;
double rotX;
double rotY;
double rotZ;
double axialAngleMin;
double axialAngleMax;
/* 接近点偏移 (mm): approach point offset along -axialDir (screw) / -normalDir (tool disk). */
double approachOffset;
/* 目标点在 Robot 坐标系下沿 X/Y/Z 轴的补偿偏移 (mm)。 */
double offsetX;
double offsetY;
double offsetZ;
double outRotX;
double outRotY;
double outRotZ;
VrHandEyeCalibMatrix()
: cameraIndex(1)
, calibType(0)
, eulerOrder(11)
, rotX(0.0)
, rotY(0.0)
, rotZ(0.0)
, axialAngleMin(-180.0)
, axialAngleMax(180.0)
, approachOffset(0.0)
, offsetX(0.0)
, offsetY(0.0)
, offsetZ(0.0)
, outRotX(0.0)
, outRotY(0.0)
, outRotZ(14.56)
{
double identity[16] = {
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0
};
memcpy(matrix, identity, sizeof(matrix));
}
};
#endif // VRHANDEYECALIBCONFIG_H