Skip to content

Commit 9058baf

Browse files
fix rate ignore
1 parent 66549f3 commit 9058baf

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/extended_object_detection_node/eod_node.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,19 +181,15 @@ EOD_ROS::EOD_ROS(ros::NodeHandle nh, ros::NodeHandle nh_p){
181181
}
182182

183183

184-
bool EOD_ROS::check_time(const ros::Time& stamp, std::string frame_id){
185-
// if( frame_sequence == 0){
186-
// prev_detected_time[frame_id] = stamp;
187-
// return true;
188-
// }
189-
// return (stamp - prev_detected_time[frame_id]).toSec() > rate_limit_sec;
190-
184+
bool EOD_ROS::check_time(const ros::Time& stamp, std::string frame_id){
191185
if (stats.find(frame_id) == stats.end()){
192186
stats[frame_id] = StreamStats();
193187
stats[frame_id].detect_rate_values = new boost::circular_buffer<double>(stats_window);
194188
stats[frame_id].prev_detected_time = stamp;
195189
return true;
196190
}
191+
if( rate_limit_sec == 0 )
192+
return true;
197193
return (stamp - stats[frame_id].prev_detected_time).toSec() > rate_limit_sec;
198194
}
199195

0 commit comments

Comments
 (0)