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

catkin_make in ROS Noetic [Error] #206

Closed
HappySamuel opened this issue Feb 23, 2021 · 13 comments
Closed

catkin_make in ROS Noetic [Error] #206

HappySamuel opened this issue Feb 23, 2021 · 13 comments
Labels
good first issue Good for newcomers

Comments

@HappySamuel
Copy link

I am trying to install the LIO-SAM in Ubuntu 20.04 and ROS Noetic. However i couldn't get it catkin_make.

Error 1:
GTSAM version: ppa gtsam (4.0.3)
Reason of using ppa GTSAM (4.0.3) is because failed to build GTSAM (4.0.2) from source. It failed at cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ..
Screenshot from 2021-02-23 18-03-08
Is there any solution to this error?

Error 2:
catkin_make ERROR
Screenshot from 2021-02-23 18-03-08

What's the opencv version needed for LIO-SAM?

Best,
Samuel

@Rotoslider
Copy link

For me on Melodic with Opencv4.5 installed I had the change the line in utility.h to opencv2/opencv.hpp.

@HappySamuel
Copy link
Author

HappySamuel commented Feb 24, 2021

Hi @Rotoslider

Thanks for the info.

@TixiaoShan
I have successful tried out installing LIO-SAM with ROS Noetic, and we need to do the following changes:
Step 1: Install GTSAM 4.0.3 binary

  • Reason of doing so, is because failed to install from source using the gtsam 4.0.2
    Screenshot from 2021-02-24 09-52-16

Step 2: Configure the utility.h to use
#include <opencv2/opencv.hpp> instead of #include <opencv/cv.h>

Step 3: Configure CMakeLists.txt to use
set(CMAKE_CXX_FLAGS "-std=c++14") instead of set(CMAKE_CXX_FLAGS "-std=c++11")

With these 3 modifications, LIO-SAM is able to be installed on Ubuntu 20.04 and ROS Noetic. You may try it out.

Best,
Samuel

@J-Rojas
Copy link

J-Rojas commented Jun 15, 2021

@HappySamuel this was very helpful. @TixiaoShan Can this be added to the documentation?

@FrankBu0616
Copy link

@HappySamuel Thanks for the post! Supper helpful!

@juliangaal
Copy link

I created a fork that compiles on Ubuntu 20.04 with ROS Noetic

@TixiaoShan TixiaoShan pinned this issue Sep 28, 2021
@TixiaoShan TixiaoShan added the good first issue Good for newcomers label Sep 28, 2021
@grischi grischi unpinned this issue Oct 11, 2021
@willat343
Copy link

willat343 commented Mar 25, 2022

Even with @HappySamuel's changes, I still encountered a strange error:

error: ‘class std::unordered_map<unsigned int, std::vector<unsigned int> >’ has no member named ‘serialize’

which was resolved by moving #include <opencv2/opencv.hpp> after the pcl headers.

This appears to be caused by a incompatibility between FLANN and OpenCV, whereby the USE_UNORDERED_MAP macro leeks from the OpenCV header and is picked by FLANN. Swapping the header order resolves this issue. See flann-lib/flann#214 and https://stackoverflow.com/questions/42504592/flann-util-serialization-h-class-stdunordered-mapunsigned-int-stdvectorun for more details.

Also the stable gtsam-release-4.0 at time of writing is now 4.0.3, so it was not necessary to install GTSAM from source.

@TixiaoShan
Copy link
Owner

TixiaoShan commented Apr 11, 2022

Thanks for providing information for Noetic compiling. To summarize HappySamuel and willat343's comments:

  1. Install GTSAM following readme
  2. Configure the utility.h to use #include <opencv2/opencv.hpp> instead of #include <opencv/cv.h>
  3. Configure CMakeLists.txt to use set(CMAKE_CXX_FLAGS "-std=c++14") instead of set(CMAKE_CXX_FLAGS "-std=c++11")
  4. Move #include <opencv2/opencv.hpp> after the pcl headers

@leo-stan
Copy link

leo-stan commented May 9, 2022

According to this all that has to be done to fix the flann serialization error is to include <pcl/kdtree/kdtree_flann.h> before <opencv2/opencv.hpp>. I tested this change locally and it solved the issue.

@Abhirup0209
Copy link

There are still some compilations issues with this now and ROS Noetic. Can anyone please help me?

redheli pushed a commit to redheli/LIO-SAM-1 that referenced this issue Oct 10, 2022
Pokealimit added a commit to NTU-Conti-A2/LIO-SAM that referenced this issue Feb 22, 2023
@CursingThomas
Copy link

Hi All, I still have issues compiling in Noetic. Below is terminal feedback:
Screenshot from 2023-03-17 11-05-59
Can anyone help?

kai156277 added a commit to kai156277/LIO-SAM that referenced this issue Aug 14, 2023
参考一下链接修改:

1. LIO-SAM issue TixiaoShan#206
2. 知乎文章: LIO-SAM源码解析:准备篇 (https://zhuanlan.zhihu.com/p/352039509)

具体步骤:

1. sudo add-apt-repository ppa:borglab/gtsam-release-4.1
2. sudo apt-get update
3. sudo apt install libgtsam-dev libgtsam-unstable-dev
4. catkin_make
5. 添加 ros 环境变量到终端
6. 运行
@X1yz
Copy link

X1yz commented Apr 8, 2024

Hi All, I still have issues compiling in Noetic. Below is terminal feedback: Screenshot from 2023-03-17 11-05-59 Can anyone help?

i have the same problem.Have you sovled it?

@pospichal-lukas
Copy link

Hi All, I still have issues compiling in Noetic. Below is terminal feedback: Screenshot from 2023-03-17 11-05-59 Can anyone help?

i have the same problem.Have you sovled it?

I ran catkin make again. The build succeeded the second time. Don't ask me why.

@Kenneth-fuge
Copy link

把flann移到opencv前面
#include <pcl/kdtree/kdtree_flann.h>
// #include <opencv/cv.h>
#include <opencv2/opencv.hpp>

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

No branches or pull requests