From 43faaa9fd914e6cd2b05196d465a77aace924bfa Mon Sep 17 00:00:00 2001 From: jerryzeng Date: Mon, 13 Apr 2026 17:01:59 +0800 Subject: [PATCH] =?UTF-8?q?wheelArchHeigthMeasure=20version=201.3.4=20:=20?= =?UTF-8?q?=E8=BD=AE=E7=9C=89=E5=88=B0=E8=BD=AE=E5=BF=83=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=96=B9=E6=B3=95=E8=BF=9B=E8=A1=8C=E4=BA=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=8C=E7=94=B1Y=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E5=B7=AE=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=B8=A4=E7=82=B9=E8=B7=9D?= =?UTF-8?q?=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sourceCode/wheelArchHeigthMeasure.cpp | 5 +++-- .../wheelArchHeigthMeasure_test.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sourceCode/wheelArchHeigthMeasure.cpp b/sourceCode/wheelArchHeigthMeasure.cpp index 6d3d3fc..296c0fc 100644 --- a/sourceCode/wheelArchHeigthMeasure.cpp +++ b/sourceCode/wheelArchHeigthMeasure.cpp @@ -12,7 +12,8 @@ //version 1.3.1 : 添加了一个检测轮毂是否存在的函数 //version 1.3.2 : 针对不理想点云改进了算法,增强鲁棒性 //version 1.3.3 : 轮眉点的提取进行了改进,修正了可能的取点错误 -std::string m_strVersion = "1.3.3"; +//version 1.3.4 : 轮眉到轮心高度计算方法进行了修正,由Y高度差修改为两点距离 +std::string m_strVersion = "1.3.4"; const char* wd_wheelArchHeigthMeasureVersion(void) { return m_strVersion.c_str(); @@ -966,7 +967,7 @@ WD_wheelArchInfo wd_wheelArchHeigthMeasure( } result.centerLine[0] = { downWheelPt.x - outLineLen, centerY, scanLines[searchLine][minPtIdx].pt3D.z }; result.centerLine[1] = { downWheelPt.x + outLineLen, centerY, scanLines[searchLine][minPtIdx].pt3D.z }; - result.archToCenterHeigth = centerY - arcPt.y; + result.archToCenterHeigth = sqrt(pow(centerY - arcPt.y, 2) + pow(scanLines[searchLine][minPtIdx].pt3D.z - arcPt.z, 2)); // centerY - arcPt.y; result.archToGroundHeigth = groundCalibPara.planeHeight - arcPt.y; //将数据重新投射回原来的坐标系,以保持手眼标定结果正确 for (int i = 0; i < lineNum; i++) diff --git a/wheelArchHeigthMeasure_test/wheelArchHeigthMeasure_test.cpp b/wheelArchHeigthMeasure_test/wheelArchHeigthMeasure_test.cpp index f1f911f..90b627e 100644 --- a/wheelArchHeigthMeasure_test/wheelArchHeigthMeasure_test.cpp +++ b/wheelArchHeigthMeasure_test/wheelArchHeigthMeasure_test.cpp @@ -2725,7 +2725,7 @@ int main() }; SVzNLRange fileIdx[TEST_GROUP] = { - {1,2}, {1,4}, {1,7}, {1,7}, {1,7},{1,7} + {1,2}, {1,4}, {8,9}, {8,9}, {8,9},{9,9} }; SSG_planeCalibPara poseCalibPara; @@ -2739,7 +2739,7 @@ int main() poseCalibPara.planeCalib[6] = 0.0; poseCalibPara.planeCalib[7] = 0.0; poseCalibPara.planeCalib[8] = 1.0; - poseCalibPara.planeHeight = -1.0; + poseCalibPara.planeHeight = 500.0; for (int i = 0; i < 9; i++) poseCalibPara.invRMatrix[i] = poseCalibPara.planeCalib[i]; @@ -2749,7 +2749,7 @@ int main() char _scan_file[256]; int endGroup = TEST_GROUP - 1; - for (int grp = 2; grp <= endGroup; grp++) + for (int grp = 5; grp <= endGroup; grp++) { char calibFile[250]; sprintf_s(calibFile, "%sground_calib_para.txt", dataPath[grp]); @@ -2834,7 +2834,7 @@ int main() sprintf_s(_dbg_file, "%sresult\\LaserLine%d_result.txt", dataPath[grp], fidx); _outputScanDataFile_RGBD_obj(_dbg_file, scanData, 0, 0, 0, wheelArcHeight); #endif - printf("%s: height=%f, arcToGrund=%f, time=%d(ms)!\n", _scan_file, wheelArcHeight.archToCenterHeigth, wheelArcHeight.archToGroundHeigth, (int)(t2 - t1)); + printf("%s: arcY=%f, height=%f, arcToGrund=%f, time=%d(ms)!\n", _scan_file, wheelArcHeight.wheelArchPos.y, wheelArcHeight.archToCenterHeigth, wheelArcHeight.archToGroundHeigth, (int)(t2 - t1)); } else {