leggedrobotics / tree_detection

This package implements a simple tree detector from point cloud data. It makes no assumptions about the ground plane and can handle arbitrary terrains.
70 stars 15 forks source link

Filter integration #4

Closed TunVunDerBunn closed 2 years ago

TunVunDerBunn commented 2 years ago

If the point cloud expansion is too large, the pcl voxelgrid filter outputs a warning in the terminal. An integer overflow seems to happen.

Although, there is already a voxelgrid filter in the computation of the elevation map, a considerable speed up can be obtained by applying a voxelgrid filter before adding the elevationLayer to the grid map (if the point cloud contains a lot of very close points).

Quick Note: the voxelgrid filter used in the pipeline of the grid_map seems to be more performant than the one provided by pcl, as no warning is rising when applying the same leaf size. (It might be that the warning is suppressed by the package)

jelavice commented 2 years ago

Hi Tun, thank you for your contribution. So if I see correctly, this voxelizes the pointcloud used for the ground plane removal, correct? But you can already do that (yaml file, line 41). Or am I missing someting here?

jelavice commented 2 years ago

Or is this voxelized pointcloud then passed to the tree detection further on? In case you also want to voxelize the cloud used for tree detection, I would do that outside of the ground plane remover. This should be done in the class/function that owns an instance the ground plane remover.

TunVunDerBunn commented 2 years ago

Hi Edo, beforehand only the some voxelization was done during the generation of the grid map, but this did not influence the point cloud, which was passed to the tree detection. This made the tree detection extremely slow.

Should I implement it as some sort of preprocessing of the point cloud, before it is passed into the ground remover?

jelavice commented 2 years ago

Hi Tun,

thanks for the clarification. I think adding a cloud preprocessor is a cleaner solution since it nicely separates responsibilities between the ground removal and pointcloud pre-processing. So I would preprocess the pointcloud inside the tree_detection_node.cpp. Then once this is cropped or downsampled or both, you can pass it to the ground plane remover and tree detection.

Does that make sense?

TunVunDerBunn commented 2 years ago

Hi Edo,

Yes, that makes sense. I will make the necessary changes in the coming days.

jelavice commented 2 years ago

as discussed, we implement the changes required in another PR.