From e06b505ad977a591fd019dd3c2e50633eaeeecd6 Mon Sep 17 00:00:00 2001 From: PodmogilnyjIvan Date: Sun, 5 Dec 2021 14:16:24 -0800 Subject: [PATCH] append readme --- .gitignore | 1 + CMakeLists.txt | 62 -------------------------------------------- README.md | 70 +++++++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 64 insertions(+), 69 deletions(-) diff --git a/.gitignore b/.gitignore index e161f99..489b2ba 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ cmake-build-debug/ *.pyc *.osa +*.lib diff --git a/CMakeLists.txt b/CMakeLists.txt index 512e2aa..f723bee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,66 +145,4 @@ ${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so ### Build examples # RGB-D examples -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/RGB-D) - -add_executable(rgbd_tum -Examples/RGB-D/rgbd_tum.cc) -target_link_libraries(rgbd_tum ${PROJECT_NAME}) - - -# Stereo examples -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Stereo) - -add_executable(stereo_kitti -Examples/Stereo/stereo_kitti.cc) -target_link_libraries(stereo_kitti ${PROJECT_NAME}) - -add_executable(stereo_euroc -Examples/Stereo/stereo_euroc.cc) -target_link_libraries(stereo_euroc ${PROJECT_NAME}) - -add_executable(stereo_tum_vi -Examples/Stereo/stereo_tum_vi.cc) -target_link_libraries(stereo_tum_vi ${PROJECT_NAME}) - -# Monocular examples -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Monocular) - -add_executable(mono_tum -Examples/Monocular/mono_tum.cc) -target_link_libraries(mono_tum ${PROJECT_NAME}) - -add_executable(mono_kitti -Examples/Monocular/mono_kitti.cc) -target_link_libraries(mono_kitti ${PROJECT_NAME}) - -add_executable(mono_euroc -Examples/Monocular/mono_euroc.cc) -target_link_libraries(mono_euroc ${PROJECT_NAME}) - -add_executable(mono_tum_vi -Examples/Monocular/mono_tum_vi.cc) -target_link_libraries(mono_tum_vi ${PROJECT_NAME}) - -# Monocular-Inertial examples -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Monocular-Inertial) - -add_executable(mono_inertial_euroc -Examples/Monocular-Inertial/mono_inertial_euroc.cc) -target_link_libraries(mono_inertial_euroc ${PROJECT_NAME}) - -add_executable(mono_inertial_tum_vi -Examples/Monocular-Inertial/mono_inertial_tum_vi.cc) -target_link_libraries(mono_inertial_tum_vi ${PROJECT_NAME}) - -# Stereo-Inertial examples -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/Examples/Stereo-Inertial) - -add_executable(stereo_inertial_euroc -Examples/Stereo-Inertial/stereo_inertial_euroc.cc) -target_link_libraries(stereo_inertial_euroc ${PROJECT_NAME}) - -add_executable(stereo_inertial_tum_vi -Examples/Stereo-Inertial/stereo_inertial_tum_vi.cc) -target_link_libraries(stereo_inertial_tum_vi ${PROJECT_NAME}) diff --git a/README.md b/README.md index b275707..e9d578e 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,74 @@ -Билд на Виндоус 10. +# Changed version of ORB_SLAM3 for Windows 10. +Project is provided with already built ORB_SLAM3.lib library. You might want to skip the build part and put the library from `lib/ORB_SLAM3.lib` to `build/Release/ORB_SLAM3.lib` -## Попытка забилдить Pangolin and g2o: +## Prerequisites +- OpenCV3 (Not from Anaconda): https://opencv.org/releases/ +- Boost (You need to build it): https://www.boost.org/users/download/ +- Eigen3. You can install it using vcpkg + +### Note on Preferences of projects in Visual Studio 2019 +1. You may need to change the Runtime Library of the project frequently. In order to do that, you need to open Preferences -> C/C++ -> Code Generation -> Runtime Library -> MT. +Further the procedure above will be mentioned just as "Change the Runtime Library to MT" + +2. You may also need to change a lot of the libraries to Static. In order to do that, you need to: General -> Configuration Type -> Static lib (.lib). And in Advanced -> Target File Extension -> .lib +Further this procedure will be mentioned as "Change the project to Static" + +3. All of the commands must be executed in the Windows cmd. + +## Build Boost +1. `bootstrap.bat` +2. `.\b2 runtime-link=static` + +## Build DBoW2 +1. `mkdir build && cd build` +2. `cmake ..` +3. Open Visual Studio 16 2019 with Administrative privilege and open the project +4. Change the Runtiime Library to MT +5. Change the project to Static +6. Build ALL_BUILD + +## Build g2o +1. Install Eigen3: `vcpkg install eigen3:x64-windows` +2. `mkdir build && cd build` +3. `cmake -DCMAKE_TOOLCHAIN_FILE=C:/Users/ivan/Source/Repos/ORB_SLAM3/Thirdparty/Pangolin/vcpkg/scripts/buildsystems/vcpkg.cmake ..` Instead of my path, you have to paste your path to `vcpkg.cmake`. Or you may download and configure Eigen3 with CMake. No need to to build. You will just need to include the path to Eigen3. +4. Open Visual Studio 16 2019 with Administrative privilege and open the project +5. Change the Runtiime Library to MT +6. Change the project to Static +7. Build ALL_BUILD + +## Build Pangolin +1. `mkdir build && cd build` +2. `cmake ..` +3. Open Visual Studio 16 2019 with Administrative (IMPORTANT!) privilege and open the project +4. Change the Runtiime Library to MT +5. Change the project to Static +6. Build project pangolin + +## Build ORB_SLAM3 +1. `mkdir build && cd build` +2. `cmake ..` +3. Open Visual Studio 16 2019 with Administrative (IMPORTANT!) privilege and open the project +4. Change the Runtiime Library to MT +5. Change the project to Static +6. Add the path to vcpkg include: C/C++ -> Additional Include Libraries -> C:\Users\ivan\Source\Repos\ORB_SLAM3\Thirdparty\Pangolin\vcpkg\installed\x64-windows\include +7. You might need to add path to Boost libs manually to Libraian → General → Additional Library Dependencies: C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\Thirdparty\boost_1_77_0\stage\lib +7. Build ORB_SLAM3 project. + +# ----- Log. ----- + +## Попытка забилдить Pangolin and g2o: 1. Включены права андминистратора -2. Ошибка [undefined reference to `vasprintf' · Issue #1954 · esp8266/Arduino (github.com)](https://github.com/esp8266/Arduino/issues/1954) . Фикс и билд библиотеки .dll сработал. +2. Ошибка [undefined reference to `vasprintf' · Issue #1954 · esp8266/Arduino (github.com)](https://github.com/esp8266/Arduino/issues/1954) . Фикс и билд библиотеки .dll сработал. ## После успешного билда Pangolin, g2o and DBoW2 пробуем билд ORB_SLAM3: 1. Ошибка undefined usleep: определите функцию [c++, usleep() is obsolete, workarounds for Windows/MingW? - Stack Overflow](https://stackoverflow.com/questions/5801813/c-usleep-is-obsolete-workarounds-for-windows-mingw/17283549) -2. Установите vcpkg и включите его vcpkg integrate install +2. Установите vcpkg и включите его vcpkg integrate install 3. Ошибка с OpenCV из Anaconda: попытка переключить на OpenCV3 (c VC15) -4. Ошибка cannot open include file openssl/md5.h нужно отдельно прописывать в инклуде CMake? Попытка: ручная прописка в Additional Include Directories +4. Ошибка cannot open include file openssl/md5.h нужно отдельно прописывать в инклуде CMake? Попытка: ручная прописка в Additional Include Directories 5. Добавлены изменения в ORB_SLAM3 в код [MapPoint.cc](http://MapPoint.cc), пожалуйста, используйте мой исправленный код для билда -6. Namespace changed from std::tr1 to std. +6. Namespace changed from std::tr1 to std. 7. Test: Linker → Additional Include Directories C:\Users\ivan\Source\Repos\ORB_SLAM3\build; C:\Users\ivan\Source\Repos\ORB_SLAM3\build\Release 8. Автоматическое появление Release\ORB_SLAM3.lib ??????? 9. Определение usleep в [System.cc](http://System.cc) и System.hpp @@ -24,4 +80,4 @@ 2. Static Library 3. Add (path to vcpkg) manually to Additional Include Directories C:\Users\ivan\Source\Repos\ORB_SLAM3\Thirdparty\Pangolin\vcpkg\installed\x64-windows\include 4. Add path to Boost libs manually to Linker → General → Additional Library Dependencies: C:\Users\ivan\Source\Repos\ORB-SLAM3forWindows\Thirdparty\boost_1_77_0\stage\lib -5. From Linker → Input → Additional Dependencies delete Release\oscpack.lib \ No newline at end of file +5. From Linker → Input → Additional Dependencies delete Release\oscpack.lib