IT 개발/LiDAR-SLAM

loam_livox 빌드 (feat. Ceres 버전)

KimDol2 2024. 1. 24. 18:15

 

 

Livox 라이다를 사용하는 lidar-slam 알고리즘 중에 처음으로 발표된 논문이 loam_livox 이다. (ICRA 2020) Solid State Lidar 의 특징 때문에 LOAM을 바로 적용하기는 어렵고 획득하는 포인트 클라우드의 특징을 반영해서 LOAM을 구현했다. 먼저 아래 래포지토리에서 loam_livox는 다운 받을 수 있다.

 

 

 

GitHub - hku-mars/loam_livox: A robust LiDAR Odometry and Mapping (LOAM) package for Livox-LiDAR

A robust LiDAR Odometry and Mapping (LOAM) package for Livox-LiDAR - GitHub - hku-mars/loam_livox: A robust LiDAR Odometry and Mapping (LOAM) package for Livox-LiDAR

github.com

 

빌드를 하기 위해서는 몇 가지 라이브러리들이(PCL, Ceres) 설치가 되어 있어야 한다. 그 중에서 Ceres 라이브러리도 사전에 설치가 되어있어야 한다. Ceres 라이브러리는 아래 링크를 따라 하면 다운 받고 설치를 할 수 있다.

 

 

 

Installation — Ceres Solver

When building Ceres, some dependencies (Eigen, gflags) are not found using custom Find .cmake modules any more. Hence, instead of the custom variables ( _INCLUDE_DIR_HINTS , _INCLUDE_DIR , …) you should use standard CMake facilities to customize where th

ceres-solver.org

 

Ceres 최신 버전은 Ceres-2.2.0 이다. 위에 링크의 설명대로 Ceres를 설치하고 loam_livox 를 catkin_make를 실행하였다. 그런데 이때 Ceres 라이브러리에서 에러가 난다. 

 

 

구글에 error: ‘LocalParameterization’ is not a member of ‘ceres’ 라는 키워드로 검색을 해보니, LocalParameterizations are deprecated in Ceres Solver 2.1.0 이라는 글이 하나 뜬다.

 

 

LocalParameterizations are deprecated in Ceres Solver 2.1.0 · Issue #1475 · colmap/colmap

ceres::LocalParameterization has been deprecated in the latest version of Ceres Solver (v 2.1.0) and will be removed going forward. ColMap only uses standard local parameterizations that ship with ...

github.com

 

와우 deprecated 라니.... Ceres 버전을 낮춰서 설치하고 다시 빌드를 해야겠다. 지금 사용중인 Ceres 버전이 2.2.0인데 Ceres-1.14.0 버전을 사용하면 될것 같다. Ceres1.14.0 을 구글 검색해서 다운받고 Ceres 설치 메뉴얼 대로 빌드를 하니 이번에는 Eigen관련해서 에러가 뜬다...

 

 

이번에도 역시 구글 검색을 한다.. "ceres-solver-1.14.x/internal/ceres/gtest/gtest.h:10445:35: error: variable or field ‘it’ declared void" 키워드로 검색하니 다음과 같은 글이 뜬다. 이번에는 Eigen 버전이 Ceres-1.14.0을 빌드하기 위해서 맞춰야 한다는 거다.

 

 

Ceres2.0.0报错:variable or field ‘it’ declared void,ceres和eigen版本分别回退为1.14.0和3.2.9_error: variable o

问题描述 在新的电脑(ubuntu16.04)上,上官网http://www.ceres-solver.org/installation.html安装了ceres,跑之前自己的代码时,发现类似下面的错误,一大堆,内存也会爆炸: /usr/local/include/ceres/internal/parame

blog.csdn.net

 

위 글은 중국 사이트다 보니 살짝 번역해 봤다. 결론부터 말하자면 Ceres-1.14.0 을 빌드하기 위해서는 Eigen 3.2.9 를 사용해야 한다는 것인데.... 위에 나와있는 순서대로 기존 Eigen을 지우고 다시 Ceres-1.14.0 을 빌드하고 loam_livox를 빌드하니 이번엔 Eigen 버전으로 인한 loam_livox 빌드 에러가 발생한다.

 

 

뭔가.. 계속 쳇바퀴 도는 느낌이지만.... 다시 정리를 해봤다.

 

loam_livox 는 Eigen과 Ceres 라이브러리를 사용한다. 그리고 Ceres 라이브러리는 1.14.0 버전을 사용해야 하고, Eigen은 3.2.9 이상 버전을 사용해야 한다. 

 

정리하자면 먼저 Eigen을 3.3.4로 셋팅하고, Ceres-1.14.0을 빌드한다. 그리고 loam_livox를 빌드한다.

 

순서대로 

1. Eigen 재설치

아래는 위의 CSDN 사이트에 나와있는 Eigen을 재설치 하는 과정이다.

 

기존 Eigen 제거
sudo rm -rf /usr/include/Eigen /usr/include/eigen3 /usr/local/include/Eigen /usr/local/include/eigen3

eigen-3.3.4 압축 풀기
sudo tar -xzvf eigen-3.3.4.tar.gz -C /usr/local/include

eigen 디렉토리 이름 바꾸기
sudo mv /usr/local/include/eigen-3.3.4 /usr/local/include/eigen3

프로그램이 찾을 수 있도록 eigen 복사
sudo cp -r /usr/local/include/eigen3/Eigen /usr/local/include
sudo cp -r /usr/local/include/eigen3/Eigen /usr/include
sudo cp -r /usr/local/include/eigen3 /usr/include

 

 

2. 이렇게 하고 다시 Ceres-1.14.0 을 설치한다

 

tar zxf ceres-solver-2.2.0.tar.gz
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-2.2.0
make -j3
make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
make install

 

3. Eigen-3.3.4 그리고 Ceres-1.14.0 상태에서 loam_livox를 설치한다.

 

문제 없이 빌드가 되었다면 loam_livox를 실행시켜 보다  :)

 

반응형

'IT 개발 > LiDAR-SLAM' 카테고리의 다른 글

20241021_1fl 데이터 LIO-SAM 테스트  (0) 2024.10.22
LIO-SAM 설치 및 실행 (feat. Livox Lidar)  (1) 2024.02.16
FAST-LIO2 설치하기  (0) 2024.01.11
LeGO-LOAM 코드 분석하기 (1)  (0) 2023.08.17
LeGO-LOAM 설치 및 실행  (0) 2023.07.24