File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed
include/continuous_clustering/clustering Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 24
24
struct ContinuousRangeImageConfiguration
25
25
{
26
26
bool sensor_is_clockwise{true };
27
- int num_columns{1700 };
27
+ int num_columns{1700 }; // rows are automatically read from number of points in firing
28
28
bool supplement_inclination_angle_for_nan_cells{true };
29
29
};
30
30
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ ContinuousClustering::ContinuousClustering() = default;
11
11
void ContinuousClustering::reset (int num_rows, bool sequential_execution)
12
12
{
13
13
// recalculate some intermediate values in case the parameters have changed
14
- num_columns_ = config_.range_image .num_columns ; // TODO: also pass num columns as parameter here?
14
+ num_columns_ = config_.range_image .num_columns ;
15
15
num_rows_ = num_rows;
16
16
srig_azimuth_width_per_column = static_cast <float >((2 * M_PI)) / static_cast <float >(num_columns_);
17
17
ring_buffer_max_columns = num_columns_ * 10 ;
Original file line number Diff line number Diff line change @@ -107,14 +107,25 @@ class RosContinuousClustering
107
107
ros::Time stamp_current_firing;
108
108
stamp_current_firing.fromNSec (firing->stamp );
109
109
110
- // handle time jumps and bad start condition (TODO: put it into library?)
110
+ // handle time jumps and bad start condition
111
111
double dt = (stamp_current_firing - last_update_).toSec ();
112
- if (clustering_. resetRequired () || ( !first_firing_after_reset && std::abs (dt) > 0.1 ) )
112
+ if (!first_firing_after_reset)
113
113
{
114
- ROS_WARN_STREAM (" Detected jump in time ("
115
- << dt << " ) or bad start condition was encountered. Reset continuous clustering." );
116
- reset (static_cast <int >(firing->points .size ()));
117
- return ;
114
+ // resetting takes some time (often more than 0.1s) therefore we do not want to reset again when the
115
+ // first firing after reset arrives
116
+
117
+ if (clustering_.resetRequired ())
118
+ {
119
+ ROS_WARN_STREAM (" Detected reconfiguration or bad start condition. Reset continuous clustering." );
120
+ reset (static_cast <int >(firing->points .size ()));
121
+ return ;
122
+ }
123
+ else if (std::abs (dt) > 0.1 )
124
+ {
125
+ ROS_WARN_STREAM (" Detected jump in time (" << dt << " ). Reset continuous clustering." );
126
+ reset (static_cast <int >(firing->points .size ()));
127
+ return ;
128
+ }
118
129
}
119
130
first_firing_after_reset = false ;
120
131
last_update_ = stamp_current_firing;
You can’t perform that action at this time.
0 commit comments