-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nosille small bug fix #1412
Nosille small bug fix #1412
Conversation
corelib/src/LocalGridMaker.cpp
Outdated
bool normalSegmentationTmp = normalsSegmentation_; | ||
float minGroundHeightTmp = minGroundHeight_; | ||
float maxGroundHeightTmp = maxGroundHeight_; | ||
if(scan.is2d()) | ||
{ | ||
// if 2D, assume the whole scan is obstacle | ||
normalsSegmentation_ = false; | ||
minGroundHeight_ = std::numeric_limits<int>::min(); | ||
maxGroundHeight_ = std::numeric_limits<int>::min()+100; | ||
} | ||
|
||
createLocalMap(scan, node.getPose(), groundCells, obstacleCells, emptyCells, viewPoint); | ||
|
||
if(scan.is2d()) | ||
{ | ||
// restore | ||
normalsSegmentation_ = normalSegmentationTmp; | ||
minGroundHeight_ = minGroundHeightTmp; | ||
maxGroundHeight_ = maxGroundHeightTmp; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done in a special case when we combine 2D lidar data and 3D depth data into the local grid. Is it really never called even in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It grabbed my attention because of multiple checks for is2d() and occupancy == 0. However, after a second look, you are correct that occupancy == 2 could still get there.
My bad.
@@ -3530,7 +3530,7 @@ LaserScan adjustNormalsToViewPoint( | |||
|
|||
float result = v.dot(n); | |||
if(result < 0 | |||
|| (groundNormalsUp>0.0f && ptr[nz] < -groundNormalsUp && ptr[2] < viewpoint[3])) // some far velodyne rays on road can have normals toward ground |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
viewpoint is an Eigen::Vector3f object, with indexes 0=x, 1=y and 2=z. 3 would be out of bounds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After, sending this I dug a little deeper and noted that there are several other places in the code where viewpoint[3] is used. The difference is that in those cases the vector is an Eigen::Vector4f, so it doesn't crash like this did. However, it seems to me that viewpoint[2] is likely the intended array value in those cases as well. Do you agree? Or am a missing something? It seems like a simple comparison between point.z and viewpoint.z, but I guess you could be doing something I am not following with the 4th value in the homogeneous coordinates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment, the other places using viewpoint[3] are wrong. Here the ones I've found:
https://github.com/search?q=repo%3Aintrolab%2Frtabmap%20viewpoint%5B3%5D&type=code
I created an issue about it #1413
5e6d9b9
to
3e0d4c2
Compare
I stumbled across a small indexing bug in adjustNormalsToViewPoint. I also noted a piece of unreachable code in LocalGridMaker.