Skip to content

Build ORB_SLAM

Build ORB_SLAM #9

name: Build ORB_SLAM
on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
build_type: [Release]
c_compiler: [gcc, clang]
include:
- c_compiler: gcc
cpp_compiler: g++
- c_compiler: clang
cpp_compiler: clang++
steps:
- uses: actions/checkout@v4
- name: Cache apt packages
uses: actions/cache@v3
with:
path: /var/cache/apt
key: ${{ runner.os }}-apt-${{ hashFiles('apt-dependencies.txt') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Cache Pangolin
uses: actions/cache@v3
with:
path: ../Pangolin-0.9.1
key: ${{ runner.os }}-pangolin-0.9.1
restore-keys: |
${{ runner.os }}-pangolin-
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y $(cat apt-dependencies.txt)
if [ ! -d "../Pangolin-0.9.1" ]; then
wget https://github.com/stevenlovegrove/Pangolin/archive/refs/tags/v0.9.1.tar.gz -O ../libpangolin.tar.gz
tar xvf ../libpangolin.tar.gz -C ../
cd ../Pangolin-0.9.1
./scripts/install_prerequisites.sh required
cmake -B build -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cmake --build build --config ${{ matrix.build_type }}
cd -
fi
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Build DBoW2
run: |
echo "Configuring and building Thirdparty/DBoW2 ..."
cd Thirdparty/DBoW2
mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
make -j$(nproc)
- name: Build g2o
run: |
echo "Configuring and building Thirdparty/g2o ..."
cd Thirdparty/g2o
mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
make -j$(nproc)
- name: Build sophus
run: |
echo "Configuring and building Thirdparty/Sophus ..."
cd Thirdparty/Sophus
mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
make -j$(nproc)
- name: Build ORB_SLAM
run: |
echo "Configuring and building ORB_SLAM3 ..."
mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
make -j$(nproc)