Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on ubuntu 20.04. #215

Closed
CAKGOD opened this issue Dec 25, 2020 · 10 comments
Closed

Build error on ubuntu 20.04. #215

CAKGOD opened this issue Dec 25, 2020 · 10 comments

Comments

@CAKGOD
Copy link

CAKGOD commented Dec 25, 2020

An error occured when I buid the LeGO-LOAM on ubuntu 20.04. The error info is shown below.
/usr/include/pcl-1.10/pcl/filters/voxel_grid.h: In member function ‘std::vector<int> pcl::VoxelGrid<PointT>::getNeighborCentroidIndices(const PointT&, const MatrixXi&) const’: /usr/include/pcl-1.10/pcl/filters/voxel_grid.h:340:21: error: ‘Index’ is not a member of ‘Eigen’ 340 | for (Eigen::Index ni = 0; ni < relative_coordinates.cols (); ni++) | ^~~~~ /usr/include/pcl-1.10/pcl/filters/voxel_grid.h:340:21: note: suggested alternatives: In file included from /usr/include/opencv4/opencv2/flann.hpp:48, from /usr/include/opencv4/opencv2/opencv.hpp:65, from /home/cakgod/lego_loam/src/LeGO-LOAM/LeGO-LOAM/include/utility.h:14, from /home/cakgod/lego_loam/src/LeGO-LOAM/LeGO-LOAM/src/transformFusion.cpp:33: /usr/include/opencv4/opencv2/flann/flann_base.hpp:104:7: note: ‘cvflann::Index’
Some softwares on this system are shown below.

  • ROS noetic
  • PCL 1.10.0
  • OpenCV 4.2.0
  • Eigen 3.7.0

Can you tell me how to solve this problem? Thanks~

@Wing-ka-king
Copy link

Same here. Facing problems with installation on ubuntu20.04 and ros noetic

@Wing-ka-king
Copy link

Wing-ka-king commented Jan 14, 2021

Forcing cmake to use c++ 14 did build the package for me, with some warnings.
Add this to CMakeLists.txt for LeGO-LOAM

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

@LucasWEIchen
Copy link

Same here, PCL lib is having problem find Eigen:Index some how?

@LucasWEIchen
Copy link

Forcing cmake to use c++ 14 did build the package for me, with some warnings.
Add this to CMakeLists.txt for LeGO-LOAM

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

This does not work for me

@CAKGOD CAKGOD closed this as completed Feb 5, 2021
@ozgudum
Copy link

ozgudum commented Mar 12, 2021

Fix here worked for me: ethz-asl/lidar_align#16

a temporary fix that worked for us:
In /usr/include/flann/util/serialization.h at the top change the corresponding lines to:

#include "lz4.h"
#include "lz4hc.h"

@juliangaal
Copy link

juliangaal commented Mar 17, 2021

Same here, PCL lib is having problem find Eigen:Index some how?

Have you been able to fix the issue @LucasWEIchen?

What about you @CAKGOD?

@notplus
Copy link

notplus commented Apr 22, 2021

May be you can modify file /usr/include/pcl-1.10/pcl/filters/voxel_grid.h line 340 and line 669 to solve it.
Just use int to substitute Eigen::Index. It works for me.
old:
for (Eigen::Index ni = 0; ni < relative_coordinates.cols (); ni++)

new:
for (int ni = 0; ni < relative_coordinates.cols (); ni++)

@davizinho5
Copy link

The solution provided by @notplus worked for me, although the change mast be done in a couple of places.

Thanks!

@shikeqin123
Copy link

if you don't want to use int to substitute Eigen::Index, Specify a lower version of PCL, for exmaple, I use pcl-1.9 for instead, I add set(PCL_DIR "/usr/local/share/pcl-1.9/PCLConfig.cmake") to the CMakeLists.txt

@JulianKu
Copy link

@shikeqin123 For me, installing PCL 1.9 parallel to 1.11 and adding set(PCL_DIR "/usr/local/share/pcl-1.9/PCLConfig.cmake") to the CMakeLists.txt still results in Eigen::Index errors because it is still using PCL 1.11 in pcl_ros (Maybe additional reconfiguration is required?)

However, the int substitution proposed by @notplus works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants