Skip to content

Commit

Permalink
fix rate ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
MoscowskyAnton committed Mar 17, 2023
1 parent 66549f3 commit 9058baf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions src/extended_object_detection_node/eod_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,15 @@ EOD_ROS::EOD_ROS(ros::NodeHandle nh, ros::NodeHandle nh_p){
}


bool EOD_ROS::check_time(const ros::Time& stamp, std::string frame_id){
// if( frame_sequence == 0){
// prev_detected_time[frame_id] = stamp;
// return true;
// }
// return (stamp - prev_detected_time[frame_id]).toSec() > rate_limit_sec;

bool EOD_ROS::check_time(const ros::Time& stamp, std::string frame_id){
if (stats.find(frame_id) == stats.end()){
stats[frame_id] = StreamStats();
stats[frame_id].detect_rate_values = new boost::circular_buffer<double>(stats_window);
stats[frame_id].prev_detected_time = stamp;
return true;
}
if( rate_limit_sec == 0 )
return true;
return (stamp - stats[frame_id].prev_detected_time).toSec() > rate_limit_sec;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib

0 comments on commit 9058baf

Please sign in to comment.