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

Laser to PCL conversion #9

Open
abylikhsanov opened this issue Sep 20, 2019 · 1 comment
Open

Laser to PCL conversion #9

abylikhsanov opened this issue Sep 20, 2019 · 1 comment

Comments

@abylikhsanov
Copy link

abylikhsanov commented Sep 20, 2019

Hi Carlos,

Sorry for asking so many questions but I just find your library fascinating and I am learning and reading your code since the last week. Also thank you for taking your time to answer my questions, I really appreciate it :)

The question I have is about datatypes you are using for the ICP algorithm.
From your code correct me if I am wrong:

  1. You put the reference cloud in a struct called CorrespondenceTable
  2. Any laser input is being converted to PCLPointCloud2 object from here:
    http://docs.pointclouds.org/1.7.0/_p_c_l_point_cloud2_8h_source.html
  3. When it is a time to converge, you translate the reference CorrespodenceTable type object into PCLPointCloud2 and do the ICP convergence.
  4. What happened to the pcl::PointXYZ like here as a datatype for the ICP algorithm? http://pointclouds.org/documentation/tutorials/iterative_closest_point.php
@carlosmccosta
Copy link
Owner

Good night :)

The ICP algorithm does not require two point clouds. It only requires the corresponding points between two point clouds to be computed.

As such, the reference point cloud is used only to initialize the lookup table and to store the points for later retrieval (there are no conversions during matching).

During the initialization of the lookup table, the 2D (for 3 DoF) or 3D (for 6 DoF) space is divided into voxels with the specified resolution.
Then, using the Meijster euclidean distance transform algorithm, each voxel is tagged with the index of the point in the reference point cloud that is closest to the voxel center.

This way, when the closest reference point needs to be computed for a given laser measurement, it is only necessary to retrieve the precomputed closest point index stored in the corresponding voxel, which later on can be used to retrieved the closest point coordinates from the reference point cloud when performing the transformation estimation.

Be aware that ICP uses the Correspondence class, in which the corresponding points are specified as indexes (associated with the points in the reference point cloud and sensor point cloud).

The main advantage of this approach is that it can be significantly faster than a k-d tree search and requires constant computational resources to perform, because the number of operations is always the same:

On the other hand, when using k-d trees, the computation time varies depending on how many levels the search algorithms needs to go through until it finds the closest point.

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

No branches or pull requests

2 participants