-
Notifications
You must be signed in to change notification settings - Fork 320
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
Nacho/strip nn search from voxel hash map #290
Conversation
I'm alredy regreting about this
Overall, I like the draft! Make a lot more sense to me now to have a voxel hash map which is just a voxel hash map caring about the closest point given a query. |
I'm still wondering if What's your view on this? I'm asking since the |
I like it like this. The underlying map representation needs to provide a way to query for the closest neighbor. The way we do it is a specific realization by checking the neighboring voxels, which is an approximation of finding the closest neighbor. You might also want to provide a map that finds the actual closest neighbor (which can be further away) or a map that does an even faster nearest neighbor search by using another data structure or by approximating further, checking for example only the same voxel. Since the implementation of this query is specific to the map, I think it should be a member function of the map class. But I am happy to hear other views :) |
Hi both, I slowly passing through each file, and I found some further ways of simplifying code. For now I have been working on the
I still want to go to the rest properly but for now I wanted to show you this changes and see. <3 |
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.
I am not super convinced about moving the GetCorrespondences
outside of theVoxelHashMap
. Also exposing a function that query for a single point is not so nice/useful for the user if he wants to use this map for something else (if we search for more than one point we need to rewrite the all for loop).
Otherwise too much mix a match on my opinion
This reverts commit 7a45c9d.
Requested by benedikt
@tizianoGuadagnino @benemer I wrote a README on this PR, please go over it on this 2nd type of iteration. I'm in favor of moving TechDebt stuff out of the PR (got huge) to move forward |
I think we can move forward for now, me and @benemer are not super happy with |
Amazing guys! Thanks, I have a quick fix for AdjacentVoxels thing that I'm sure you will like |
Refactor Registration Module and VoxelHashMap to allow for better configurable system
Supporting #252, this PR addresses the following:
1. Make Registration Module a class
To make the registration system "configurable" I wrapped the only function into a single class, that has (for now) just two parameters. The rest remains the same (from a logical point of view). I also changed names accordingly
Following the idea of #252,
max_num_threads
would be a registration configuration2. Refactor
VoxelHashMap
, extract NN search from map representationI extracted the NN search from the internal map representation, removing the responsibility of the map representation of providing the NN search. Instead I exposed two new functions that can be used for "other things", and thus, are a bit more generic:
VoxelHashMap::GetAdjacentVoxel: Giving a point, spits the adjacent voxels in voxel space. This can be used independently of NN search or not. Additionally, I added a (default to 1) parameter to express the intention of that floating number we had in the code
VoxelHashMap::GetPoints(const std::vector &query_voxels) const; Given some voxels, it doesn't need to be adjacent or not, extract the the (if existing) points inside those voxels.
Using those two voxel hash member functions, we can now build this utility function that performs the NN search independently of the map representation and it's easier to read in general:
Our approach for NN search is much clearer now, and responsibilities are properly spread among the system modules. I could rewrite the few lines of
GetClosestNeighbor
and test a completely different strategy3. New configuration exposed
Now, we can control OPTIONALLY, and DISABLED BY DEFAULT TO CHANGE these params from the registration,
config/advanced.yaml
:the
max_num_threads
will come after #2524. Additional Stuff by @tizianoGuadagnino
There was a bit of refactoring happening here, that is not associated with the changes of the PR but I don't have time to rebase new branches on top of this, namely:
Rest
The rest of the changes are just refactoring changes. We can now control the entire TBB pipeline in the
Registration
module, which is super nice for me :)Bonus
From a system point of view, it's nice that we now have this design:
// KISS-ICP pipeline modules Registration registration_; VoxelHashMap local_map_; AdaptiveThreshold adaptive_threshold_;
Makes me wonder if we shouldn't merge
Deskew
intoPreprocessing
and convert it to another component as well 👀 , similar to how we do it in Python 🤔 , but to be discussed later