1

I'm working with PCL (Point Cloud Library). I've made a class (myPCL_SI) that inherits from a PCL template class (pcl::SpinImageEstimation). I've created an other normal class (myPCL) that creates a myPCL_SI object.

I do this because I need to access to a protected method from pcl::SpinIMageEstimation. If someone knows a better solution, please say me.

Ok, my problem is that when I try to create a myPCL_SI object, the compiler give me this error:

error: ‘spinImage’ was not declared in this scope
error: template argument 1 is invalid
error: template argument 3 is invalid

My code is this one:

myPCL class (only my method)

void myPCL::calcSpinImage(){

    myPCL_SI<pcl::PointXYZ, pcl::Normal, pcl::Histogram<153>> spinImage;

    // doing more things...
}

myPCL_SI class (header)

#ifndef MYPCL_SI_H
#define MYPCL_SI_H

// a lot of includes...

using namespace pcl;

template <typename PointInT, typename PointNT, typename PointOutT>
class myPCL_SI : public SpinImageEstimation<PointInT, PointNT, PointOutT>
{
public:
    myPCL_SI();
    void compute(PointCloud<PointXYZ>::Ptr cloud);

};

#include "mypcl_si.cpp"

#endif // MYPCL_SI_H

myPCL_SI class (impl)

template <typename PointInT, typename PointNT, typename PointOutT>
myPCL_SI<PointInT, PointNT, PointOutT>::myPCL_SI()
{

}

Thanks a lot! :D

jophab
  • 5,356
  • 14
  • 41
  • 60
froure
  • 121
  • 2
  • 10

1 Answers1

1

If you are using an older compiler, you need a space between the two >> after 153.

See Template within template: why "`>>' should be `> >' within a nested template argument list"

Community
  • 1
  • 1
NPE
  • 486,780
  • 108
  • 951
  • 1,012
  • I spend 2 hours with this problem and is this f***g typo. I will go to cry :'(. Thanks a lot! :D:D and sorry for ask this question, but I didn't found anything about it. Thaanks!!!! – froure Jan 08 '14 at 15:48