67 lines
1.8 KiB
C++
67 lines
1.8 KiB
C++
#pragma once
|
||
|
||
#if defined(SG_API_LIBRARY)
|
||
# define SG_APISHARED_EXPORT __declspec(dllexport)
|
||
#else
|
||
# define SG_APISHARED_EXPORT __declspec(dllimport)
|
||
#endif
|
||
|
||
#include "SG_baseDataType.h"
|
||
#include <vector>
|
||
|
||
typedef struct
|
||
{
|
||
double holeDiameter; //薄片两端孔直径
|
||
double holeDistance; //薄片两端孔距离
|
||
double sheetThickness; //薄片厚度
|
||
double centerBossHeight; //薄片中央凸起高度
|
||
}SWD_sheetTemplateParam;
|
||
|
||
typedef struct
|
||
{
|
||
SSG_outlierFilterParam filterParam;
|
||
SSG_cornerParam cornerParam;
|
||
SSG_treeGrowParam growParam;
|
||
}SWD_sheetAlgoParam;
|
||
|
||
|
||
typedef struct
|
||
{
|
||
SVzNL3DPoint refPos;
|
||
}SWD_gripState;
|
||
|
||
typedef struct
|
||
{
|
||
bool isUpDownDir; //从上到下为上下方向
|
||
bool isFrontSide; //中间凸起为正面
|
||
SSG_6DOF opCenter; //抓取中心位置
|
||
}SWD_sheetGrasper;
|
||
|
||
//读版本号
|
||
SG_APISHARED_EXPORT const char* wd_sheetPositionVersion(void);
|
||
|
||
//计算一个平面调平参数。
|
||
//数据输入中可以有一个地平面和参考调平平面,以最高的平面进行调平
|
||
//旋转矩阵为调平参数,即将平面法向调整为垂直向量的参数
|
||
SG_APISHARED_EXPORT SSG_planeCalibPara wd_sheetPosition_getBaseCalibPara(
|
||
std::vector< std::vector<SVzNL3DPosition>>& scanLines);
|
||
|
||
//相机姿态调平,并去除地面
|
||
SG_APISHARED_EXPORT void wd_sheetPosition_lineDataR(
|
||
std::vector< SVzNL3DPosition>& a_line,
|
||
const double* camPoseR,
|
||
double groundH);
|
||
|
||
///数据输入必须是grid格式,以进行水平方向和垂直方向的处理
|
||
//电机定子定位。
|
||
//算法逻辑:找到定子的高度->设置截取Z去掉底面->
|
||
// 投影(注意此时边框也同时投影)->距离变换->提取定子目标->
|
||
// 根据相邻和边框寻找最佳抓取目标和抓取点
|
||
SG_APISHARED_EXPORT void wd_YouJiang_getSheetPosition(
|
||
std::vector< std::vector<SVzNL3DPosition>>& scanLines,
|
||
const SWD_sheetTemplateParam statorParam,
|
||
const SSG_planeCalibPara groundCalibPara,
|
||
const SWD_sheetAlgoParam algoParam,
|
||
SWD_gripState* opState, //操作状态机。指示当前状态
|
||
int* errCode,
|
||
std::vector<SWD_sheetGrasper>& resultObjPositions); |