Skip to content

Commit

Permalink
fix(map_based_prediction): use object_buffer_time_length_ (#6772)
Browse files Browse the repository at this point in the history
fix: use object_buffer_time_length_

Signed-off-by: Dmitrii Koldaev <[email protected]>
Co-authored-by: Dmitrii Koldaev <[email protected]>
  • Loading branch information
dkoldaev and Dmitrii Koldaev authored Apr 12, 2024
1 parent 453d41c commit 9f3633d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1360,15 +1360,15 @@ void MapBasedPredictionNode::removeOldObjectsHistory(
const double latest_object_time = rclcpp::Time(object_data.back().header.stamp).seconds();

// Delete Old Objects
if (current_time - latest_object_time > 2.0) {
if (current_time - latest_object_time > object_buffer_time_length_) {
invalid_object_id.push_back(object_id);
continue;
}

// Delete old information
while (!object_data.empty()) {
const double post_object_time = rclcpp::Time(object_data.front().header.stamp).seconds();
if (current_time - post_object_time > 2.0) {
if (current_time - post_object_time > object_buffer_time_length_) {
// Delete Old Position
object_data.pop_front();
} else {
Expand Down

0 comments on commit 9f3633d

Please sign in to comment.