78 lines
2.7 KiB
C
78 lines
2.7 KiB
C
|
|
#pragma once
|
|||
|
|
#include <iostream>
|
|||
|
|
#include <vector>
|
|||
|
|
#include <memory>
|
|||
|
|
#include <QString>
|
|||
|
|
#include "workpieceHolePositioning_Export.h"
|
|||
|
|
#include "VZNL_Types.h"
|
|||
|
|
#include "VrTimeUtils.h"
|
|||
|
|
#include "VrError.h"
|
|||
|
|
#include "VrLog.h"
|
|||
|
|
#include "IVrConfig.h"
|
|||
|
|
#include "LaserDataLoader.h"
|
|||
|
|
#include "IYDiscHolePoseStatus.h"
|
|||
|
|
#include "PointCloudImageUtils.h"
|
|||
|
|
#include "VrConvert.h"
|
|||
|
|
#include "VrDateUtils.h"
|
|||
|
|
|
|||
|
|
struct RobotPose6D;
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @brief 描述一次检测使用的手眼外参(按相机配置)
|
|||
|
|
*
|
|||
|
|
* eulerOrder 同时用作机器人法兰姿态的输入分解 (rx/ry/rz -> 旋转矩阵)
|
|||
|
|
* 以及工具姿态输出的合成 (旋转矩阵 -> roll/pitch/yaw);
|
|||
|
|
* rotX/Y/Z 在 Eye 坐标系下按 Rx*Ry*Rz 顺序对工具三轴做补偿旋转(手眼变换之前)。
|
|||
|
|
* outRotX/Y/Z 在 Robot 坐标系下按 Rx*Ry*Rz 顺序对工具三轴做补偿旋转(手眼变换之后、提欧拉角之前),
|
|||
|
|
* 用于把"算法定义的工具系"修正到"机器人期望的 TCP 系",同时让输出位姿远离万向节锁。
|
|||
|
|
* 默认 0 不启用;具体值应由示教位姿反推得到,不要照搬某次测量值。
|
|||
|
|
*/
|
|||
|
|
struct HandEyeExtrinsic
|
|||
|
|
{
|
|||
|
|
int eulerOrder = 11;
|
|||
|
|
double rotX = 0.0;
|
|||
|
|
double rotY = 0.0;
|
|||
|
|
double rotZ = 0.0;
|
|||
|
|
double offsetX = 0.0;
|
|||
|
|
double offsetY = 0.0;
|
|||
|
|
double offsetZ = 0.0;
|
|||
|
|
double outRotX = 0.0;
|
|||
|
|
double outRotY = 0.0;
|
|||
|
|
double outRotZ = 14.56;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
class DetectPresenter
|
|||
|
|
{
|
|||
|
|
private:
|
|||
|
|
/* data */
|
|||
|
|
public:
|
|||
|
|
DetectPresenter(/* args */);
|
|||
|
|
~DetectPresenter();
|
|||
|
|
static QString GetAlgoVersion();
|
|||
|
|
|
|||
|
|
/// 砂轮盘孔检测接口(调用 sx_getDiscHolePose)
|
|||
|
|
int DetectDiscHole(int cameraIndex,
|
|||
|
|
std::vector<std::pair<EVzResultDataType, SVzLaserLineData>>& laserLines,
|
|||
|
|
const VrAlgorithmParams& algorithmParams,
|
|||
|
|
const VrDebugParam& debugParam,
|
|||
|
|
LaserDataLoader& dataLoader,
|
|||
|
|
const double clibMatrix[16],
|
|||
|
|
const RobotPose6D& robotPose,
|
|||
|
|
const HandEyeExtrinsic& extrinsic,
|
|||
|
|
int poseOutputOrder,
|
|||
|
|
DetectionResult& detectionResult);
|
|||
|
|
|
|||
|
|
/// 砂轮盘架子检测接口(调用 sx_getDiscRackCenterPosition)
|
|||
|
|
int DetectDiscRack(int cameraIndex,
|
|||
|
|
std::vector<std::pair<EVzResultDataType, SVzLaserLineData>>& laserLines,
|
|||
|
|
const VrAlgorithmParams& algorithmParams,
|
|||
|
|
const VrDebugParam& debugParam,
|
|||
|
|
LaserDataLoader& dataLoader,
|
|||
|
|
const double clibMatrix[16],
|
|||
|
|
const RobotPose6D& robotPose,
|
|||
|
|
const HandEyeExtrinsic& extrinsic,
|
|||
|
|
int poseOutputOrder,
|
|||
|
|
DetectionResult& detectionResult);
|
|||
|
|
|
|||
|
|
};
|