PointCloudLibrary / PointCloudLibrary/pcl

Use user defined point(define PCL_NO_PRECOMPILE) will let supervoxel_clustering compile failed.

Open
#3,170 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue kind: bug kind: todo module: octree
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

Why these template specialization is implemented in supervoxel_clustering.cpp but not in supervoxel_clustering.hpp, and leave empty definitions in .hpp?

That will make compile failed with LNK2019 errors, if I defined PCL_NO_PRECOMPILE to compile with my own point type, and use pcl::PointXYZRGBA with supervoxel_clustering .

namespace pcl
{ 
  namespace octree
  {
    //Explicit overloads for RGB types
    template<>
    void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZRGB,pcl::SupervoxelClustering<pcl::PointXYZRGB>::VoxelData>::addPoint (const pcl::PointXYZRGB &new_point);
    
    template<>
    void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZRGBA,pcl::SupervoxelClustering<pcl::PointXYZRGBA>::VoxelData>::addPoint (const pcl::PointXYZRGBA &new_point);
    
    //Explicit overloads for RGB types
    template<> void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZRGB,pcl::SupervoxelClustering<pcl::PointXYZRGB>::VoxelData>::computeData ();
    
    template<> void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZRGBA,pcl::SupervoxelClustering<pcl::PointXYZRGBA>::VoxelData>::computeData ();
    
    //Explicit overloads for XYZ types
    template<>
    void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZ,pcl::SupervoxelClustering<pcl::PointXYZ>::VoxelData>::addPoint (const pcl::PointXYZ &new_point);
    
    template<> void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZ,pcl::SupervoxelClustering<pcl::PointXYZ>::VoxelData>::computeData ();
  }
}
  template<> void
  pcl::SupervoxelClustering<pcl::PointXYZRGB>::VoxelData::getPoint (pcl::PointXYZRGB &point_arg) const;
  
  template<> void
  pcl::SupervoxelClustering<pcl::PointXYZRGBA>::VoxelData::getPoint (pcl::PointXYZRGBA &point_arg ) const;

And those function in origin pcl::octree::OctreePointCloudAdjacencyContainer is do nothing...
Why not throw some error like "Not implement"?
So that will make users know they need to implement those functions, because when a function can run (actually no) with no errors, that will make people hard to find where is fucked up....

 /** \brief Add new point to container- this just counts points
       * \note To actually store data in the leaves, need to specialize this
       * for your point and data type as in supervoxel_clustering.hpp
       */
       // param[in] new_point the new point to add  
      void 
      addPoint (const PointInT& /*new_point*/)
      {
        using namespace pcl::common;
        ++num_points_;
      }
/** \brief Function for working on data added. Base implementation does nothing 
       * */
      void
      computeData ()
      {
      }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare supervoxel_clustering.cpp with supervoxel_clustering.hpp, focusing on the explicit template specializations for OctreePointCloudAdjacencyContainer and VoxelData. Reproduce the PCL_NO_PRECOMPILE build using PointXYZRGBA, then verify that the relevant functions link correctly and that the base no-op behavior is addressed as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.