Measure the distance between two point clouds

Is it possible to measure the distance between two point clouds, where the shape of the two point clouds varies with each capture, and I want to measure the distance between the closest two points?

Because I want to add a check for the pillars on both sides of the material bin to prevent errors, but the sizes of the pillars are not uniform. Therefore, I want to detect the distance between two pixel points or two point clouds, but I can’t find the edges of the pixel points.

I also need to to check the distance from the sides of the pillars because the pillars are important influencing factors for welding.

In other words, what we need to measure is the distance between the bin and the pillars, and we require that this distance should not be less than a threshold value. In reality, this situation involves calculating the distance between two point clouds in a specific direction. It can be calculated using the following method:

  1. Segment the two point clouds to be measured through point cloud clustering.

  2. Determine the direction in which to calculate the distance between the two point clouds, such as the X-direction in the robot’s coordinate system.

  3. Use the ‘Get Highest-Layer Points’ step to separately obtain the highest layer points of the two point clouds, with the parameter set to the X-direction and the layer height set to approximately the size of a single point (possibly sub-millimeter).

  4. Calculate the poses of these two points separately, find the difference, and obtain the distance between the two points.

If you need to calculate the distance between two point clouds in different directions, it may be challenging with the existing setup, and you may need to use a Python script in your project.