Skip to content

Commit b85747b

Browse files
MatteGombiaLimHyungTae
authored andcommitted
fix: use fixed-size Eigen vectors for plane-fit members
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<MatrixX3f>) and the existing per-index accesses (e.g. singular_values_.minCoeff(), pc_mean_(0..2), normal_(0..2)). Co-authored-by: MatteGombia <matteogombia@gmail.com> Closes #62
1 parent eeeb6aa commit b85747b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cpp/patchworkpp/include/patchwork/patchworkpp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ class PatchWorkpp {
188188

189189
double d_;
190190

191-
Eigen::VectorXf normal_;
192-
Eigen::VectorXf singular_values_;
191+
Eigen::Vector3f normal_;
192+
Eigen::Vector3f singular_values_;
193193
Eigen::Matrix3f cov_;
194-
Eigen::VectorXf pc_mean_;
194+
Eigen::Vector3f pc_mean_;
195195

196196
vector<double> min_ranges_;
197197
vector<double> sector_sizes_;

0 commit comments

Comments
 (0)