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);
|
|
|
|
|
|
* rotX/Y/Z 在 Eye 坐标系下按 Rx*Ry*Rz 顺序对工具三轴做补偿旋转。
|
|
|
|
|
|
* approachOffset 是机械臂接近点相对目标点沿目标姿态反方向的偏移量(mm)。
|
|
|
|
|
|
*/
|
|
|
|
|
|
struct HandEyeExtrinsic
|
|
|
|
|
|
{
|
|
|
|
|
|
int eulerOrder = 11;
|
|
|
|
|
|
double rotX = 0.0;
|
|
|
|
|
|
double rotY = 0.0;
|
|
|
|
|
|
double rotZ = 0.0;
|
|
|
|
|
|
double approachOffset = 0.0;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
};
|