반응형
05.15(금) 수정사항
#1. Git Source Code를 다운로드한 후
#2. OpenVSLAM-master폴더명을 openvslam으로 변경해서 /path/to/ 복붙
#3. OpenCV 3.3.1 버전에서는 CUDDA와 충돌이 있다 그래서 OpenCV 버전은 4.3.0 최신버전을 설치
Source Code
Open VSLAM - MASTER
git clone https://github.com/xdspacelab/openvslam
요구사항(버전을 잘 확인하자)
- Eigen : version 3.3.0 or later.
- g2o : Please use the latest release. Tested on commit ID 9b41a4e.
- SuiteSparse : Required by g2o.
- DBoW2 : Please use the custom version of DBoW2 released in https://github.com/shinsumicco/DBoW2.
- yaml-cpp : version 0.6.0 or later.
- OpenCV : version 3.3.1 or later.
설치는 Ubuntu 16.04와 Mac High Sierra 그 이상 버전도 가능하다
(필자는 Mac Catalina 10.15.4무려 최신 버전)
Ubuntu 패키지 관리 툴인 apt-get install 대신 Mac에서는 Home Brew의 패키지 관리 툴을 사용한다.
Install Home Brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
설치가 끝났으면 이제 패키지들을 쉽게 관리할 수 있다.
이제 하나씩 설치해보자.
Installing for mac OS
brew update
# basic dependencies
brew install pkg-config cmake git
# g2o dependencies
brew install suite-sparse
# OpenCV dependencies and OpenCV
brew install eigen
brew install ffmpeg
brew install opencv
# other dependencies
brew install yaml-cpp glog gflags
# (if you plan on using PangolinViewer)
# Pangolin dependencies
brew install glew
# (if you plan on using SocketViewer)
# Protobuf dependencies
brew install automake autoconf libtool
# Node.js
brew install node
Download, bulid and install the custom DBoW2 form source.
cd /path/to/working/dir
git clone https://github.com/shinsumicco/DBoW2.git
cd DBoW2
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
..
make -j4
make install
Download, build and install g2o.
cd /path/to/working/dir
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
git checkout 9b41a4ea5ade8e1250b9c1b279f3a9c098811b5a
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_CXX_FLAGS=-std=c++11 \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_UNITTESTS=OFF \
-DBUILD_WITH_MARCH_NATIVE=ON \
-DG2O_USE_CHOLMOD=OFF \
-DG2O_USE_CSPARSE=ON \
-DG2O_USE_OPENGL=OFF \
-DG2O_USE_OPENMP=ON \
..
make -j4
make install
2가지 종류의 뷰어를 제공한다. PangolinViewer, SocketViewer
Download, build and install Pangolin from source.
cd /path/to/working/dir
git clone https://github.com/stevenlovegrove/Pangolin.git
cd Pangolin
git checkout ad8b5f83222291c51b4800d5a5873b0e90a0cf81
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
..
make -j4
make install
Download, build and install socket.io-client-cpp from source.
cd /path/to/working/dir
git clone https://github.com/shinsumicco/socket.io-client-cpp
cd socket.io-client-cpp
git submodule init
git submodule update
mkdir build && cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_UNIT_TESTS=OFF \
..
make -j4
make install
SoketViewer을 사용한다면 Protobuf도 설치
brew install protobuf
설치된 뷰어에 따라서 빌드를 해주면 된다.
PangolinViewer
cd /path/to/openvslam
mkdir build && cd build
cmake \
-DBUILD_WITH_MARCH_NATIVE=ON \
-DUSE_PANGOLIN_VIEWER=ON \
-DUSE_SOCKET_PUBLISHER=OFF \
-DUSE_STACK_TRACE_LOGGER=ON \
-DBOW_FRAMEWORK=DBoW2 \
-DBUILD_TESTS=ON \
..
make -j4
SocketViewer
cd /path/to/openvslam
mkdir build && cd build
cmake \
-DBUILD_WITH_MARCH_NATIVE=ON \
-DUSE_PANGOLIN_VIEWER=OFF \
-DUSE_SOCKET_PUBLISHER=ON \
-DUSE_STACK_TRACE_LOGGER=ON \
-DBOW_FRAMEWORK=DBoW2 \
-DBUILD_TESTS=ON \
..
make -j4
빌드 후./run_kitti_slam -h를 실행하면 성공
SocketViewr 서버 환경설정
$ cd /path/to/openvslam/viewer
$ ls
Dockerfile app.js package.json public views
$ npm install
added 88 packages from 60 contributors and audited 204 packages in 2.105s
found 0 vulnerabilities
$ ls
Dockerfile app.js node_modules package-lock.json package.json public views
$ node app.js
WebSocket: listening on *:3000
HTTP server: listening on *:3001
접속하면~ 정상적으로 출력된다.
"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."
반응형
'Computer Vision' 카테고리의 다른 글
OpenVSLAM 구현하기 (0) | 2020.06.25 |
---|