File tree 1 file changed +8
-9
lines changed
control/autonomous_emergency_braking/include/autonomous_emergency_braking
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -142,13 +142,14 @@ class CollisionDataKeeper
142
142
{
143
143
// remove old msg from deque
144
144
const auto now = clock_->now ();
145
- std::remove_if (
146
- obstacle_velocity_history_.begin (), obstacle_velocity_history_.end (),
147
- [&](const auto & velocity_time_pair) {
148
- const auto & vel_time = velocity_time_pair.second ;
149
- return ((now - vel_time).nanoseconds () * 1e-9 > previous_obstacle_keep_time_);
150
- });
151
-
145
+ obstacle_velocity_history_.erase (
146
+ std::remove_if (
147
+ obstacle_velocity_history_.begin (), obstacle_velocity_history_.end (),
148
+ [&](const auto & velocity_time_pair) {
149
+ const auto & vel_time = velocity_time_pair.second ;
150
+ return ((now - vel_time).nanoseconds () * 1e-9 > previous_obstacle_keep_time_);
151
+ }),
152
+ obstacle_velocity_history_.end ());
152
153
obstacle_velocity_history_.emplace_back (
153
154
std::make_pair (current_object_velocity, current_object_velocity_time_stamp));
154
155
}
@@ -204,8 +205,6 @@ class CollisionDataKeeper
204
205
});
205
206
206
207
if (!estimated_velocity_opt.has_value ()) {
207
- this ->setPreviousObjectData (closest_object);
208
- this ->resetVelocityHistory ();
209
208
return std::nullopt;
210
209
}
211
210
You can’t perform that action at this time.
0 commit comments