Skip to content

Feature/export pose csv - #186

Open
DamienGilliard wants to merge 27 commits into
fix/plane_detection_and_joint_detectionfrom
feature/export_pose_csv
Open

Feature/export pose csv#186
DamienGilliard wants to merge 27 commits into
fix/plane_detection_and_joint_detectionfrom
feature/export_pose_csv

Conversation

@DamienGilliard

@DamienGilliard DamienGilliard commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

as in title...
We now get a csv like this;

element_name,last_distance_error,last_rotation_error,assembly_distance_error_history,assembly_rotation_error_history
element_0,8.961086961923149,0.02602177851709342,"[11.309725185367839, 20.27738773551104, 4.724746914893921, 8.961086961923149, 11.309725185367839, 20.27738773551104, 11.309725185367839, 20.27738773551104, 4.724746914893921, 8.961086961923149]","[0.01093847959472805, 3.133615720530505, 0.01481437577606429, 0.02602177851709342, 0.01093847959472805, 3.133615720530505, 0.01093847959472805, 3.133615720530505, 0.01481437577606429, 0.02602177851709342]"
element_1,9.376139657261568,3.1414515868111588,"[11.66958607781892, 8.667953914357172, 6.2755594528383964, 9.376139657261568, 11.66958607781892, 8.667953914357172, 11.66958607781892, 8.667953914357172, 6.2755594528383964, 9.376139657261568]","[3.119223313449779, 3.124459870897503, 3.1334896615458327, 3.1414515868111588, 3.119223313449779, 3.124459870897503, 3.119223313449779, 3.124459870897503, 3.1334896615458327, 3.1414515868111588]"
element_2,9.277335622981683,3.1342638278468167,"[12.766046352559181, 12.62204589644718, 7.923480229221216, 9.277335622981683, 12.766046352559181, 12.62204589644718, 12.766046352559181, 12.62204589644718, 7.923480229221216, 9.277335622981683]","[3.126306253892142, 0.013542521509236316, 0.00815990298572298, 3.1342638278468167, 3.126306253892142, 0.013542521509236316, 3.126306253892142, 0.013542521509236316, 0.00815990298572298, 3.1342638278468167]"
element_3,5.7951795686937695,3.1372163688812003,"[7.938961570202289, 9.927059605725931, 7.615987088464097, 5.7951795686937695, 7.938961570202289, 9.927059605725931, 7.938961570202289, 9.927059605725931, 7.615987088464097, 5.7951795686937695]","[0.04689194370290938, 3.125306390251714, 3.139900172027968, 3.1372163688812003, 0.04689194370290938, 3.125306390251714, 0.04689194370290938, 3.125306390251714, 3.139900172027968, 3.1372163688812003]"
element_4,9.683065707276816,0.25503407947806667,"[10.857243133556423, 12.380907943277562, 8.050391249349643, 9.683065707276816, 10.857243133556423, 12.380907943277562, 10.857243133556423, 12.380907943277562, 8.050391249349643, 9.683065707276816]","[3.12674882727089, 0.022677574735963123, 0.005604258787190536, 0.25503407947806667, 3.12674882727089, 0.022677574735963123, 3.12674882727089, 0.022677574735963123, 0.005604258787190536, 0.25503407947806667]"
element_5,7.332058990955398,3.1388905736943786,"[8.547331607650714, 18.112049489653458, 10.988080015307055, 7.332058990955398, 8.547331607650714, 18.112049489653458, 8.547331607650714, 18.112049489653458, 10.988080015307055, 7.332058990955398]","[3.130111217840457, 0.01682018767923155, 0.04180366546135042, 3.1388905736943786, 3.130111217840457, 0.01682018767923155, 3.130111217840457, 0.01682018767923155, 0.04180366546135042, 3.1388905736943786]"
element_6,1.6631186986822386,3.1354164057171374,"['nan', 14.71087107564805, 3.500589770440297, 1.6631186986822386, 'nan', 14.71087107564805, 'nan', 14.71087107564805, 3.500589770440297, 1.6631186986822386]","['nan', 3.125667454144361, 0.013652246103302845, 3.1354164057171374, 'nan', 3.125667454144361, 'nan', 3.125667454144361, 0.013652246103302845, 3.1354164057171374]"
element_7,3.9773906623646864,3.1356945686712208,"['nan', 11.703229625333009, 6.7364804930403235, 3.9773906623646864, 'nan', 11.703229625333009, 'nan', 11.703229625333009, 6.7364804930403235, 3.9773906623646864]","['nan', 3.1198890617328776, 3.1378754706047864, 3.1356945686712208, 'nan', 3.1198890617328776, 'nan', 3.1198890617328776, 3.1378754706047864, 3.1356945686712208]"
element_8,9.472044098471464,3.1367011630257893,"['nan', 12.153008235411894, 11.332937630311658, 9.472044098471464, 'nan', 12.153008235411894, 'nan', 12.153008235411894, 11.332937630311658, 9.472044098471464]","['nan', 0.030309700688927455, 0.011405500246244609, 3.1367011630257893, 'nan', 0.030309700688927455, 'nan', 0.030309700688927455, 0.011405500246244609, 3.1367011630257893]"
element_9,5.703017266114312,3.138371063118106,"['nan', 'nan', 5.470380653880494, 5.703017266114312, 'nan', 'nan', 5.470380653880494, 5.703017266114312]","['nan', 'nan', 3.135021182841929, 3.138371063118106, 'nan', 'nan', 3.135021182841929, 3.138371063118106]"
element_10,10.493598182407174,0.006940500608453944,"['nan', 'nan', 6.782170520232147, 10.493598182407174, 'nan', 'nan', 6.782170520232147, 10.493598182407174]","['nan', 'nan', 3.140674867832458, 0.006940500608453944, 'nan', 'nan', 3.140674867832458, 0.006940500608453944]"
element_11,13.26809813702047,0.005313510656417387,"['nan', 'nan', 8.949996672907108, 13.26809813702047, 'nan', 'nan', 8.949996672907108, 13.26809813702047]","['nan', 'nan', 0.009038669856394834, 0.005313510656417387, 'nan', 'nan', 0.009038669856394834, 0.005313510656417387]"
element_12,7.462441610829356,3.1378580433238406,"['nan', 'nan', 'nan', 7.462441610829356, 'nan', 'nan', 'nan', 7.462441610829356]","['nan', 'nan', 'nan', 3.1378580433238406, 'nan', 'nan', 'nan', 3.1378580433238406]"
element_13,1.9392363608598053,0.010604597686172786,"['nan', 'nan', 'nan', 1.9392363608598053, 'nan', 'nan', 'nan', 1.9392363608598053]","['nan', 'nan', 'nan', 0.010604597686172786, 'nan', 'nan', 'nan', 0.010604597686172786]"
element_14,9.02780285920448,0.003004385192847451,"['nan', 'nan', 'nan', 9.02780285920448, 'nan', 'nan', 'nan', 9.02780285920448]","['nan', 'nan', 'nan', 0.003004385192847451, 'nan', 'nan', 'nan', 0.003004385192847451]"

@DamienGilliard
DamienGilliard marked this pull request as draft March 18, 2026 21:32
@DamienGilliard
DamienGilliard changed the base branch from main to fix/plane_detection_and_joint_detection March 18, 2026 21:34
@DamienGilliard DamienGilliard self-assigned this Mar 18, 2026
@DamienGilliard DamienGilliard added the enhancement New feature or request label Mar 18, 2026
@DamienGilliard
DamienGilliard marked this pull request as ready for review September 7, 2026 15:12
@DamienGilliard

Copy link
Copy Markdown
Collaborator Author

ok this seems in order, a dry-run will be done at release branch level

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 DFPoseResults container for pose error histories.
  • Wire new GH inputs/outputs to pass ICP-detected poses into pose estimation and return a DFPoseResults object 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 valid 0.0 to "nan". Use is not None instead.
                    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.

Comment thread src/gh/components/DF_CAD_segmentator/code.py Outdated
Comment thread src/gh/components/DF_pose_comparison/code.py Outdated
Comment on lines 267 to 270
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
Comment thread src/gh/components/DF_csv_exporter/code.py
Comment thread src/gh/components/DF_pose_estimation/code.py Outdated
Comment thread src/gh/diffCheck/diffCheck/df_error_estimation.py Outdated
Comment thread src/diffCheck/geometry/DFMesh.cc Outdated
Comment thread src/gh/components/DF_CAD_segmentator/metadata.json Outdated
DamienGilliard and others added 2 commits September 7, 2026 17:29
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>
DamienGilliard and others added 7 commits September 7, 2026 17:32
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adapt i/o_results to allow pose data, and update export results to save data as CSV

2 participants