diff --git a/App/RodWeldSeam/Doc/vision_modbus_client.mthings b/App/RodWeldSeam/Doc/vision_modbus_client.mthings index 5b928aa1..dd88fb41 100644 --- a/App/RodWeldSeam/Doc/vision_modbus_client.mthings +++ b/App/RodWeldSeam/Doc/vision_modbus_client.mthings @@ -4,7 +4,8 @@ - + + diff --git a/App/RodWeldSeam/RodWeldSeamApp/Presenter/Src/DetectPresenter.cpp b/App/RodWeldSeam/RodWeldSeamApp/Presenter/Src/DetectPresenter.cpp index f09494c2..df5df997 100644 --- a/App/RodWeldSeam/RodWeldSeamApp/Presenter/Src/DetectPresenter.cpp +++ b/App/RodWeldSeam/RodWeldSeamApp/Presenter/Src/DetectPresenter.cpp @@ -177,6 +177,35 @@ int DetectPresenter::DetectWeldSeam( LOG_INFO("[Algo Thread] WeldSeam %zu Input X seed: [%.6f, %.6f, %.6f]\n", i, seam.axialDir.x, seam.axialDir.y, seam.axialDir.z); LOG_INFO("[Algo Thread] WeldSeam %zu Input Z seed: [%.6f, %.6f, %.6f]\n", i, seam.normalDir.x, seam.normalDir.y, seam.normalDir.z); + HECPoint3D robotCenter; + HECPoint3D robotStartPt; + HECPoint3D robotEndPt; + HECPoint3D robotAxialDir; + HECPoint3D robotNormalDir; + handEyeCalib->TransformPoint( + calibResult.R, + calibResult.T, + HECPoint3D(seam.center.x, seam.center.y, seam.center.z), + robotCenter); + handEyeCalib->TransformPoint( + calibResult.R, + calibResult.T, + HECPoint3D(seam.startPt.x, seam.startPt.y, seam.startPt.z), + robotStartPt); + handEyeCalib->TransformPoint( + calibResult.R, + calibResult.T, + HECPoint3D(seam.endPt.x, seam.endPt.y, seam.endPt.z), + robotEndPt); + handEyeCalib->RotatePoint( + calibResult.R, + HECPoint3D(seam.axialDir.x, seam.axialDir.y, seam.axialDir.z), + robotAxialDir); + handEyeCalib->RotatePoint( + calibResult.R, + HECPoint3D(seam.normalDir.x, seam.normalDir.y, seam.normalDir.z), + robotNormalDir); + HECPoseResult poseResult; bool validPose = handEyeCalib->TransformPose( calibResult, @@ -199,30 +228,30 @@ int DetectPresenter::DetectWeldSeam( pos.roll = rollDeg; pos.pitch = pitchDeg; pos.yaw = yawDeg; - pos.x = poseResult.position.x; - pos.y = poseResult.position.y; - pos.z = poseResult.position.z; + pos.x = robotCenter.x; + pos.y = robotCenter.y; + pos.z = robotCenter.z; detectionResult.positions.push_back(pos); // 保存焊缝信息 WeldSeamInfo info; info.weldType = static_cast(seam.weldType); - info.centerX = poseResult.position.x; - info.centerY = poseResult.position.y; - info.centerZ = poseResult.position.z; - info.axialDirX = seam.axialDir.x; - info.axialDirY = seam.axialDir.y; - info.axialDirZ = seam.axialDir.z; - info.normalDirX = seam.normalDir.x; - info.normalDirY = seam.normalDir.y; - info.normalDirZ = seam.normalDir.z; - info.startPtX = seam.startPt.x; - info.startPtY = seam.startPt.y; - info.startPtZ = seam.startPt.z; - info.endPtX = seam.endPt.x; - info.endPtY = seam.endPt.y; - info.endPtZ = seam.endPt.z; + info.centerX = robotCenter.x; + info.centerY = robotCenter.y; + info.centerZ = robotCenter.z; + info.axialDirX = robotAxialDir.x; + info.axialDirY = robotAxialDir.y; + info.axialDirZ = robotAxialDir.z; + info.normalDirX = robotNormalDir.x; + info.normalDirY = robotNormalDir.y; + info.normalDirZ = robotNormalDir.z; + info.startPtX = robotStartPt.x; + info.startPtY = robotStartPt.y; + info.startPtZ = robotStartPt.z; + info.endPtX = robotEndPt.x; + info.endPtY = robotEndPt.y; + info.endPtZ = robotEndPt.z; // 复制焊缝中心线点和边缘点 for (const auto& cp : seam.centerPts) { diff --git a/App/RodWeldSeam/RodWeldSeamApp/Version.h b/App/RodWeldSeam/RodWeldSeamApp/Version.h index ef7a3b23..6ab94ff5 100644 --- a/App/RodWeldSeam/RodWeldSeamApp/Version.h +++ b/App/RodWeldSeam/RodWeldSeamApp/Version.h @@ -6,7 +6,7 @@ #define RODWELDSEAM_APP_NAME "钢筋焊缝定位" #define RODWELDSEAM_VERSION_STRING "1.0.0" -#define RODWELDSEAM_BUILD_STRING "1" +#define RODWELDSEAM_BUILD_STRING "2" #define RODWELDSEAM_FULL_VERSION_STRING "V" RODWELDSEAM_VERSION_STRING "_" RODWELDSEAM_BUILD_STRING // 获取版本信息的便捷函数 diff --git a/App/RodWeldSeam/RodWeldSeamApp/Version.md b/App/RodWeldSeam/RodWeldSeamApp/Version.md index 45ba77da..1e1ec468 100644 --- a/App/RodWeldSeam/RodWeldSeamApp/Version.md +++ b/App/RodWeldSeam/RodWeldSeamApp/Version.md @@ -1,4 +1,8 @@ -# 1.0.0 2026-05-13 -## build_1 +# 1.0.0 + +## build_2 +1. 修复手眼转换没有转起止点的问题 + +## build_1 2026-05-13 1. 初始版本 - 从RodAndBarPosition复制并改编为钢筋焊缝定位 diff --git a/GrabBagPrj/AppList.md b/GrabBagPrj/AppList.md index b28776bb..8d65e6e6 100644 --- a/GrabBagPrj/AppList.md +++ b/GrabBagPrj/AppList.md @@ -20,7 +20,7 @@ | 14 | 工件孔定位 | WorkpieceHole | 1.2.2.2 | | 15 | 轮胎孔定位 | TireHolePose | 1.0.2.1 | | 16 | 坑孔定位 | HolePitPosition | 无 | -| 17 | 钢筋焊缝定位 | RodWeldSeam | 1.0.0.1 | +| 17 | 钢筋焊缝定位 | RodWeldSeam | 1.0.0.2 | | 18 | 无人机螺杆检测服务端 | DroneScrewServer | 1.0.1.1 | | 19 | 无人机螺杆检测控制端 | DroneScrewCtrlApp | 1.0.1.1 | | 20 | 砂轮盘孔定位 | DiscHolePose | 1.0.0.1 |