Skip to content

Commit

Permalink
Rewrite a condition
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Mar 5, 2018
1 parent ad0c9bb commit 0c5b426
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/ndtpso_slam/ndtframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void NDTFrame::loadLaser(vector<float> const& laser_data, float const& min_angle
// For each element in the laser vector, get his index (i) and it's
// corresponding (theta)
// according to the sensibility and the minimum angle
for (unsigned int i = 0; i < n; /* += 3*/) {
for (unsigned int i = 0; i < n;) {
if ((laser_data[i] < max_range) && (laser_data[i] > LASER_IGNORE_EPSILON)) {
theta = INDEX_TO_ANGLE(i, angle_increment, min_angle);
Vector2d point = LASER_TO_POINT(laser_data[i], theta);
Expand All @@ -103,10 +103,7 @@ void NDTFrame::loadLaser(vector<float> const& laser_data, float const& min_angle
this->addPoint(point);
}

if ((i < 100) || (i > 660))
i += 5;
else
i++;
i += ((i < 140) || (i > 700)) ? 4 : 1;
}
}

Expand Down

0 comments on commit 0c5b426

Please sign in to comment.