PointCloudLibrary / PointCloudLibrary/pcl
Voxel Grid Rewrite Ideas
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 4.7k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 6
Description
A follow-up on the issues raised in https://github.com/PointCloudLibrary/pcl/pull/2171#issuecomment-364926779 .
Ideas
- Start boilerplating on
pcl::experimental::VoxelGridso that we can spread the work over multiple PRs without breaking current functionalities. - Does it still make sense to call it a grid or even voxel for that matter?
VoxelFilter? - Drop the
PointCloud2support. Use the conversion functions during the deprecation period.
The swappable partitioning strategy seems like something that makes sense at compile time. Since different coordinate systems in the partitioning imply different parameters and therefore the corresponding getters and setters, this immediately invokes templated multiple inheritance in my head. Something along the lines of
class Partition1D
{
public:
virtual size_t computeLinearIndex (const float coord) const = 0;
};
class Cartesian1DPartitioning : public Partition1D
{
public:
void setMin (const float min) { min_ = min; }
float getMin () const { return min_; }
size_t computeLinearIndex (const float coord) const
{
// return something meaningful
return 3.f;
}
protected:
float min_;
float max_;
float division_;
};
// Whatever is responsible for receiving the list of points in a voxel and applying some decimation action over it
class SomeVoxelMethod
{
};
template<typename PartitionT, typename VoxelMethodT>
class VoxelFilter : public PartitionT, public VoxelMethodT
{
};
typedef VoxelFilter<Cartesian1DPartitioning, SomeVoxelMethod> VoxelGrid;
See it running here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked PR comment and the proposed pcl::experimental::VoxelGrid design in this issue. Review the existing VoxelGrid and PointCloud2 support before deciding how partitioning and voxel methods should be separated. Done requires an agreed design for the rewrite, deprecation or conversion handling, and a sequence of independently mergeable changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-vision
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100