2026-03-28 10:49:55 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
#include "rodAndBarDetection_Export.h"
|
|
|
|
|
|
#include "VZNL_Types.h"
|
|
|
|
|
|
#include "VrTimeUtils.h"
|
|
|
|
|
|
#include "VrError.h"
|
|
|
|
|
|
#include "VrLog.h"
|
|
|
|
|
|
#include "IVrConfig.h"
|
|
|
|
|
|
#include "LaserDataLoader.h"
|
|
|
|
|
|
#include "IYScrewPositionStatus.h"
|
|
|
|
|
|
#include "PointCloudImageUtils.h"
|
|
|
|
|
|
#include "VrConvert.h"
|
|
|
|
|
|
#include "VrDateUtils.h"
|
|
|
|
|
|
|
2026-04-15 11:08:31 +08:00
|
|
|
|
struct RobotPose6D;
|
|
|
|
|
|
|
2026-04-20 16:37:25 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* @brief 描述一次检测使用的手眼外参(按相机配置)
|
|
|
|
|
|
*
|
|
|
|
|
|
* eulerOrder 同时用作机器人法兰姿态的输入分解 (rx/ry/rz → 旋转矩阵)
|
|
|
|
|
|
* 以及工具姿态输出的合成 (旋转矩阵 → roll/pitch/yaw);
|
2026-04-23 09:01:05 +08:00
|
|
|
|
* rotX/Y/Z 在 Eye 坐标系下按 Rx*Ry*Rz 顺序对工具三轴做补偿旋转(手眼变换之前)。
|
|
|
|
|
|
* outRotX/Y/Z 在 Robot 坐标系下按 Rx*Ry*Rz 顺序对工具三轴做补偿旋转(手眼变换之后、提欧拉角之前),
|
|
|
|
|
|
* 用于把"算法定义的工具系"修正到"机器人期望的 TCP 系",同时让输出位姿远离万向节锁。
|
|
|
|
|
|
* 默认 0 不启用;具体值应由示教位姿反推得到,不要照搬某次测量值。
|
2026-04-20 16:37:25 +08:00
|
|
|
|
* approachOffset 是机械臂接近点相对目标点沿目标姿态反方向的偏移量(mm)。
|
|
|
|
|
|
*/
|
|
|
|
|
|
struct HandEyeExtrinsic
|
|
|
|
|
|
{
|
|
|
|
|
|
int eulerOrder = 11;
|
|
|
|
|
|
double rotX = 0.0;
|
|
|
|
|
|
double rotY = 0.0;
|
|
|
|
|
|
double rotZ = 0.0;
|
|
|
|
|
|
double approachOffset = 0.0;
|
2026-04-23 23:40:50 +08:00
|
|
|
|
double offsetX = 0.0;
|
|
|
|
|
|
double offsetY = 0.0;
|
|
|
|
|
|
double offsetZ = 0.0;
|
2026-04-23 09:01:05 +08:00
|
|
|
|
double outRotX = 0.0;
|
|
|
|
|
|
double outRotY = 0.0;
|
2026-04-23 23:40:50 +08:00
|
|
|
|
double outRotZ = 14.56;
|
2026-04-20 16:37:25 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-03-28 10:49:55 +08:00
|
|
|
|
class DetectPresenter
|
|
|
|
|
|
{
|
|
|
|
|
|
private:
|
|
|
|
|
|
/* data */
|
|
|
|
|
|
public:
|
|
|
|
|
|
DetectPresenter(/* args */);
|
|
|
|
|
|
~DetectPresenter();
|
2026-04-08 22:12:47 +08:00
|
|
|
|
static QString GetAlgoVersion();
|
2026-03-28 10:49:55 +08:00
|
|
|
|
|
|
|
|
|
|
/// 螺杆检测接口
|
|
|
|
|
|
int DetectScrew( int cameraIndex,
|
|
|
|
|
|
std::vector<std::pair<EVzResultDataType, SVzLaserLineData>>& laserLines,
|
|
|
|
|
|
const VrAlgorithmParams& algorithmParams,
|
|
|
|
|
|
const VrDebugParam& debugParam,
|
|
|
|
|
|
LaserDataLoader& dataLoader,
|
|
|
|
|
|
const double clibMatrix[16],
|
2026-04-15 11:08:31 +08:00
|
|
|
|
const RobotPose6D& robotPose,
|
2026-04-20 16:37:25 +08:00
|
|
|
|
const HandEyeExtrinsic& extrinsic,
|
2026-04-17 10:18:03 +08:00
|
|
|
|
int poseOutputOrder,
|
2026-04-15 11:08:31 +08:00
|
|
|
|
DetectionResult& detectionResult);
|
|
|
|
|
|
|
|
|
|
|
|
/// 工具盘检测接口
|
|
|
|
|
|
int DetectToolDisk(int cameraIndex,
|
|
|
|
|
|
std::vector<std::pair<EVzResultDataType, SVzLaserLineData>>& laserLines,
|
|
|
|
|
|
const VrAlgorithmParams& algorithmParams,
|
|
|
|
|
|
const VrDebugParam& debugParam,
|
|
|
|
|
|
LaserDataLoader& dataLoader,
|
|
|
|
|
|
const double clibMatrix[16],
|
|
|
|
|
|
const RobotPose6D& robotPose,
|
2026-04-20 16:37:25 +08:00
|
|
|
|
const HandEyeExtrinsic& extrinsic,
|
2026-04-17 10:18:03 +08:00
|
|
|
|
int poseOutputOrder,
|
2026-03-28 10:49:55 +08:00
|
|
|
|
DetectionResult& detectionResult);
|
|
|
|
|
|
|
|
|
|
|
|
};
|