Skip to content

Commit 06ef808

Browse files
Saurav AgarwalSaurav Agarwal
authored andcommitted
CheckOscillation improvement
1 parent afcd31c commit 06ef808

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cppsrc/core/include/CoverageControl/coverage_system.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,12 @@ class CoverageSystem {
330330
if (params_.pCheckOscillations == false) {
331331
return false;
332332
}
333-
if (robot_positions_history_[robot_id].size() < 2) {
333+
if (robot_positions_history_[robot_id].size() < 3) {
334334
return false;
335335
}
336336
auto const &history = robot_positions_history_[robot_id];
337337
Point2 const last_pos = history.back();
338-
auto it_end = std::next(history.crbegin(),
339-
std::max(6, static_cast<int>(history.size()) - 1));
338+
auto it_end = std::next(history.crbegin(), static_cast<int>(history.size()) - 1);
340339
bool flag = false;
341340
int count = 0;
342341
std::for_each(history.crbegin(), it_end,

0 commit comments

Comments
 (0)