Skip to content
Open

V1 #999

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d14e9e4
v1-1
w84305385-arch Mar 29, 2026
3bf7afd
v1-1
w84305385-arch Mar 29, 2026
e0ee5d2
v1-2
w84305385-arch Mar 29, 2026
8f81f7d
Remove large ORBvoc file to fix push error
w84305385-arch Mar 29, 2026
269a379
確認
w84305385-arch Mar 29, 2026
a12052e
確認git的人
b1022048 Mar 29, 2026
125e010
測試1
b1022048 Mar 30, 2026
1aac964
測試2
b1022048 Mar 30, 2026
cf1f799
watchdog測試
b1022048 Mar 30, 2026
b351f09
增加了TRACKING的watchdog功能
b1022048 Mar 31, 2026
78e8059
測試
b1022048 Apr 1, 2026
767d65b
v2
b1022048 Apr 1, 2026
222eca8
Merge branch 'v1' of https://github.com/b1022048/ORB_SLAM3 into v1
b1022048 Apr 1, 2026
c6c22a6
正常化
b1022048 Apr 1, 2026
f1b2f67
已做好tracking的database部分,接下來要試試看用AI做localmapping thread的部分
b1022048 Apr 1, 2026
825d3ef
tracking_log.csv
b1022048 Apr 1, 2026
69c0d33
Refresh git tracking to apply .gitignore
b1022048 Apr 1, 2026
9ca98ed
ignore .txt files
b1022048 Apr 1, 2026
e7e1aaf
新增 evaluation/fix_time.py
b1022048 Apr 2, 2026
5857c3e
新增名稱說明
b1022048 Apr 5, 2026
4b9bcc4
新增了懶人跑腳本,並且把之前的 log 檔案加入 git 管理,方便後續分析。
b1022048 Apr 5, 2026
4d2905e
小修一下gitignore
b1022048 Apr 5, 2026
e05d04d
穩定
b1022048 Apr 6, 2026
b5d3283
b1022048 Apr 6, 2026
6e1e833
加了MP的輸出
b1022048 Apr 6, 2026
e881e21
增加了flush
b1022048 Apr 6, 2026
a2067fa
local mapping: 最後印出存滑下來的KF數量,並且寫入csv檔,還有KF被cull掉的數量,寫入csv檔。新增README,腳…
b1022048 Apr 6, 2026
c589672
繼續測試腳本,修改了/Stereo/TUM-VI.yaml裡面的camera1
b1022048 Apr 7, 2026
1929392
穩定版1
b1022048 Apr 7, 2026
b0438cf
增加savemappoint的功能
b1022048 Apr 7, 2026
a3d8b6a
確保log檔會關掉,還時提取灰質的部分
b1022048 Apr 7, 2026
8a4e5a0
灰質獲取與計算
b1022048 Apr 7, 2026
4a077fc
灰質
b1022048 Apr 7, 2026
f01d874
用於收集、計算地圖點
b1022048 Apr 7, 2026
91b6970
將當前 KeyFrame(關鍵幀)中的灰度值 (Gray-scale value) 同步給 MapPoint(地圖點)
b1022048 Apr 7, 2026
d0b9f1f
修改了localmapping database的資訊
b1022048 Apr 8, 2026
a10f1a6
實現voxel
b1022048 Apr 8, 2026
bd7e59b
加了loopclosing的database,順便修一下localmapping的database
b1022048 Apr 8, 2026
484ca0a
用於測試關閉回環檢測功能yaml測試為mono+imu+tum-vi的
b1022048 Apr 13, 2026
ba38b09
新增功能 看tracking的匹配點
b1022048 Apr 19, 2026
06dd764
把data移植到media/lab405/Windows1/data,并修改路径
b1022048 Apr 19, 2026
eefe6f2
修正錯誤,在頻率那邊改成 200.0Hz
b1022048 Apr 19, 2026
6e904db
增加了loopClosing: 0用於開關loopClosing,並且修改了benchmark的測試
b1022048 Apr 19, 2026
126274c
在215行那邊新增一個開關用於關閉 loop closing
b1022048 Apr 19, 2026
52d3085
啟動原作者的時間計時工具
b1022048 Apr 19, 2026
ab60f5b
新增mCsvBAIters用於監控數值
b1022048 Apr 19, 2026
b48c9ea
讓KITTI正常運作
b1022048 Apr 19, 2026
19379f3
增加監測數值的跟一些註解
b1022048 Apr 19, 2026
84b1e7b
新增num_iters参数
b1022048 Apr 19, 2026
f7b31f6
加了註解跟新增了一些.md檔用於學習但沒有什麼用
b1022048 Apr 28, 2026
47e9a1a
讀IMU初始化用的
b1022048 May 3, 2026
b904bac
localmapping的IMU初始化的部分有加註解
b1022048 May 4, 2026
08c960a
跟IMU初始化有關的,不確定是否完全正確
b1022048 May 4, 2026
db6d9e1
腳本穩定版v1
b1022048 May 4, 2026
15e3331
加了一些註解並改變log.csv讀數值的位置
b1022048 May 4, 2026
c159233
可忽略
b1022048 May 4, 2026
fa71fd3
分析analyze_trajectory.py的東西
b1022048 May 7, 2026
6137239
更新ignore
b1022048 May 7, 2026
38559e9
讓github有csv
b1022048 May 14, 2026
727ca65
新增開關
b1022048 May 14, 2026
b92e0d8
更新csv
b1022048 May 14, 2026
b3288bd
更新csv
b1022048 May 14, 2026
216bd89
更新csv
b1022048 May 14, 2026
ef2f095
更新了local mapping csv的問題
b1022048 May 14, 2026
c902117
更新csv,設定opt
b1022048 May 14, 2026
05da3b4
更新LBA
b1022048 May 15, 2026
485eb62
1
b1022048 May 15, 2026
7259958
1
b1022048 May 15, 2026
e40d708
新增orb slam2的程式碼
b1022048 May 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .codex
Empty file.
662 changes: 662 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/include",
"/usr/include/opencv4",
"/usr/local/include/opencv4",
"/usr/include/eigen3"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
113 changes: 113 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Build

**First-time build** (builds Thirdparty libs + main library):
```bash
./build.sh
```

**Incremental rebuild** (after modifying `src/` or `include/`):
```bash
cd build && make -j4
```

**ROS nodes** (optional):
```bash
./build_ros.sh
```

The build produces `lib/libORB_SLAM3.so` and executables under `Examples/`.

## Running Examples

All executables take `Vocabulary/ORBvoc.txt` as first argument and a YAML config as second.

**Stereo-Inertial on EuRoC:**
```bash
./Examples/Stereo-Inertial/stereo_inertial_euroc \
Vocabulary/ORBvoc.txt Examples/Stereo-Inertial/EuRoC.yaml \
/path/to/EuRoC/MH_01_easy ./Examples/Stereo-Inertial/EuRoC_TimeStamps/MH01.txt dataset-MH01_stereo_inertial
```

**Stereo on EuRoC:**
```bash
./Examples/Stereo/stereo_euroc \
Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml \
/path/to/EuRoC/MH_01_easy ./Examples/Stereo/EuRoC_TimeStamps/MH01.txt dataset-MH01_stereo
```

Dataset paths on this machine:
- EuRoC: `/media/lab405/Windows1/data/Euroc`
- TUM-VI: `/media/lab405/Windows1/data/TUM`

## Evaluation / Benchmarking

The unified benchmark script runs all sensor configurations and computes APE RMSE via `evo_ape`:
```bash
cd evaluation

# All algorithms and datasets
python3 run_stereo_inertial_benchmark.py

# Filter by algorithm or dataset
python3 run_stereo_inertial_benchmark.py --algo stereo --dataset euroc
python3 run_stereo_inertial_benchmark.py --algo stereo_inertial
python3 run_stereo_inertial_benchmark.py --algo mono_inertial --dataset tum
```

Results are saved to `evaluation/benchmark_results_<timestamp>.csv`. The script:
1. Runs the binary
2. Converts timestamps ns→s via `fix_time.py`
3. Computes APE RMSE with `evo_ape`

`evaluation/ate_3d.py` is a 3D ATE evaluation script.

## Enabling Timing Profiling

Uncomment `#define REGISTER_TIMES` in `include/Config.h` (note: currently the file is a stub — the actual flag was used in the old code path), then rebuild. Stats are printed to terminal and saved to `ExecTimeMean.txt`.

## Architecture

ORB-SLAM3 is a **multi-threaded SLAM system** built around three parallel threads:

### Core Threads
- **Tracking** (`src/Tracking.cc`): Main thread. Receives each frame, extracts ORB features, estimates camera pose via motion model or relocalization, and decides when to insert KeyFrames.
- **LocalMapping** (`src/LocalMapping.cc`): Processes new KeyFrames — creates new MapPoints via triangulation, culls redundant KeyFrames, and runs Local BA (via `Optimizer`).
- **LoopClosing** (`src/LoopClosing.cc`): Detects loop closures using DBoW2 place recognition, computes Sim3 correction, runs Essential Graph optimization, and triggers full Bundle Adjustment.

### Key Data Structures
- **Atlas** (`src/Atlas.cc`): Container for multiple Maps. Enables multi-map SLAM — when tracking is lost, a new Map is created; loop closure can merge maps.
- **Map** / **MapPoint** / **KeyFrame**: The 3D map representation. MapPoints store 3D position and observations from multiple KeyFrames.
- **Frame**: A single image capture with extracted ORB features. Short-lived; converted to KeyFrame when selected.

### Optimization (`src/Optimizer.cc`)
All non-linear optimization uses **g2o** (included in `Thirdparty/g2o`). Key functions:
- `PoseOptimization` — single-frame pose-only BA
- `LocalBundleAdjustment` — local map BA triggered by LocalMapping; the `num_iters` parameter has been added to this fork for monitoring
- `OptimizeEssentialGraph` — loop closure correction
- `GlobalBundleAdjustemnt` — full map BA after loop closure

### IMU Integration
`src/ImuTypes.cc` and `include/ImuTypes.h` define IMU preintegration. `src/G2oTypes.cc` defines the g2o edge/vertex types for visual-inertial optimization. IMU initialization happens in Tracking and is refined in LocalMapping.

### Camera Models
`include/CameraModels/`: `Pinhole` (standard) and `KannalaBrandt8` (fisheye). Both inherit from `GeometricCamera`. The active model is selected based on the YAML config `Camera.type` field.

### Settings / Config
`src/Settings.cc` parses YAML config files (OpenCV `FileStorage`). Each YAML in `Examples/*/` corresponds to a specific sensor+dataset combination. IMU noise parameters and camera intrinsics/extrinsics live there.

### Vocabulary
`Vocabulary/ORBvoc.txt` is the prebuilt DBoW2 vocabulary (decompressed from `ORBvoc.txt.tar.gz` by `build.sh`). Required at runtime — do not delete.

## Modified Files in This Fork

This fork adds monitoring/logging capabilities:
- `src/Tracking.cc` — instrumentation additions
- `src/Optimizer.cc` — `num_iters` parameter for `LocalBundleAdjustment`, monitoring output
- `Examples/Stereo-Inertial/TUM-VI_far.yaml` — tuned config for far-range TUM-VI
- `Examples/Stereo/EuRoC.yaml` — tuned stereo config

CSV logs (`localmapping_log.csv`, `tracking_log.csv`) are written during runs for analysis. `map_points_total` = current map point count; `new_map_points` = points attempted in a given frame.
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.10)
project(ORB_SLAM3)

IF(NOT CMAKE_BUILD_TYPE)
Expand All @@ -14,18 +14,19 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native")

# Check C++11 or C++0x support
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

if(COMPILER_SUPPORTS_CXX14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-maybe-uninitialized -w")
add_definitions(-DCOMPILEDWITHC14)
message(STATUS "Using flag -std=c++14.")
elseif(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-maybe-uninitialized -w")
add_definitions(-DCOMPILEDWITHC11)
message(STATUS "Using flag -std=c++11.")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
add_definitions(-DCOMPILEDWITHC0X)
message(STATUS "Using flag -std=c++0x.")
else()
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11/C++14 support. Please use a different C++ compiler.")
endif()

LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
Expand Down
2 changes: 1 addition & 1 deletion Examples/Monocular-Inertial/TUM-VI.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%YAML:1.0

loopClosing: 0
#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Examples/Monocular-Inertial/TUM-VI_far.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ IMU.NoiseGyro: 0.00016 # 0.004 (VINS) # 0.00016 (TUM) # 0.00016 # rad/s^0.5
IMU.NoiseAcc: 0.0028 # 0.04 (VINS) # 0.0028 (TUM) # 0.0028 # m/s^1.5
IMU.GyroWalk: 0.000022 # 0.000022 (VINS and TUM) rad/s^1.5
IMU.AccWalk: 0.00086 # 0.0004 (VINS) # 0.00086 # 0.00086 # m/s^2.5
IMU.Frequency: 200
IMU.Frequency: 200.0
System.thFarPoints: 20.0

#--------------------------------------------------------------------------------------------
Expand Down
12 changes: 7 additions & 5 deletions Examples/Monocular-Inertial/mono_inertial_euroc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int main(int argc, char *argv[])
cout.precision(17);

// Create SLAM system. It initializes all system threads and gets ready to process frames.
ORB_SLAM3::System SLAM(argv[1],argv[2],ORB_SLAM3::System::IMU_MONOCULAR, true);
ORB_SLAM3::System SLAM(argv[1],argv[2],ORB_SLAM3::System::IMU_MONOCULAR, false);
float imageScale = SLAM.GetImageScale();

double t_resize = 0.f;
Expand Down Expand Up @@ -151,7 +151,7 @@ int main(int argc, char *argv[])
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_Start_Resize = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_Start_Resize = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_Start_Resize = std::chrono::steady_clock::now();
#endif
#endif
int width = im.cols * imageScale;
Expand All @@ -161,7 +161,7 @@ int main(int argc, char *argv[])
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_End_Resize = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_End_Resize = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_End_Resize = std::chrono::steady_clock::now();
#endif
t_resize = std::chrono::duration_cast<std::chrono::duration<double,std::milli> >(t_End_Resize - t_Start_Resize).count();
SLAM.InsertResizeTime(t_resize);
Expand All @@ -187,7 +187,7 @@ int main(int argc, char *argv[])
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t1 = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t1 = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t1 = std::chrono::steady_clock::now();
#endif

// Pass the image to the SLAM system
Expand All @@ -197,7 +197,7 @@ int main(int argc, char *argv[])
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t2 = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t2 = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t2 = std::chrono::steady_clock::now();
#endif

#ifdef REGISTER_TIMES
Expand Down Expand Up @@ -239,11 +239,13 @@ int main(int argc, char *argv[])
const string f_file = "f_" + string(argv[argc-1]) + ".txt";
SLAM.SaveTrajectoryEuRoC(f_file);
SLAM.SaveKeyFrameTrajectoryEuRoC(kf_file);
SLAM.SaveMapPoints(string(argv[argc-1]) + "_mappoints.txt");
}
else
{
SLAM.SaveTrajectoryEuRoC("CameraTrajectory.txt");
SLAM.SaveKeyFrameTrajectoryEuRoC("KeyFrameTrajectory.txt");
SLAM.SaveMapPoints("mappoints.txt");
}

return 0;
Expand Down
10 changes: 5 additions & 5 deletions Examples/Monocular-Inertial/mono_inertial_realsense_D435i.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ int main(int argc, char **argv) {
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point time_Start_Process = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point time_Start_Process = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point time_Start_Process = std::chrono::steady_clock::now();
#endif

if(count_im_buffer>1)
Expand Down Expand Up @@ -368,7 +368,7 @@ int main(int argc, char **argv) {
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_Start_Resize = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_Start_Resize = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_Start_Resize = std::chrono::steady_clock::now();
#endif
#endif
int width = im.cols * imageScale;
Expand All @@ -378,7 +378,7 @@ int main(int argc, char **argv) {
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_End_Resize = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_End_Resize = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_End_Resize = std::chrono::steady_clock::now();
#endif
t_resize = std::chrono::duration_cast<std::chrono::duration<double,std::milli> >(t_End_Resize - t_Start_Resize).count();
SLAM.InsertResizeTime(t_resize);
Expand All @@ -389,7 +389,7 @@ int main(int argc, char **argv) {
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_Start_Track = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_Start_Track = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_Start_Track = std::chrono::steady_clock::now();
#endif
#endif
// Pass the image to the SLAM system
Expand All @@ -398,7 +398,7 @@ int main(int argc, char **argv) {
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_End_Track = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_End_Track = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_End_Track = std::chrono::steady_clock::now();
#endif
t_track = t_resize + std::chrono::duration_cast<std::chrono::duration<double,std::milli> >(t_End_Track - t_Start_Track).count();
SLAM.InsertTrackTime(t_track);
Expand Down
10 changes: 5 additions & 5 deletions Examples/Monocular-Inertial/mono_inertial_realsense_t265.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int main(int argc, char **argv)
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point time_Start_Process = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point time_Start_Process = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point time_Start_Process = std::chrono::steady_clock::now();
#endif

if(count_im_buffer>1)
Expand All @@ -260,7 +260,7 @@ int main(int argc, char **argv)
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_Start_Resize = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_Start_Resize = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_Start_Resize = std::chrono::steady_clock::now();
#endif
#endif
int width = imCV.cols * imageScale;
Expand All @@ -270,7 +270,7 @@ int main(int argc, char **argv)
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_End_Resize = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_End_Resize = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_End_Resize = std::chrono::steady_clock::now();
#endif
t_resize = std::chrono::duration_cast<std::chrono::duration<double,std::milli> >(t_End_Resize - t_Start_Resize).count();
SLAM.InsertResizeTime(t_resize);
Expand Down Expand Up @@ -311,15 +311,15 @@ int main(int argc, char **argv)
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_Start_Track = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_Start_Track = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_Start_Track = std::chrono::steady_clock::now();
#endif
// Pass the image to the SLAM system
SLAM.TrackMonocular(im, timestamp, vImuMeas);

#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_End_Track = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_End_Track = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_End_Track = std::chrono::steady_clock::now();
#endif

#ifdef REGISTER_TIMES
Expand Down
12 changes: 7 additions & 5 deletions Examples/Monocular-Inertial/mono_inertial_tum_vi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int main(int argc, char **argv)
cout << "IMU data in the sequence: " << nImu << endl << endl;*/

// Create SLAM system. It initializes all system threads and gets ready to process frames.
ORB_SLAM3::System SLAM(argv[1],argv[2],ORB_SLAM3::System::IMU_MONOCULAR, true, 0, file_name);
ORB_SLAM3::System SLAM(argv[1],argv[2],ORB_SLAM3::System::IMU_MONOCULAR, false, 0, file_name);
float imageScale = SLAM.GetImageScale();

double t_resize = 0.f;
Expand Down Expand Up @@ -175,7 +175,7 @@ int main(int argc, char **argv)
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_Start_Resize = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_Start_Resize = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_Start_Resize = std::chrono::steady_clock::now();
#endif
#endif
int width = im.cols * imageScale;
Expand All @@ -185,7 +185,7 @@ int main(int argc, char **argv)
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t_End_Resize = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t_End_Resize = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t_End_Resize = std::chrono::steady_clock::now();
#endif
t_resize = std::chrono::duration_cast<std::chrono::duration<double,std::milli> >(t_End_Resize - t_Start_Resize).count();
SLAM.InsertResizeTime(t_resize);
Expand All @@ -198,7 +198,7 @@ int main(int argc, char **argv)
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t1 = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t1 = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t1 = std::chrono::steady_clock::now();
#endif

// Pass the image to the SLAM system
Expand All @@ -208,7 +208,7 @@ int main(int argc, char **argv)
#ifdef COMPILEDWITHC11
std::chrono::steady_clock::time_point t2 = std::chrono::steady_clock::now();
#else
std::chrono::monotonic_clock::time_point t2 = std::chrono::monotonic_clock::now();
std::chrono::steady_clock::time_point t2 = std::chrono::steady_clock::now();
#endif

#ifdef REGISTER_TIMES
Expand Down Expand Up @@ -257,11 +257,13 @@ int main(int argc, char **argv)
const string f_file = "f_" + string(argv[argc-1]) + ".txt";
SLAM.SaveTrajectoryEuRoC(f_file);
SLAM.SaveKeyFrameTrajectoryEuRoC(kf_file);
SLAM.SaveMapPoints(string(argv[argc-1]) + "_mappoints.txt");
}
else
{
SLAM.SaveTrajectoryEuRoC("CameraTrajectory.txt");
SLAM.SaveKeyFrameTrajectoryEuRoC("KeyFrameTrajectory.txt");
SLAM.SaveMapPoints("mappoints.txt");
}

sort(vTimesTrack.begin(),vTimesTrack.end());
Expand Down
Loading