Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating orbslam3 v1 support #1152

Merged
merged 7 commits into from
Nov 19, 2023
Merged

Updating orbslam3 v1 support #1152

merged 7 commits into from
Nov 19, 2023

Conversation

matlabbe
Copy link
Member

@matlabbe matlabbe commented Oct 30, 2023

Address #886

Current issues when enabling IMU (tested with Realsense2 D435i):

TODO:

  • Expose IMU parameters
  • Make sure ORB_SLAM2 version still work after refactoring

Changes made upstream (ORB_SLAM3) to work on Ubuntu 20.04:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 016e743..5321227 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,9 +14,15 @@ 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)
+if(COMPILER_SUPPORTS_CXX14)
+   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
+   add_definitions(-DCOMPILEDWITHC14)
+   add_definitions(-DCOMPILEDWITHC11)
+   message(STATUS "Using flag -std=c++14.")
+elseif(COMPILER_SUPPORTS_CXX11)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
    add_definitions(-DCOMPILEDWITHC11)
    message(STATUS "Using flag -std=c++11.")
@@ -30,9 +36,9 @@ endif()
 
 LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules)
 
-find_package(OpenCV 4.4)
+find_package(OpenCV 4.2)
    if(NOT OpenCV_FOUND)
-      message(FATAL_ERROR "OpenCV > 4.4 not found.")
+      message(FATAL_ERROR "OpenCV >= 4.2 not found.")
    endif()
 
 MESSAGE("OPENCV VERSION:")

@matlabbe matlabbe merged commit aaff1ab into master Nov 19, 2023
7 checks passed
@matlabbe matlabbe deleted the updating_orbslam3_v1_support branch November 19, 2023 09:05
@matlabbe
Copy link
Member Author

Related issues:
#655
#1104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant