Skip to content

Commit

Permalink
handle non-finite laser readings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremie Deray committed Apr 18, 2018
1 parent e0598e8 commit ae01076
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CLaserOdometry2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ void CLaserOdometry2D::createImagePyramid()
//Inner pixels
if ((u>1)&&(u<cols_i-2))
{
if (dcenter > 0.f)
if (std::isfinite(dcenter) && dcenter > 0.f)
{
float sum = 0.f;
float weight = 0.f;
Expand All @@ -316,7 +316,7 @@ void CLaserOdometry2D::createImagePyramid()
//Boundary
else
{
if (dcenter > 0.f)
if (std::isfinite(dcenter) && dcenter > 0.f)
{
float sum = 0.f;
float weight = 0.f;
Expand Down

2 comments on commit ae01076

@wangrui449966
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@Areswangin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow it really works!Thanks!

Please sign in to comment.