Performance improvement for temporal mapping (#589) #821
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
# build_macos: | |
# runs-on: macos-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: brew install | |
# run: | | |
# brew update | |
# brew upgrade | |
# brew install ccache pkg-config cmake git suite-sparse libomp eigen ffmpeg opencv yaml-cpp glog gflags glew protobuf clang-format | |
clang-format: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: DoozyX/clang-format-lint-action@v0.12 | |
with: | |
source: "." | |
exclude: "./3rd" | |
extensions: "h,cc" | |
clangFormatVersion: 6 | |
style: file | |
inplace: False | |
build_without_gui_cv3: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
container: | |
image: ghcr.io/ymd-stella/stella-cv/stella_vslam:cv-3.x | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: cmake and make | |
run: | | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTS=ON -DUSE_SSE_ORB=ON .. | |
make -j $(($(nproc) / 2)) | |
- name: unit test | |
run: | | |
cd build | |
export BOW_VOCAB=/datasets/orb_vocab/orb_vocab.fbow | |
ctest -V | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
container: | |
image: ghcr.io/ymd-stella/stella-cv/stella_vslam:cv-4.x | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Create artifact directory | |
run: | | |
mkdir -p artifact | |
- name: Save cpuinfo | |
run: | | |
cp /proc/cpuinfo artifact | |
- name: cmake and make library | |
run: | | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTS=ON -DUSE_SSE_ORB=ON -DUSE_GTSAM=ON .. | |
make -j $(($(nproc) / 2)) | |
make install | |
- uses: actions/checkout@v3 | |
with: | |
repository: stella-cv/pangolin_viewer | |
path: pangolin_viewer | |
submodules: recursive | |
- name: cmake and make pangolin_viewer | |
run: | | |
mkdir -p pangolin_viewer/build | |
cd pangolin_viewer/build | |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. | |
make -j $(($(nproc) / 2)) | |
make install | |
- uses: actions/checkout@v3 | |
with: | |
repository: stella-cv/stella_vslam_examples | |
path: stella_vslam_examples | |
submodules: recursive | |
- name: cmake and make examples | |
run: | | |
mkdir -p stella_vslam_examples/build | |
cd stella_vslam_examples/build | |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_STACK_TRACE_LOGGER=ON .. | |
make -j $(($(nproc) / 2)) | |
- name: unit test | |
run: | | |
cd build | |
export BOW_VOCAB=/datasets/orb_vocab/orb_vocab.fbow | |
ctest -V | |
- name: Convert groundtruth to TUM format | |
run: | | |
python3 scripts/dataset_tools/compute_euroc_cam_tf.py > tf.json | |
evo_traj euroc --transform_right tf.json /datasets/EuRoC/MH_01/state_groundtruth_estimate0/data.csv --save_as_tum | |
mv data.tum MH_01.tum | |
evo_traj euroc --transform_right tf.json /datasets/EuRoC/MH_04/state_groundtruth_estimate0/data.csv --save_as_tum | |
mv data.tum MH_04.tum | |
- name: make config for gtsam backend | |
run: | | |
sed -e 's/backend: "g2o"/backend: "gtsam"/g' example/euroc/EuRoC_mono.yaml > EuRoC_mono_gtsam.yaml | |
sed -e 's/backend: "g2o"/backend: "gtsam"/g' example/euroc/EuRoC_stereo.yaml > EuRoC_stereo_gtsam.yaml | |
- name: make config for temporal mapping | |
run: | | |
sed -e 's/erase_temporal_keyframes: false/erase_temporal_keyframes: true/g' -e 's/enable_temporal_keyframe_only_tracking: false/enable_temporal_keyframe_only_tracking: true/g' example/euroc/EuRoC_mono.yaml > EuRoC_mono_temporal_mapping.yaml | |
- name: make config for sqlite3 map format | |
run: | | |
sed -e 's/map_format: "msgpack"/map_format: "sqlite3"/g' example/euroc/EuRoC_mono.yaml > EuRoC_mono_sqlite3.yaml | |
- name: SLAM test (monocular) with EuRoC MAV dataset (MH_01) | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_euroc_slam -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_01 -c ../example/euroc/EuRoC_mono.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-out MH_01_mono.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_01_mono_slam.txt | |
mv track_times.txt ../artifact/track_times_MH_01_mono_slam.txt | |
../stella_vslam_examples/build/run_euroc_slam -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_01 -c ../EuRoC_mono_gtsam.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-out MH_01_mono_gtsam.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_01_mono_gtsam_slam.txt | |
mv track_times.txt ../artifact/track_times_MH_01_mono_gtsam_slam.txt | |
../stella_vslam_examples/build/run_euroc_slam -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_01 -c ../EuRoC_mono_sqlite3.yaml --frame-skip 2 --no-sleep --log-level=debug --map-db-out MH_01_mono_sqlite3.db --viewer=none | |
- name: SLAM test (stereo) with EuRoC MAV dataset (MH_01) | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_euroc_slam -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_01 -c ../example/euroc/EuRoC_stereo.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-out MH_01_stereo.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_01_stereo_slam.txt | |
mv track_times.txt ../artifact/track_times_MH_01_stereo_slam.txt | |
../stella_vslam_examples/build/run_euroc_slam -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_01 -c ../EuRoC_stereo_gtsam.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-out MH_01_stereo_gtsam.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_01_stereo_gtsam_slam.txt | |
mv track_times.txt ../artifact/track_times_MH_01_stereo_gtsam_slam.txt | |
- name: Localization test (monocular) with EuRoC MAV dataset (MH_01) | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_euroc_slam --disable-mapping -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_01 -c ../example/euroc/EuRoC_mono.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-in MH_01_mono.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_01_mono_localization.txt | |
mv track_times.txt ../artifact/track_times_MH_01_mono_localization.txt | |
../stella_vslam_examples/build/run_euroc_slam --temporal-mapping -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_01 -c ../EuRoC_mono_temporal_mapping.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-in MH_01_mono.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_01_mono_localization_temporal_mapping.txt | |
mv track_times.txt ../artifact/track_times_MH_01_mono_localization_temporal_mapping.txt | |
../stella_vslam_examples/build/run_euroc_slam --disable-mapping -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_01 -c ../EuRoC_mono_sqlite3.yaml --frame-skip 2 --no-sleep --log-level=debug --map-db-in MH_01_mono_sqlite3.db --viewer=none | |
- name: SLAM test (monocular) with EuRoC MAV dataset (MH_04) | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_euroc_slam -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_04 -c ../example/euroc/EuRoC_mono.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-out MH_04_mono.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_04_mono_slam.txt | |
mv track_times.txt ../artifact/track_times_MH_04_mono_slam.txt | |
- name: SLAM test (stereo) with EuRoC MAV dataset (MH_04) | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_euroc_slam -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_04 -c ../example/euroc/EuRoC_stereo.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-out MH_04_stereo.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_04_stereo_slam.txt | |
mv track_times.txt ../artifact/track_times_MH_04_stereo_slam.txt | |
- name: Localization test (monocular) with EuRoC MAV dataset (MH_04) | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_euroc_slam --disable-mapping -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_04 -c ../example/euroc/EuRoC_mono.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-in MH_04_mono.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_04_mono_localization.txt | |
mv track_times.txt ../artifact/track_times_MH_04_mono_localization.txt | |
../stella_vslam_examples/build/run_euroc_slam --temporal-mapping -v /datasets/orb_vocab/orb_vocab.fbow -d /datasets/EuRoC/MH_04 -c ../EuRoC_mono_temporal_mapping.yaml --frame-skip 2 --no-sleep --log-level=debug --eval-log-dir . --map-db-in MH_04_mono.msg --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_MH_04_mono_localization_temporal_mapping.txt | |
mv track_times.txt ../artifact/track_times_MH_04_mono_localization_temporal_mapping.txt | |
- name: download openvslam_test_dataset | |
run: | | |
curl -sL "https://github.com/stella-cv/openvslam_test_dataset/raw/main/openvslam_test_dataset.zip" -o openvslam_test_dataset.zip | |
unzip openvslam_test_dataset.zip | |
rm openvslam_test_dataset.zip | |
- name: make config for openvslam_test_dataset | |
run: | | |
sed -e 's/fps: .*/fps: 24.0/g' example/aist/equirectangular.yaml > equirectangular.yaml | |
- name: make config for gtsam backend | |
run: | | |
sed -e 's/backend: "g2o"/backend: "gtsam"/g' equirectangular.yaml > equirectangular_gtsam.yaml | |
- name: SLAM test with equirectangular dataset (1) | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_video_slam -v /datasets/orb_vocab/orb_vocab.fbow -m ../openvslam_test_dataset/1/equirectangular/video.mp4 -c ../equirectangular.yaml --no-sleep --log-level=debug --eval-log-dir . --map-db-out equirectangular_map.msg -t 0.0 --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_equirectangular_1.txt | |
mv track_times.txt ../artifact/track_times_equirectangular_1.txt | |
../stella_vslam_examples/build/run_video_slam -v /datasets/orb_vocab/orb_vocab.fbow -m ../openvslam_test_dataset/1/equirectangular/video.mp4 -c ../equirectangular_gtsam.yaml --no-sleep --log-level=debug --eval-log-dir . --map-db-out equirectangular_gtsam_map.msg -t 0.0 --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_equirectangular_gtsam_1.txt | |
mv track_times.txt ../artifact/track_times_equirectangular_gtsam_1.txt | |
- name: SLAM test with equirectangular dataset (2) | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_video_slam -v /datasets/orb_vocab/orb_vocab.fbow -m ../openvslam_test_dataset/2/equirectangular/video.mp4 -c ../equirectangular.yaml --no-sleep --log-level=debug --eval-log-dir . --map-db-out equirectangular_map.msg -t 0.0 --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_equirectangular_2.txt | |
mv track_times.txt ../artifact/track_times_equirectangular_2.txt | |
- name: SLAM test with equirectangular dataset (3) | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_video_slam -v /datasets/orb_vocab/orb_vocab.fbow -m ../openvslam_test_dataset/3/equirectangular/video.mp4 -c ../equirectangular.yaml --no-sleep --log-level=debug --eval-log-dir . --map-db-out equirectangular_map.msg -t 0.0 --viewer=none | |
mv frame_trajectory.txt ../artifact/frame_trajectory_equirectangular_3.txt | |
mv track_times.txt ../artifact/track_times_equirectangular_3.txt | |
- name: Evaluation | |
run: | | |
cp scripts/workflows/* . | |
( | |
echo '<details>' | |
echo '<summary>Track time and Relative pose error</summary>' | |
echo | |
echo '|dataset|track_time<br>(mean)|track_time<br>(median)|track_time<br>(max)|RPE<br>(mean)|RPE<br>(median)|RPE<br>(max)|RPE<br>(rmse)|RPE<br>(sse)|RPE<br>(std)|' | |
echo '|---|---|---|---|---|---|---|---|---|---|' | |
echo -n '| EuRoC MH_01 (SLAM, perspective, mono)' | |
bash track_time_print_row.bash artifact/track_times_MH_01_mono_slam.txt | |
bash evo_rpe_print_row.bash tum MH_01.tum artifact/frame_trajectory_MH_01_mono_slam.txt -as | |
echo '|' | |
echo -n '| EuRoC MH_01 (SLAM, perspective, mono, gtsam)' | |
bash track_time_print_row.bash artifact/track_times_MH_01_mono_gtsam_slam.txt | |
bash evo_rpe_print_row.bash tum MH_01.tum artifact/frame_trajectory_MH_01_mono_gtsam_slam.txt -as | |
echo '|' | |
echo -n '| EuRoC MH_01 (SLAM, perspective, stereo)' | |
bash track_time_print_row.bash artifact/track_times_MH_01_stereo_slam.txt | |
bash evo_rpe_print_row.bash tum MH_01.tum artifact/frame_trajectory_MH_01_stereo_slam.txt -a | |
echo '|' | |
echo -n '| EuRoC MH_01 (SLAM, perspective, stereo, gtsam)' | |
bash track_time_print_row.bash artifact/track_times_MH_01_stereo_gtsam_slam.txt | |
bash evo_rpe_print_row.bash tum MH_01.tum artifact/frame_trajectory_MH_01_stereo_gtsam_slam.txt -a | |
echo '|' | |
echo -n '| EuRoC MH_01 (Localization, perspective, mono)' | |
bash track_time_print_row.bash artifact/track_times_MH_01_mono_localization.txt | |
bash evo_rpe_print_row.bash tum MH_01.tum artifact/frame_trajectory_MH_01_mono_localization.txt -as | |
echo '|' | |
echo -n '| EuRoC MH_01 (Localization, perspective, mono, temporal mapping)' | |
bash track_time_print_row.bash artifact/track_times_MH_01_mono_localization_temporal_mapping.txt | |
bash evo_rpe_print_row.bash tum MH_01.tum artifact/frame_trajectory_MH_01_mono_localization_temporal_mapping.txt -as | |
echo '|' | |
echo -n '| EuRoC MH_04 (SLAM, perspective, mono)' | |
bash track_time_print_row.bash artifact/track_times_MH_04_mono_slam.txt | |
bash evo_rpe_print_row.bash tum MH_04.tum artifact/frame_trajectory_MH_04_mono_slam.txt -as | |
echo '|' | |
echo -n '| EuRoC MH_04 (SLAM, perspective, stereo)' | |
bash track_time_print_row.bash artifact/track_times_MH_04_stereo_slam.txt | |
bash evo_rpe_print_row.bash tum MH_04.tum artifact/frame_trajectory_MH_04_stereo_slam.txt -a | |
echo '|' | |
echo -n '| EuRoC MH_04 (Localization, perspective, mono)' | |
bash track_time_print_row.bash artifact/track_times_MH_04_mono_localization.txt | |
bash evo_rpe_print_row.bash tum MH_04.tum artifact/frame_trajectory_MH_04_mono_localization.txt -as | |
echo '|' | |
echo -n '| EuRoC MH_04 (Localization, perspective, mono, temporal mapping)' | |
bash track_time_print_row.bash artifact/track_times_MH_04_mono_localization_temporal_mapping.txt | |
bash evo_rpe_print_row.bash tum MH_04.tum artifact/frame_trajectory_MH_04_mono_localization_temporal_mapping.txt -as | |
echo '|' | |
echo -n '| openvslam_test_dataset 1 (SLAM, equirectangular, mono)' | |
bash track_time_print_row.bash artifact/track_times_equirectangular_1.txt | |
bash evo_rpe_print_row.bash tum openvslam_test_dataset/1/gt.tum artifact/frame_trajectory_equirectangular_1.txt -as | |
echo '|' | |
echo -n '| openvslam_test_dataset 1 (SLAM, equirectangular, mono, gtsam)' | |
bash track_time_print_row.bash artifact/track_times_equirectangular_gtsam_1.txt | |
bash evo_rpe_print_row.bash tum openvslam_test_dataset/1/gt.tum artifact/frame_trajectory_equirectangular_gtsam_1.txt -as | |
echo '|' | |
echo -n '| openvslam_test_dataset 2 (SLAM, equirectangular, mono)' | |
bash track_time_print_row.bash artifact/track_times_equirectangular_2.txt | |
bash evo_rpe_print_row.bash tum openvslam_test_dataset/2/gt.tum artifact/frame_trajectory_equirectangular_2.txt -as | |
echo '|' | |
echo -n '| openvslam_test_dataset 3 (SLAM, equirectangular, mono)' | |
bash track_time_print_row.bash artifact/track_times_equirectangular_3.txt | |
bash evo_rpe_print_row.bash tum openvslam_test_dataset/3/gt.tum artifact/frame_trajectory_equirectangular_3.txt -as | |
echo '|' | |
echo '</details>' | |
) >> artifact/result.md | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: artifact | |
path: artifact | |
build_tutorial: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
container: | |
image: ghcr.io/ymd-stella/stella-cv/stella_vslam:cv-4.x | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: cmake and make library | |
run: | | |
mkdir build | |
cd build | |
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DUSE_OPENMP=OFF .. | |
make -j $(($(nproc) / 2)) | |
make install | |
- uses: actions/checkout@v3 | |
with: | |
repository: stella-cv/stella_vslam_examples | |
path: stella_vslam_examples | |
submodules: recursive | |
- name: cmake and make examples | |
run: | | |
mkdir -p stella_vslam_examples/build | |
cd stella_vslam_examples/build | |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_STACK_TRACE_LOGGER=ON .. | |
make -j $(($(nproc) / 2)) | |
- name: download a dataset | |
run: | | |
cd build | |
gdown "https://drive.google.com/uc?id=1TXjREzkht3iRz__qVx4oYRW1GXsv37ct" -q | |
unzip video_for_ci_1.zip | |
rm video_for_ci_1.zip | |
- name: mapping test with the tutorial | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_video_slam -v /datasets/orb_vocab/orb_vocab.fbow -m ./video_for_ci_1/video.mp4 -c ../example/aist/equirectangular.yaml --frame-skip 3 --no-sleep --log-level=debug --eval-log-dir . --map-db-out map.msg --viewer=none | |
- name: localization test with the tutorial | |
run: | | |
cd build | |
../stella_vslam_examples/build/run_video_slam --disable-mapping -v /datasets/orb_vocab/orb_vocab.fbow -m ./video_for_ci_1/video.mp4 -c ../example/aist/equirectangular.yaml --frame-skip 3 --no-sleep --log-level=debug --eval-log-dir . --map-db-in map.msg --viewer=none | |
rosdep_humble: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
container: | |
image: ghcr.io/ymd-stella/stella-cv/ros:humble-ros-base | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: build ros2 packages | |
run: | | |
mkdir -p /ros_ws/src | |
cp -r . /ros_ws/src/stella_vslam | |
cd /ros_ws/ | |
rosdep update | |
apt update | |
rosdep install -y -i --from-paths src | |
export MAKEFLAGS="-j $(($(nproc) / 2))" | |
(source /opt/ros/${ROS_DISTRO}/setup.bash && colcon build --parallel-workers 1) |