Skip to content

Commit 79008f4

Browse files
Fix uninitialized build warning (#6321)
* Fix uninitialized build warning * Fix review issue * Fix
1 parent c263786 commit 79008f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

recognition/include/pcl/recognition/impl/implicit_shape_model.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ pcl::features::ISMVoteList<PointT>::findStrongestPeaks (
171171
{
172172
// find best peak with taking into consideration peak flags
173173
double best_density = -1.0;
174-
Eigen::Vector3f strongest_peak;
174+
Eigen::Vector3f strongest_peak = Eigen::Vector3f::Constant (-1);
175175
int best_peak_ind (-1);
176176
int peak_counter (0);
177177
for (int i = 0; i < NUM_INIT_PTS; i++)
@@ -188,7 +188,8 @@ pcl::features::ISMVoteList<PointT>::findStrongestPeaks (
188188
}
189189
}
190190

191-
if( peak_counter == 0 )
191+
if( best_density == -1.0 || strongest_peak == Eigen::Vector3f::Constant (-1) ||
192+
best_peak_ind == -1 || peak_counter == 0 )
192193
break;// no peaks
193194

194195
pcl::ISMPeak peak;

0 commit comments

Comments
 (0)