nmellado/Super4PCS

Eigen alignment assert using PCLWrapper and PCL

Closed this issue · 2 comments

Hi @nmellado,
first of all, thanks for making Super4PCS available. I've been testing it with Kinect data for the past few weeks and the speed vs. accuracy trade-off is impressive!

Recently, I tried to use the PCLWrapper with some PCL code to sub-sample LiDAR data (~5 million 3D point per scan) but I get a Eigen assert message during my code execution. I don't have any additional Eigen class/struct in my own code besides a Eigen::Matrix4f to pass as an argument to Super4PCS::computeTransformation function (source file):

void computeTransformation (PointCloud [CMakeLists.txt](https://github.com/nmellado/Super4PCS/files/1727555/CMakeLists.txt) Source &output, const Eigen::Matrix4f& guess);

I'm using PCL v1.8.1 in Ubuntu 16.04 (x64).
I've tried with master and 1.4RC branches and also with release 1.3.
I've attached the CMakeLists.txt used in my code.

This is the output:

`
filipe@filipe-pc:~/dev/Super4PCS-RC1.1.4/build/debug/demos/PCLWrapper$ ./Super4PCS-PCLWrapper /home/filipe/data/aux1.obj /home/filipe/data/aux2.obj -o 0.20 -d 0.05 -n 200 -t 100

Loading point clouds...
Failed to find match for field 'curvature'.
Failed to find match for field 'curvature'.
Starting alignment...
create tree
create tree ... DONE (26248 points)
norm_max_dist: 0.05
Initial LCP: 0.07
Super4PCS-PCLWrapper: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = float; int Size = 16; int MatrixOrArrayOptions = 0]: Assertion (reinterpret_cast<size_t>(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed. Aborted (core dumped)

Thanks,
Filipe

Thanks for the report.

Can you try to reproduce this error when compiling with the version of Eigen provided as submodules ?

cd Super4PCS-directory
mkdir build && cd build
git submodule update --init
cmake .. -DCMAKE_BUILD_TYPE=Release -DEIGEN3_INCLUDE_DIR=../3rdparty/Eigen

This is usually because of optimization flags when using Eigen. It's architecture specific so some people experience it while others don't. Try to compile Super4PCS without optimization flags (e.g. -O 3, -O s).