Skip to content
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

Fix a bug in OctreePointCloudAdjacency::computeNeighbors() #454

Closed

Conversation

taketwo
Copy link
Member

@taketwo taketwo commented Jan 19, 2014

The x, y, and z fields of OctreeKey are unsigned integers, so in some cases unsigned integer underflow occurs and the tree is queried for non-existing leaves with huge keys. Due to the way findLeaf() is implemented, such queries occasionally succeed and return some random leaves.

The `x`, `y`, and `z` fields of `OctreeKey` are unsigned integers, so
in some cases unsigned integer underflow occurs and the tree is queried
for non-existing leaves with huge keys. Due to the way `findLeaf()` is
implemented, such queries occasionally succeed and return some random
leaves.
@taketwo
Copy link
Member Author

taketwo commented Jan 19, 2014

It won't be correct to skip the iteration completely if, say, key_arg.x == 0, because then we'll miss neighbors with x == 1. What we care about is that key_arg.x + dx does not violate the bounds for key values, and it depends on both key_arg.x and dx.

By the way, I have another pull request related to OctreePointCloudAdjacency (#448). I know you are the author and hope you are fine with what I did.

@taketwo
Copy link
Member Author

taketwo commented Jan 20, 2014

Closing this pull request in favor of #455 which has additional optimization.

@taketwo taketwo closed this Jan 20, 2014
@jpapon
Copy link
Contributor

jpapon commented Jan 20, 2014

I don't think I did this in the proper way, because now we have two competing pull requests open.
Perhaps I should have just put the code here in a comment...

Anyway, what do you think of the version in my pull request?

@taketwo
Copy link
Member Author

taketwo commented Jan 20, 2014

@jpapon Actually I am not sure what is the standard workflow in such situations. Perhaps you cloud let me know about the commit that you want to add and I cherry-pick it from your fork to my branch that I am proposing for pull request.

@jpapon
Copy link
Contributor

jpapon commented Jan 20, 2014

Yeah, that would be better, I could have just put a link here to my branch, and you pull the commit into this request.
Oh well.

@taketwo taketwo deleted the fix-compute-neighbors branch January 21, 2014 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants