413 lines
8.1 KiB
C++
413 lines
8.1 KiB
C++
#pragma once
|
||
|
||
#include <VZNL_Types.h>
|
||
#include <vector>
|
||
#include <SG_errCode.h>
|
||
|
||
#define PI 3.141592654
|
||
|
||
// 定义欧拉角结构体(单位:度)
|
||
typedef struct{
|
||
double roll; // 绕X轴旋转(横滚)
|
||
double pitch; // 绕Y轴旋转(俯仰)
|
||
double yaw; // 绕Z轴旋转(偏航)
|
||
}SSG_EulerAngles;
|
||
|
||
//以工作轴为X轴(扫描方向),平行地面与Z轴垂直的轴为Y轴,垂直地面的轴为Z轴
|
||
typedef struct
|
||
{
|
||
bool validFlag; //指示结果是否有效
|
||
double x;
|
||
double y;
|
||
double z;
|
||
double pitchAngle; //俯仰角:绕Y轴的偏转, 弧度
|
||
double rollAngle; //滚转角:绕X轴的偏转, 弧度
|
||
double yawAngle; //偏转角:绕Z轴的偏转, 弧度
|
||
}SSG_6AxisAttitude;
|
||
|
||
typedef struct
|
||
{
|
||
bool validFlag; //指示结果是否有效
|
||
double x;
|
||
double y;
|
||
double z;
|
||
}SSG_3AxisAttitude;
|
||
|
||
typedef enum
|
||
{
|
||
keSG_PoseSorting_Uknown = 0,
|
||
keSG_PoseSorting_ZMin2Max, ///按Z排序
|
||
keSG_PoseSorting_L2R_T2B, ///从左到右,从上到下排序
|
||
keSG_PoseSorting_T2B_L2R, ///从上到下,从左到右排序
|
||
} ESG_poseSortingMode;
|
||
|
||
typedef struct
|
||
{
|
||
int data_0;
|
||
int data_1;
|
||
int idx;
|
||
}SSG_intPair;
|
||
|
||
typedef struct
|
||
{
|
||
double left;
|
||
double right;
|
||
double top;
|
||
double bottom;
|
||
}SSG_ROIRectD;
|
||
|
||
struct HSV {
|
||
double h; // 色相 (0-360)
|
||
double s; // 饱和度 (0-1)
|
||
double v; // 亮度 (0-1)
|
||
};
|
||
|
||
struct RGB {
|
||
int r;
|
||
int g;
|
||
int b;
|
||
};
|
||
|
||
#define LINE_FEATURE_NUM 16
|
||
#define LINE_FEATURE_UNDEF 0
|
||
#define LINE_FEATURE_L_JUMP_H2L 1
|
||
#define LINE_FEATURE_L_JUMP_L2H 2
|
||
#define LINE_FEATURE_L_SLOPE_H2L 3
|
||
#define LINE_FEATURE_L_SLOPE_L2H 4
|
||
#define LINE_FEATURE_V_SLOPE 5
|
||
#define LINE_FEATURE_LINE_ENDING_0 6 //ending起点
|
||
#define LINE_FEATURE_LINE_ENDING_1 7 //ending终点
|
||
#define LINE_FEATURE_RGN_EDGE 8 //迭代处理时已经得到的目标的边缘点标记
|
||
#define LINE_FEATURE_RIGHT_ANGLE_HR 9 //直角特征:水平-上升
|
||
#define LINE_FEATURE_RIGHT_ANGLE_HF 10 //直角特征:水平-下降
|
||
#define LINE_FEATURE_RIGHT_ANGLE_RH 11 //直角特征:上升-水平
|
||
#define LINE_FEATURE_RIGHT_ANGLE_FH 12 //直角特征:下降-水平
|
||
#define LINE_FEATURE_PEAK_TOP 13
|
||
#define LINE_FEATURE_PEAK_BOTTOM 14
|
||
#define LINE_FEATURE_CORNER_V 15
|
||
|
||
|
||
typedef struct
|
||
{
|
||
int featureType;
|
||
SVzNL2DPoint jumpPos2D;
|
||
SVzNL3DPoint jumpPos;
|
||
double featureValue;
|
||
}SSG_basicFeature1D;
|
||
|
||
typedef struct
|
||
{
|
||
int lineIdx;
|
||
double gap_start;
|
||
double gap_width;
|
||
double gap_depth;
|
||
SVzNL3DPosition gapPt_0; //gap的端点
|
||
SVzNL3DPosition gapPt_1; //gap的端点
|
||
SSG_ROIRectD roi;
|
||
}SSG_basicFeatureGap;
|
||
|
||
#define FEATURE_FLAG_UNDEF 0
|
||
#define FEATURE_FLAG_INVLD_START 1
|
||
#define FEATURE_FLAG_INVLD_END 2
|
||
#define FEATURE_FLAG_VALID_START 3
|
||
#define FEATURE_FLAG_VALID_END 4
|
||
#define FEATURE_FLAG_INVALID 5
|
||
typedef struct
|
||
{
|
||
int flag;
|
||
int lineIdx;
|
||
int startPtIdx;
|
||
int endPtIdx;
|
||
int midPtIdx;
|
||
SVzNL3DPoint midPt;
|
||
double width;
|
||
double pkHeight;
|
||
}SSG_featureSemiCircle;
|
||
|
||
typedef struct
|
||
{
|
||
int lineIdx;
|
||
std::vector<SSG_basicFeature1D> features;
|
||
std::vector<SSG_basicFeature1D> endings;
|
||
}SSG_lineFeature;
|
||
|
||
typedef struct
|
||
{
|
||
/* 点是否连续门限,小于此门限,视为点连续 */
|
||
double continuityTh; //点连续门限。当使用z跳变判断连续性时,为z跳变门限;当使用点距离判断时,为点距离门限
|
||
/* 噪声判断门限,当连续段的点数据小于此门限,视为噪声 */
|
||
double outlierTh;
|
||
}SSG_outlierFilterParam;
|
||
|
||
typedef struct
|
||
{
|
||
double LSlopeZWin; //对L型Slope进行坡度计算的窗口长度
|
||
double validSlopeH;
|
||
double minLJumpH;
|
||
double minEndingGap;//连续段门限。大于此门限,为不连续
|
||
}SSG_slopeParam;
|
||
|
||
typedef struct
|
||
{
|
||
double minEndingGap; //y方向连续段门限。大于此门限,为不连续
|
||
double minEndingGap_z; //z方向连续段门限。大于此门限,为不连续
|
||
double scale; //计算方向角的窗口比例尺
|
||
double cornerTh; //拐角门限,大于此门限,为有效拐点
|
||
double jumpCornerTh_1; //判断拐角是否为跳变的两个门限。当一个门限大于jumpCornerTh_1且另一个小于jumpCornerTh_2时跳变
|
||
double jumpCornerTh_2;
|
||
}SSG_cornerParam;
|
||
|
||
typedef struct
|
||
{
|
||
double scale_angle; //计算方向角的窗口比例尺
|
||
double scale_corner; //计算方向角转角的窗口比例尺
|
||
double cornerTh; //拐角门限,大于此门限,为有效Arc
|
||
}SSG_gloveArcParam;
|
||
|
||
typedef struct
|
||
{
|
||
double H_len; //直角特征水平段的长度
|
||
double V_len; //直角特征垂直段的长度
|
||
double maxDelta;
|
||
}SSG_lineRightAngleParam;
|
||
|
||
typedef struct
|
||
{
|
||
double valleyMinH;
|
||
double valleyMaxW;
|
||
}SSG_VFeatureParam;
|
||
|
||
typedef struct
|
||
{
|
||
double sameGapTh;
|
||
int gapChkWin;
|
||
}SSG_tearFeatureExtactPara;
|
||
typedef struct
|
||
{
|
||
double yDeviation_max;//生长时相邻特征最大的Y偏差
|
||
double zDeviation_max; //生长时相邻特征最大的Z偏差
|
||
int maxLineSkipNum; //生长时相邻特征的最大线间隔, -1时使用maxDkipDistance
|
||
double maxSkipDistance; //若maxLineSkipNum为-1, 使用此参数.设为-1时,此参数无效
|
||
double minLTypeTreeLen; //生长树最少的节点数目。小于此数目的生长树被移除
|
||
double minVTypeTreeLen; //生长树最少的节点数目。小于此数目的生长树被移除
|
||
}SSG_treeGrowParam;
|
||
|
||
typedef struct
|
||
{
|
||
double bagL; //长
|
||
double bagW; //宽
|
||
double bagH; //高
|
||
}SSG_bagParam;
|
||
|
||
typedef struct
|
||
{
|
||
ESG_poseSortingMode sortMode;
|
||
}SSG_objSortParam;
|
||
|
||
typedef struct
|
||
{
|
||
double angleStep;
|
||
double radiusStep;
|
||
}SSG_polarScanParam;
|
||
|
||
typedef struct
|
||
{
|
||
int treeState;
|
||
int treeType;
|
||
int sLineIdx;
|
||
int eLineIdx;
|
||
double tree_value;
|
||
SSG_ROIRectD roi;
|
||
std::vector< SSG_basicFeature1D> treeNodes;
|
||
}SSG_featureTree;
|
||
|
||
typedef struct
|
||
{
|
||
int treeState;
|
||
int treeType;
|
||
int sLineIdx;
|
||
int eLineIdx;
|
||
SSG_ROIRectD roi;
|
||
SVzNL3DPoint centerPt;
|
||
SVzNL2DPoint centerPos;
|
||
int treeMidType; //1:已经焊接过
|
||
std::vector< SSG_featureSemiCircle> treeNodes;
|
||
}SSG_semiCircleFeatureTree;
|
||
|
||
typedef struct
|
||
{
|
||
int vTreeFlag;
|
||
int treeIdx;
|
||
int treeType;
|
||
int sLineIdx;
|
||
int eLineIdx;
|
||
SSG_ROIRectD roi;
|
||
}SSG_treeInfo;
|
||
|
||
typedef struct
|
||
{
|
||
int seachW_lines;
|
||
int searchW_pts;
|
||
}SSG_localPkParam;
|
||
|
||
typedef struct
|
||
{
|
||
int x;
|
||
int y;
|
||
int value;
|
||
double valueD;
|
||
int sideID; //1-T, 2-B, 3-L, 4-R
|
||
}SSG_2DValueI;
|
||
|
||
typedef struct
|
||
{
|
||
int start;
|
||
int len;
|
||
int value;
|
||
}SSG_RUN;
|
||
|
||
typedef struct
|
||
{
|
||
double mean;
|
||
double var;
|
||
}SSG_meanVar;
|
||
|
||
typedef struct
|
||
{
|
||
int x;
|
||
int y;
|
||
int type;
|
||
int edgeId;
|
||
int blockFlag;//遮挡标志
|
||
double scanDist;
|
||
SVzNL3DPoint edgePt;
|
||
}SSG_contourPtInfo;
|
||
|
||
typedef struct
|
||
{
|
||
int lineIdx;
|
||
std::vector<SSG_contourPtInfo> contourPts;
|
||
}SSG_lineConotours;
|
||
|
||
typedef struct
|
||
{
|
||
int lineIdx;
|
||
int edgeId_0;
|
||
int edgeId_1;
|
||
double ptPairDist;
|
||
SSG_contourPtInfo contourPt_0;
|
||
SSG_contourPtInfo contourPt_1;
|
||
}SSG_conotourPair;
|
||
|
||
typedef struct
|
||
{
|
||
double x;
|
||
double y;
|
||
double z;
|
||
double x_roll;
|
||
double y_pitch;
|
||
double z_yaw;
|
||
}SSG_6DOF;
|
||
|
||
typedef struct
|
||
{
|
||
double L;
|
||
double W;
|
||
double H;
|
||
double angle;
|
||
SVzNL3DPoint endings[4];
|
||
} SSG_boxCarDimension;
|
||
|
||
typedef struct
|
||
{
|
||
SVzNL3DPoint opCenter; //定子中心位置
|
||
int neighbourNum; //相邻目标数量
|
||
double opAngle; //定子外部相隔120度操作点的操作角度。以Y形为基准角度(0度)
|
||
double obstacleDist; //距离周边障碍的距离
|
||
}SSG_motorStatorPosition;
|
||
|
||
typedef struct
|
||
{
|
||
int pkRgnIdx;
|
||
SVzNLSizeD objSize;
|
||
SVzNL2DPoint pos2D;
|
||
SSG_6DOF centerPos;
|
||
}SSG_peakRgnInfo;
|
||
|
||
typedef struct
|
||
{
|
||
int pkRgnIdx;
|
||
SVzNLSizeD objSize;
|
||
SVzNL2DPoint pos2D;
|
||
SSG_6DOF centerPos;
|
||
int orienFlag; //0-未知,1 - 正面, 2-反面
|
||
}SSG_peakOrienRgnInfo;
|
||
|
||
typedef struct
|
||
{
|
||
SVzNL3DPoint sPt;
|
||
SVzNL3DPoint ePt;
|
||
double scanDist;
|
||
int ptNum;
|
||
}SSG_contourEdgeInfo;
|
||
|
||
typedef struct
|
||
{
|
||
double meanDist;
|
||
double varDist;
|
||
double minDist;
|
||
double maxDist;
|
||
int matchNum;
|
||
int level2_num; //level2为高可信度(两端为Jump或Ending;
|
||
int level1_num; //level1-为中可信度(一端为Jump或Ending)
|
||
SSG_ROIRectD roi;
|
||
}SSG_edgeMatchInfo;
|
||
|
||
typedef struct
|
||
{
|
||
int id1;
|
||
int id2;
|
||
int matchPts;
|
||
int matchType; //可信度, 2为高可信度(两端为Jump或Ending; 1-为中可信度(一端为Jump或Ending);0-为低可信度
|
||
double matchValue;
|
||
double varValue;
|
||
double minMatchValue;
|
||
double maxMatchValue;
|
||
SSG_ROIRectD roi;
|
||
}SSG_matchPair;
|
||
|
||
typedef struct
|
||
{
|
||
int objIdx;
|
||
bool isValid; //是否为合格目标。顶层目标,但编织袋横放(扫描到长边)为不合格目标
|
||
SSG_ROIRectD objROI;
|
||
SVzNL3DPoint objPos;
|
||
SSG_6DOF graspPos;
|
||
}SSG_sideBagInfo;
|
||
|
||
typedef struct
|
||
{
|
||
SVzNLRect roi;
|
||
int ptCounter;
|
||
int labelID;
|
||
}SSG_Region;
|
||
|
||
typedef struct
|
||
{
|
||
double planeCalib[9]; //旋转矩阵,将点云地面调平
|
||
double planeHeight;//地面调平后的高度,用于去除地面数据
|
||
double invRMatrix[9]; //旋转矩阵,回到原坐标系
|
||
}SSG_planeCalibPara;
|
||
|
||
typedef struct
|
||
{
|
||
int pntIdx;
|
||
double forwardAngle; //前向角
|
||
double backwardAngle; //后向角
|
||
double corner; //拐角
|
||
double forwardDiffZ;
|
||
double backwardDiffZ;
|
||
double pre_stepDist;
|
||
double post_stepDist;
|
||
}SSG_pntDirAngle;
|