RobustFieldAutonomyLab / LeGO-LOAM

LeGO-LOAM: Lightweight and Ground-Optimized Lidar Odometry and Mapping on Variable Terrain
BSD 3-Clause "New" or "Revised" License
2.42k stars 1.13k forks source link

opencv.h #219

Closed robotics2020ashwani closed 3 years ago

robotics2020ashwani commented 3 years ago

Errors << lego_loam:make /home/ashwani/catkin_ws/logs/lego_loam/build.make.001.log
In file included from /home/ashwani/catkin_ws/src/LeGO-LOAM/LeGO-LOAM/src/mapOptmization.cpp:34: /home/ashwani/catkin_ws/src/LeGO-LOAM/LeGO-LOAM/include/utility.h:13:10: fatal error: opencv/cv.h: No such file or directory 13 | #include <opencv/cv.h> | ^~~~~ compilation terminated. In file included from /home/ashwani/catkin_ws/src/LeGO-LOAM/LeGO-LOAM/src/imageProjection.cpp:35: /home/ashwani/catkin_ws/src/LeGO-LOAM/LeGO-LOAM/include/utility.h:13:10: fatal error: opencv/cv.h: No such file or directory 13 | #include <opencv/cv.h> | ^~~~~ compilation terminated. make[2]: [CMakeFiles/imageProjection.dir/build.make:63: CMakeFiles/imageProjection.dir/src/imageProjection.cpp.o] Error 1 make[2]: [CMakeFiles/mapOptmization.dir/build.make:63: CMakeFiles/mapOptmization.dir/src/mapOptmization.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:458: CMakeFiles/mapOptmization.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... make[1]: [CMakeFiles/Makefile2:323: CMakeFiles/imageProjection.dir/all] Error 2 In file included from /home/ashwani/catkin_ws/src/LeGO-LOAM/LeGO-LOAM/src/featureAssociation.cpp:35: /home/ashwani/catkin_ws/src/LeGO-LOAM/LeGO-LOAM/include/utility.h:13:10: fatal error: opencv/cv.h: No such file or directory 13 | #include <opencv/cv.h> | ^~~~~ compilation terminated. In file included from /home/ashwani/catkin_ws/src/LeGO-LOAM/LeGO-LOAM/src/transformFusion.cpp:33: /home/ashwani/catkin_ws/src/LeGO-LOAM/LeGO-LOAM/include/utility.h:13:10: fatal error: opencv/cv.h: No such file or directory 13 | #include <opencv/cv.h> | ^~~~~ compilation terminated. make[2]: [CMakeFiles/featureAssociation.dir/build.make:63: CMakeFiles/featureAssociation.dir/src/featureAssociation.cpp.o] Error 1 make[2]: [CMakeFiles/transformFusion.dir/build.make:63: CMakeFiles/transformFusion.dir/src/transformFusion.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:1383: CMakeFiles/featureAssociation.dir/all] Error 2 make[1]: [CMakeFiles/Makefile2:1160: CMakeFiles/transformFusion.dir/all] Error 2 make: [Makefile:141: all] Error 2

I am trying to run this on ros noetic, but it is showing the above error?????

Another thing I want to ask is that will it work on ros noetic or do I have to make some changes????

ShivamPR21 commented 3 years ago

The problem may be the changes in OpenCV library the complete library was distributed into submodules.

If you detected OpenCV and configured your make scripts using CMake or pkg-config tool, your code will likely build fine without any changes. Otherwise, you will need to modify linker parameters (change the library names) and update the include paths.

It is still possible to use #include etc. but the recommended notation is:

#include "opencv2/imgproc/imgproc.hpp"
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Nvethrandil commented 8 months ago

If anyone still has this issue, there is a fork for OpenCV4 here; https://github.com/Self-SLAM-Lab/LeGO-LOAM_opencv4 Worked like a charm to just run this one instead :D