@@ -701,11 +701,11 @@ void ContinuousClustering::traverseFieldOfView(Point& point,
701
701
{
702
702
// go left each column until azimuth angle difference gets too large
703
703
double min_possible_continuous_azimuth_angle = point.continuous_azimuth_angle - max_angle_diff;
704
- int num_steps_back = 0 ;
704
+ int required_steps_back = static_cast <int >(std::ceil (max_angle_diff / srig_azimuth_width_per_column));
705
+ required_steps_back = std::min (required_steps_back, config_.clustering .max_steps_in_row );
705
706
int64_t other_column_index = point.local_column_index ;
706
- while ( num_steps_back <= config_. clustering . max_steps_in_row )
707
+ for ( int num_steps_back = 0 ; num_steps_back <= required_steps_back; num_steps_back++ )
707
708
{
708
- bool at_least_one_point_of_this_column_in_azimuth_range = false ;
709
709
for (int direction = -1 ; direction <= 1 ; direction += 2 )
710
710
{
711
711
// do not go down in first column (these points are not associated to tree yet!)
@@ -728,33 +728,19 @@ void ContinuousClustering::traverseFieldOfView(Point& point,
728
728
if (std::abs (point_other.inclination_angle - point.inclination_angle ) > max_angle_diff)
729
729
break ;
730
730
731
- // if this point is still in azimuth range then also search one column before
732
- if (point_other.continuous_azimuth_angle >= min_possible_continuous_azimuth_angle)
733
- at_least_one_point_of_this_column_in_azimuth_range = true ;
734
- else
735
- {
736
- other_row_index += direction;
737
- num_steps_vertical++;
738
- continue ;
739
- }
740
-
741
- // if this point is ignored or has already the same tree root then do nothing (*1)
742
- if (point_other.is_ignored ||
743
- (point.tree_root_ .column_index >= 0 && point_other.tree_root_ == point.tree_root_ ))
731
+ // if other point is ignored or has already the same tree root then do nothing (*1)
732
+ if (!point_other.is_ignored &&
733
+ (point.tree_root_ .column_index == 0 || point_other.tree_root_ != point.tree_root_ ))
744
734
{
745
- other_row_index += direction;
746
- num_steps_vertical++;
747
- continue ;
748
- }
749
-
750
- // if distance is small enough then try to associate to tree
751
- if (checkClusteringCondition (point, point_other))
752
- {
753
- // check if point is already associated to any point tree
754
- if (point.tree_root_ .column_index == -1 )
755
- associatePointToPointTree (point, point_other, max_angle_diff);
756
- else
757
- associatePointTreeToPointTree (point, point_other);
735
+ // if distance is small enough then try to associate to tree
736
+ if (checkClusteringCondition (point, point_other))
737
+ {
738
+ // check if point is already associated to any point tree
739
+ if (point.tree_root_ .column_index == -1 )
740
+ associatePointToPointTree (point, point_other, max_angle_diff);
741
+ else
742
+ associatePointTreeToPointTree (point, point_other);
743
+ }
758
744
}
759
745
760
746
// stop searching if point was already associated and minimum number of columns were processed
@@ -772,16 +758,11 @@ void ContinuousClustering::traverseFieldOfView(Point& point,
772
758
num_steps_back >= config_.clustering .stop_after_association_min_steps )
773
759
break ;
774
760
775
- // stop searching in previous columns because in previous run all points were already out of angle range
776
- if (num_steps_back > 0 && !at_least_one_point_of_this_column_in_azimuth_range)
777
- break ;
778
-
779
761
// stop searching if we are at the beginning of the ring buffer
780
762
if (other_column_index == ring_buffer_first_local_column_index)
781
763
break ;
782
764
783
765
other_column_index--;
784
- num_steps_back++;
785
766
786
767
// jump to the end of the ring buffer
787
768
if (other_column_index < 0 )
0 commit comments