From b85747bf87579c6e8737a54ed7d55efe90457383 Mon Sep 17 00:00:00 2001 From: MatteGombia Date: Sun, 10 May 2026 08:09:56 +0900 Subject: [PATCH] fix: use fixed-size Eigen vectors for plane-fit members MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit normal_, singular_values_, and pc_mean_ were declared as Eigen::VectorXf (dynamic-size). When a partial (non-360°) point cloud is processed — e.g. an OS1 128 Ouster pointcloud that doesn't start at azimuth 0 — the dynamic vectors are accessed at fixed indices before being sized, producing an immediate crash at startup. Switch all three to Eigen::Vector3f. Matches the SVD output (Vector3f from JacobiSVD) and the existing per-index accesses (e.g. singular_values_.minCoeff(), pc_mean_(0..2), normal_(0..2)). Co-authored-by: MatteGombia Closes #62 --- cpp/patchworkpp/include/patchwork/patchworkpp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/patchworkpp/include/patchwork/patchworkpp.h b/cpp/patchworkpp/include/patchwork/patchworkpp.h index 6d43161..852af80 100644 --- a/cpp/patchworkpp/include/patchwork/patchworkpp.h +++ b/cpp/patchworkpp/include/patchwork/patchworkpp.h @@ -188,10 +188,10 @@ class PatchWorkpp { double d_; - Eigen::VectorXf normal_; - Eigen::VectorXf singular_values_; + Eigen::Vector3f normal_; + Eigen::Vector3f singular_values_; Eigen::Matrix3f cov_; - Eigen::VectorXf pc_mean_; + Eigen::Vector3f pc_mean_; vector min_ranges_; vector sector_sizes_;