hybridPosePositioning

version 1.3.2 : 添加了海瑞马锥形工件的ID号,ID号为输入的ROI下标+1(从1开始)
This commit is contained in:
jerryzeng 2026-08-03 10:39:05 +08:00
parent aa1f6a1f8b
commit 6bfb7cf4a4
3 changed files with 10 additions and 4 deletions

View File

@ -1917,7 +1917,7 @@ void HaiRuiMa_TaperedWorkpiece_test(void)
for (int fidx = fileIdx[grp].nMin; fidx <= fileIdx[grp].nMax; fidx++) for (int fidx = fileIdx[grp].nMin; fidx <= fileIdx[grp].nMax; fidx++)
{ {
//fidx =15; //fidx =3;
char _scan_file[256]; char _scan_file[256];
sprintf_s(_scan_file, "%s%d_cloud.txt", dataPath[grp], fidx); sprintf_s(_scan_file, "%s%d_cloud.txt", dataPath[grp], fidx);
std::vector<std::vector< SVzNLPositionD>> scanLines; std::vector<std::vector< SVzNLPositionD>> scanLines;
@ -1947,6 +1947,7 @@ void HaiRuiMa_TaperedWorkpiece_test(void)
printf("%s: %d(ms), 无产品!\n", _scan_file, (int)(t2 - t1)); printf("%s: %d(ms), 无产品!\n", _scan_file, (int)(t2 - t1));
else else
printf("%s: %d(ms), errCode=%d ...", _scan_file, (int)(t2 - t1), errCode); printf("%s: %d(ms), errCode=%d ...", _scan_file, (int)(t2 - t1), errCode);
//输出测试结果 //输出测试结果
sprintf_s(_scan_file, "%sresult/LaserLine%d_result.txt", dataPath[grp], fidx); sprintf_s(_scan_file, "%sresult/LaserLine%d_result.txt", dataPath[grp], fidx);
_outputRGBDResult_XYZUV_RGBD(_scan_file, scanLines, workpiecePositions); _outputRGBDResult_XYZUV_RGBD(_scan_file, scanLines, workpiecePositions);
@ -1962,6 +1963,8 @@ void HaiRuiMa_TaperedWorkpiece_test(void)
_genXOYProjectionImage(imgName, scanLines, displayScale, workpiecePositions, rpy, angleDrawLen); _genXOYProjectionImage(imgName, scanLines, displayScale, workpiecePositions, rpy, angleDrawLen);
#endif #endif
printf("done\n"); printf("done\n");
for (int i = 0; i < (int)workpiecePositions.size(); i++)
printf(" objID_%d: (%f, %f, %f)\n", workpiecePositions[i].id, (float)workpiecePositions[i].center.x, (float)workpiecePositions[i].center.y, (float)workpiecePositions[i].center.z);
} }
} }
} }
@ -2520,8 +2523,8 @@ typedef enum
int main() int main()
{ {
//ESG_testMode testMode = keSG_2D3D定位_海瑞马_地面调平; //ESG_testMode testMode = keSG_2D3D定位_海瑞马_地面调平;
//ESG_testMode testMode = keSG_2D3D定位_海瑞马_锥形工件; ESG_testMode testMode = keSG_2D3D定位_海瑞马_锥形工件;
ESG_testMode testMode = keSG_2D3D定位_海瑞马_转子芯; //ESG_testMode testMode = keSG_2D3D定位_海瑞马_转子芯;
//ESG_testMode testMode = keSG_2D3D定位_海瑞马_码垛料筐定位; //ESG_testMode testMode = keSG_2D3D定位_海瑞马_码垛料筐定位;
//ESG_testMode testMode = keSG_2D3D定位_海瑞马_码垛工件尺寸测量; //ESG_testMode testMode = keSG_2D3D定位_海瑞马_码垛工件尺寸测量;
//ESG_testMode testMode = keSG_2D3D定位_海瑞马_码垛位置规划; //ESG_testMode testMode = keSG_2D3D定位_海瑞马_码垛位置规划;

View File

@ -12,7 +12,8 @@
//version 1.2.0 : 添加了海瑞马锥形工件定位版本(不包含二次定位) //version 1.2.0 : 添加了海瑞马锥形工件定位版本(不包含二次定位)
//version 1.3.0 : 添加了海瑞马转子钢芯定位 //version 1.3.0 : 添加了海瑞马转子钢芯定位
//version 1.3.1 : 添加了海瑞马转子钢芯定位位置属性计算,区分出中央,边和角的位置,按照中心排序,先输出最中央的目标 //version 1.3.1 : 添加了海瑞马转子钢芯定位位置属性计算,区分出中央,边和角的位置,按照中心排序,先输出最中央的目标
std::string m_strVersion = "HybridPositioning 1.3.1"; //version 1.3.2 : 添加了海瑞马锥形工件的ID号ID号为输入的ROI下标+1从1开始
std::string m_strVersion = "HybridPositioning 1.3.2";
const char* wd_hybridPositioningVersion(void) const char* wd_hybridPositioningVersion(void)
{ {
return m_strVersion.c_str(); return m_strVersion.c_str();
@ -1532,6 +1533,7 @@ void wd_HRM_TaperedWorkpiecePositioning(
WD_workpieceInfo a_obj; WD_workpieceInfo a_obj;
memset(&a_obj, 0, sizeof(WD_workpieceInfo)); memset(&a_obj, 0, sizeof(WD_workpieceInfo));
a_obj.center = rgnPeaks[i].pt3D; a_obj.center = rgnPeaks[i].pt3D;
a_obj.id = rgnPeaks[i].nPointIdx + 1;
workpiecePositions.push_back(a_obj); workpiecePositions.push_back(a_obj);
} }
return; return;

View File

@ -14,6 +14,7 @@ typedef struct
typedef struct typedef struct
{ {
int id; //ÐòºÅ´Ó1¿ªÊ¼
int workpieceType; //0:中央; 1-上边; 2-下边; 3-左边; 4-右边; 5-左上角; 6-右上角; 7-左下角; 8-右下角; int workpieceType; //0:中央; 1-上边; 2-下边; 3-左边; 4-右边; 5-左上角; 6-右上角; 7-左下角; 8-右下角;
SVzNL3DPoint center; SVzNL3DPoint center;
SVzNL3DPoint z_dir; //z方向向量归一化 SVzNL3DPoint z_dir; //z方向向量归一化