LeGO-LOAM编译错误Eigen::Index ni = 0; ni < relative_coordinates.cols (); ni++

usr/include/pcl-1.10/pcl/filters/voxel_grid.h: In member function ‘std::vector pcl::VoxelGrid::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’

解决方法:
修改 /usr/include/pcl-1.10/pcl/filters/voxel_grid.h 在line 340 and line 669

将原来的:

for (Eigen::Index ni = 0; ni < relative_coordinates.cols (); ni++)

更改为:

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

你可能感兴趣的:(ROS错误记录与方法总结,c++,计算机视觉)