Feature/export pose csv - #186
Conversation
…_history_pose_errors()
…d CAD segmentation step
|
ok this seems in order, a dry-run will be done at release branch level |
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed runtime/behavioral bugs (missing import, potential None handling crash, output list misalignment, and incorrect CSV “nan” emission for valid 0.0 values) that should be fixed before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends the Grasshopper-based pose pipeline to (a) propagate optional ICP-derived poses through segmentation → pose estimation, and (b) expose richer pose-comparison results that can be exported as CSV (including per-step pose error histories). It also includes a handful of geometry/segmentation robustness tweaks in the C++ core.
Changes:
- Add pose conversion/comparison helpers and assembly pose-history loading utilities, plus a new
DFPoseResultscontainer for pose error histories. - Wire new GH inputs/outputs to pass ICP-detected poses into pose estimation and return a
DFPoseResultsobject from pose comparison. - Update CSV exporter to emit pose error history CSV; adjust C++ segmentation/mesh routines for safer behavior.
File summaries
| File | Description |
|---|---|
| src/gh/diffCheck/diffCheck/df_poses.py | Adds plane→pose conversion, pose comparison, and GH tree → pose-history loading. |
| src/gh/diffCheck/diffCheck/df_geometries.py | Compacts meshes after building (memory/layout change). |
| src/gh/diffCheck/diffCheck/df_error_estimation.py | Introduces DFPoseResults to compute per-element pose error histories. |
| src/gh/components/DF_pose_estimation/metadata.json | Adds optional i_poses_from_icp input metadata. |
| src/gh/components/DF_pose_estimation/code.py | Uses optional ICP poses to bypass per-cloud pose recomputation. |
| src/gh/components/DF_pose_comparison/metadata.json | Adds o_result output for detailed pose comparison results. |
| src/gh/components/DF_pose_comparison/code.py | Constructs and returns DFPoseResults alongside existing outputs. |
| src/gh/components/DF_csv_exporter/code.py | Adds support for exporting DFPoseResults into a pose CSV. |
| src/gh/components/DF_CAD_segmentator/metadata.json | Adds o_poses_from_icp output metadata. |
| src/gh/components/DF_CAD_segmentator/code.py | Outputs ICP-derived beam poses alongside segmentation outputs. |
| src/gh/components/DF_build_assembly/metadata.json | Fixes output description wording. |
| src/diffCheck/segmentation/DFSegmentation.cc | Refactors point removal logic and changes association computations. |
| src/diffCheck/geometry/DFPointCloud.hh | Updates tight bounding box documentation. |
| src/diffCheck/geometry/DFPointCloud.cc | Adjusts normal-flip thresholds and returns 8-corner OBB points. |
| src/diffCheck/geometry/DFMesh.cc | Adds degenerate-triangle handling and revises point-in-face tolerance checks. |
Review details
Suppressed comments (1)
src/gh/components/DF_csv_exporter/code.py:209
- Same issue for rotation history:
if data:will convert a valid0.0to "nan". Useis not Noneinstead.
for data in assembly_rot_err_hist[i]:
if data:
rot_err_list.append(float(data))
else:
rot_err_list.append("nan")
- Files reviewed: 15/15 changed files
- Comments generated: 8
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| for (auto normal : segment->Normals){segmentNormal += normal;} | ||
| segmentNormal.normalize(); | ||
| double currentDistance = (faceCenter - segmentCenter).norm(); | ||
| double currentDitanceOrthogonalToFace = std::abs((faceCenter - segmentCenter).dot(faceNormal)); | ||
| double currentAngle = std::abs(sin(acos(faceNormal.dot(faceCenter - segmentCenter)))); | ||
| if (std::abs(sin(acos(faceNormal.dot(segmentNormal)))) < angleThreshold |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…kOrg/diffCheck into feature/export_pose_csv
as in title...
We now get a csv like this;