yorsh87 / nicp

Normal Iterative Closest Point (NICP) Algorithm C++ Library
GNU General Public License v3.0
396 stars 115 forks source link

Building on Windows, errors. #4

Closed antithing closed 7 years ago

antithing commented 7 years ago

Hi, and thank you for making this code available, it looks like exactly what I need! I am trying to compile it on windows, and am getting errors.

in correspondencefinderprojective.cpp

I have adjusted

 int localCorrespondenceIndex[numThreads];
 int localOffset[numThreads];

to:

 int numThreads = omp_get_max_threads();
 int * localCorrespondenceIndex = new int[numThreads];
int * localOffset = new int[numThreads];

but line:

int &correspondenceIndex = localCorrespondenceIndex[threadId];

gives me: 'initializing': cannot convert from 'int [numThreads]' to 'int &'

here:

const Normal& n = nscale * src.normals()[i];

gives:

'n': references must be initialized

and I get a lot of:

Severity    Code    Description Project File    Line
Error   C2864   'nicp::HomogeneousVector4f<0>::wCoordinate': a static data member with an in-class initializer must have non-volatile const integral type   nicp    d:\vp\pointcloud\nicp\nicp-master\nicp\nicp\homogeneousvector4f.h   21

at the line:

static const float wCoordinate = wCoordinate_;

in homogeneousvector4f.h

in pinholeprojector.cpp

I have made the following changes:

    float *drowPtrs = new float[_imageRows];
  //  float *drowPtrs[_imageRows];
    int *irowPtrs = new int[_imageRows];
//    int *irowPtrs[_imageRows];

just underneath this, at:


  float &otherDistance = drowPtrs[y][x];
      int &otherIndex = irowPtrs[y][x];

I get :

`'otherDistance': references must be initialized

subscript requires array or pointer type `

'otherIndex ': references must be initialized

aaand, in bm_Se3.h

this function:

  template <typename Derived>
    inline Eigen::Transform<typename Derived::Scalar, 3, Eigen::Isometry> v2t(const Eigen::MatrixBase<Derived>& x_) {
    Eigen::Transform<typename Derived::Scalar, 3, Eigen::Isometry> X;
    Eigen::Matrix<typename Derived::Scalar, 6, 1> x(x_);
    X.template linear() = quat2mat(x.template block<3,1>(3,0));
    X.template translation() = x.template block<3,1>(0,0);
    return X;
  }

gives:

Severity    Code    Description Project File    Line
Error   C2039   'X': is not a member of 'Eigen::Transform<float,3,1,0>' nicp    d:\vp\pointcloud\nicp\nicp-master\nicp\nicp\bm_se3.h    41

I know you did not build this for windows, but if you have a minute to help me out here, it would be much appreciated. Thanks again!

yorsh87 commented 7 years ago

Unfortunately I can not support also versions on Windows/OSX since I have not enough time.