diff --git a/ports/rtabmap/0003-fix-qt.patch b/ports/rtabmap/0003-fix-qt.patch deleted file mode 100644 index facc1ffe8f4dd6..00000000000000 --- a/ports/rtabmap/0003-fix-qt.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -966,13 +966,13 @@ IF(ANDROID) - IF(BUILD_APP) - ADD_SUBDIRECTORY( app ) - ENDIF(BUILD_APP) -+ELSEIF(NOT WITH_QT) -+ MESSAGE(WARNING "the GUI lib and the stand-alone application will not be compiled...") - ELSEIF(Qt5_FOUND OR (QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND)) - ADD_SUBDIRECTORY( guilib ) - IF(BUILD_APP) - ADD_SUBDIRECTORY( app ) - ENDIF(BUILD_APP) --ELSEIF(WITH_QT) -- MESSAGE(WARNING "Qt not found, the GUI lib and the stand-alone application will not be compiled...") - ENDIF() - - IF(BUILD_TOOLS) diff --git a/ports/rtabmap/cpp17.patch b/ports/rtabmap/cpp17.patch deleted file mode 100644 index d595f89eef982a..00000000000000 --- a/ports/rtabmap/cpp17.patch +++ /dev/null @@ -1,152 +0,0 @@ -diff --git a/corelib/src/SimpleIni.h b/corelib/src/SimpleIni.h -index 3fccf9dc1..e787be813 100644 ---- a/corelib/src/SimpleIni.h -+++ b/corelib/src/SimpleIni.h -@@ -324,7 +324,10 @@ public: - #endif - - /** Strict less ordering by name of key only */ -- struct KeyOrder : std::binary_function { -+ struct KeyOrder { -+ using result_type = bool; -+ using first_argument_type = Entry; -+ using second_argument_type = Entry; - bool operator()(const Entry & lhs, const Entry & rhs) const { - const static SI_STRLESS isLess = SI_STRLESS(); - return isLess(lhs.pItem, rhs.pItem); -@@ -332,7 +335,10 @@ public: - }; - - /** Strict less ordering by order, and then name of key */ -- struct LoadOrder : std::binary_function { -+ struct LoadOrder { -+ using result_type = bool; -+ using first_argument_type = Entry; -+ using second_argument_type = Entry; - bool operator()(const Entry & lhs, const Entry & rhs) const { - if (lhs.nOrder != rhs.nOrder) { - return lhs.nOrder < rhs.nOrder; -diff --git a/corelib/src/rtflann/algorithms/dist.h b/corelib/src/rtflann/algorithms/dist.h -index a286f1eea..6456eb25b 100644 ---- a/corelib/src/rtflann/algorithms/dist.h -+++ b/corelib/src/rtflann/algorithms/dist.h -@@ -517,6 +517,7 @@ struct HammingPopcnt - result += __builtin_popcountll(a_final ^ b_final); - } - #else -+ typedef unsigned long long pop_t; - HammingLUT lut; - result = lut(reinterpret_cast (a), - reinterpret_cast (b), size * sizeof(pop_t)); -diff --git a/corelib/src/rtflann/algorithms/kdtree_index.h b/corelib/src/rtflann/algorithms/kdtree_index.h -index c2ab18864..407233770 100644 ---- a/corelib/src/rtflann/algorithms/kdtree_index.h -+++ b/corelib/src/rtflann/algorithms/kdtree_index.h -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include - - #include "rtflann/general.h" - #include "rtflann/algorithms/nn_index.h" -@@ -675,9 +676,11 @@ protected: - - tree_roots_.resize(trees_); - /* Construct the randomized trees. */ -+ std::random_device rd; -+ std::mt19937 g(rd()); - for (int i = 0; i < trees_; i++) { - /* Randomize the order of vectors to allow for unbiased sampling. */ -- std::random_shuffle(ind.begin(), ind.end()); -+ std::shuffle(ind.begin(), ind.end(),g); - tree_roots_[i] = divideTree(&ind[0], int(size_) ); - } - delete[] mean_; -diff --git a/corelib/src/rtflann/util/heap.h b/corelib/src/rtflann/util/heap.h -index b104ee3ae..a9b50550c 100644 ---- a/corelib/src/rtflann/util/heap.h -+++ b/corelib/src/rtflann/util/heap.h -@@ -115,8 +115,11 @@ public: - count = 0; - } - -- struct CompareT : public std::binary_function -+ struct CompareT - { -+ using result_type = bool; -+ using first_argument_type = T; -+ using second_argument_type = T; - bool operator()(const T& t_1, const T& t_2) const - { - return t_2 < t_1; -diff --git a/corelib/src/rtflann/util/lsh_table.h b/corelib/src/rtflann/util/lsh_table.h -index 974bb9e44..5389dc743 100644 ---- a/corelib/src/rtflann/util/lsh_table.h -+++ b/corelib/src/rtflann/util/lsh_table.h -@@ -39,6 +39,7 @@ - #include - #include - #include -+#include - // TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP - #if RTFLANN_USE_UNORDERED_MAP - #include -@@ -362,9 +363,11 @@ inline LshTable::LshTable(unsigned int feature_size, unsigned int - mask_ = std::vector((size_t)ceil((float)(feature_size * sizeof(char)) / (float)sizeof(size_t)), 0); - - // A bit brutal but fast to code -+ std::random_device rd; -+ std::mt19937 g(rd()); - std::vector indices(feature_size * CHAR_BIT); - for (size_t i = 0; i < feature_size * CHAR_BIT; ++i) indices[i] = i; -- std::random_shuffle(indices.begin(), indices.end()); -+ std::shuffle(indices.begin(), indices.end(),g); - - // Generate a random set of order of subsignature_size_ bits - for (unsigned int i = 0; i < key_size_; ++i) { -diff --git a/corelib/src/rtflann/util/random.h b/corelib/src/rtflann/util/random.h -index 871c9d15f..5d96ac273 100644 ---- a/corelib/src/rtflann/util/random.h -+++ b/corelib/src/rtflann/util/random.h -@@ -35,6 +35,7 @@ - #include - #include - #include -+#include - - #include "rtflann/general.h" - -@@ -75,14 +76,6 @@ inline int rand_int(int high = RAND_MAX, int low = 0) - return low + (int) ( double(high-low) * (std::rand() / (RAND_MAX + 1.0))); - } - -- --class RandomGenerator --{ --public: -- ptrdiff_t operator() (ptrdiff_t i) { return rand_int(i); } --}; -- -- - /** - * Random number generator that returns a distinct number from - * the [0,n) interval each time. -@@ -110,14 +103,15 @@ public: - */ - void init(int n) - { -- static RandomGenerator generator; - // create and initialize an array of size n - vals_.resize(n); - size_ = n; - for (int i = 0; i < size_; ++i) vals_[i] = i; - - // shuffle the elements in the array -- std::random_shuffle(vals_.begin(), vals_.end(), generator); -+ std::random_device rd; -+ std::mt19937 g(rd()); -+ std::shuffle(vals_.begin(), vals_.end(), g); - - counter_ = 0; - } diff --git a/ports/rtabmap/fix-CMake-export.patch b/ports/rtabmap/fix-CMake-export.patch deleted file mode 100644 index 810ec1671b9b33..00000000000000 --- a/ports/rtabmap/fix-CMake-export.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ef02aa0..32a1e38 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1656,3 +1656,22 @@ MESSAGE(SEND_ERROR "No graph optimizer found! You should have at least one of th - ENDIF(NOT GTSAM_FOUND AND NOT G2O_FOUND AND NOT WITH_TORO AND NOT WITH_CERES AND NOT CERES_FOUND) - - # vim: set et ft=cmake fenc=utf-8 ff=unix sts=0 sw=2 ts=2 : -+ -+SET(install_targets rtabmap_utilite rtabmap_core) -+TARGET_INCLUDE_DIRECTORIES(rtabmap_utilite INTERFACE $) -+TARGET_INCLUDE_DIRECTORIES(rtabmap_core INTERFACE $) -+INSTALL(TARGETS ${install_targets} EXPORT unofficial-rtabmap-config) -+ -+INSTALL(EXPORT unofficial-rtabmap-config -+ NAMESPACE unofficial::rtabmap:: -+ DESTINATION share/unofficial-rtabmap -+ FILE unofficial-rtabmap-config.cmake -+) -+ -+INCLUDE(CMakePackageConfigHelpers) -+write_basic_package_version_file( -+ "${CMAKE_CURRENT_BINARY_DIR}/unofficial-rtabmapConfigVersion.cmake" -+ VERSION ${PROJECT_VERSION} -+ COMPATIBILITY SameMajorVersion) -+ -+INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-rtabmapConfigVersion.cmake" DESTINATION "share/unofficial-rtabmap") diff --git a/ports/rtabmap/fix_autouic.patch b/ports/rtabmap/fix_autouic.patch new file mode 100644 index 00000000000000..540642dd3a811f --- /dev/null +++ b/ports/rtabmap/fix_autouic.patch @@ -0,0 +1,15 @@ +diff --git a/guilib/src/CMakeLists.txt b/guilib/src/CMakeLists.txt +index 349f6f9e..ac54b0f2 100644 +--- a/guilib/src/CMakeLists.txt ++++ b/guilib/src/CMakeLists.txt +@@ -60,6 +60,10 @@ SET(qrc + ./GuiLib.qrc + ) + ++set(CMAKE_AUTOMOC OFF) ++set(CMAKE_AUTORCC OFF) ++set(CMAKE_AUTOUIC OFF) ++ + IF(QT4_FOUND) + # generate rules for building source files from the resources + QT4_ADD_RESOURCES(srcs_qrc ${qrc}) diff --git a/ports/rtabmap/fix_qt_deploy_plugins.patch b/ports/rtabmap/fix_qt_deploy_plugins.patch new file mode 100644 index 00000000000000..979ee8313d2889 --- /dev/null +++ b/ports/rtabmap/fix_qt_deploy_plugins.patch @@ -0,0 +1,20 @@ +diff --git a/app/src/CMakeLists.txt b/app/src/CMakeLists.txt +index f0cef72c..f007eb83 100644 +--- a/app/src/CMakeLists.txt ++++ b/app/src/CMakeLists.txt +@@ -53,7 +53,14 @@ ENDIF() + INSTALL(TARGETS rtabmap_app + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime + BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}" COMPONENT runtime) +- ++ ++qt_generate_deploy_app_script( ++ TARGET rtabmap_app ++ FILENAME_VARIABLE deploy_script ++ NO_UNSUPPORTED_PLATFORM_ERROR ++) ++install(SCRIPT ${deploy_script}) ++ + IF(APPLE AND BUILD_AS_BUNDLE) + INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" ${PROJECT_NAME} + WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)") diff --git a/ports/rtabmap/portfile.cmake b/ports/rtabmap/portfile.cmake index 5a13bcf4080d34..710db46e5ad6eb 100644 --- a/ports/rtabmap/portfile.cmake +++ b/ports/rtabmap/portfile.cmake @@ -3,44 +3,53 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO introlab/rtabmap - # rtabmap stops releasing, check their CMakeLists.txt for version. - # currently is 0.20.23 - REF 95e6a9f03936697a60be2c26e119c519e47c11f5 - SHA512 082af7e15316bdeb89ff833a87a91916ddbf85de56bf4f38a0b5a40f4f330ecc057ae72a2f5ec901824e51d6f73c4a05a328116eaa5529551ffe4ca770fe0474 + REF 0.21.0 + SHA512 47fa00e760cd9089d42dc27cc0120f2dc2ad4b32b6a05e87fb5320fd6fe3971e68958984714895640989543be9252fd0fb96ccebf0d00d70afbad224022a7a53 HEAD_REF master PATCHES - 0003-fix-qt.patch - cpp17.patch - fix-CMake-export.patch + fix_qt_deploy_plugins.patch + fix_autouic.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + gui WITH_QT + octomap WITH_OCTOMAP + realsense2 WITH_REALSENSE2 + k4w2 WITH_K4W2 + openni2 WITH_OPENNI2 +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS REL_FEATURE_OPTIONS FEATURES tools BUILD_TOOLS + tools BUILD_APP ) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" DISABLE_PARALLEL_CONFIGURE + OPTIONS_DEBUG + -DBUILD_TOOLS=OFF + -DBUILD_APP=OFF + OPTIONS_RELEASE + ${REL_FEATURE_OPTIONS} OPTIONS ${FEATURE_OPTIONS} - -DBUILD_APP=OFF + -DBUILD_AS_BUNDLE=OFF -DBUILD_EXAMPLES=OFF - -DWITH_QT=OFF - -DWITH_ORB_OCTREE=OFF + -DWITH_ORB_OCTREE=ON -DWITH_TORCH=OFF -DWITH_PYTHON=OFF -DWITH_PYTHON_THREADING=OFF -DWITH_PDAL=OFF -DWITH_FREENECT=OFF -DWITH_FREENECT2=OFF - -DWITH_K4W2=OFF -DWITH_K4A=OFF - -DWITH_OPENNI2=OFF -DWITH_DC1394=OFF - -DWITH_G2O=OFF + -DWITH_G2O=ON -DWITH_GTSAM=OFF - -DWITH_CERES=OFF + -DWITH_CERES=ON -DWITH_VERTIGO=OFF -DWITH_CVSBA=OFF -DWITH_POINTMATCHER=OFF @@ -51,10 +60,8 @@ vcpkg_cmake_configure( -DWITH_ZEDOC=OFF -DWITH_REALSENSE=OFF -DWITH_REALSENSE_SLAM=OFF - -DWITH_REALSENSE2=OFF -DWITH_MYNTEYE=OFF -DWITH_DEPTHAI=OFF - -DWITH_OCTOMAP=OFF -DWITH_CPUTSDF=OFF -DWITH_OPENCHISEL=OFF -DWITH_ALICE_VISION=OFF @@ -70,18 +77,11 @@ vcpkg_cmake_configure( ) vcpkg_cmake_install() -vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-rtabmap CONFIG_PATH share/unofficial-rtabmap) -vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/unofficial-rtabmap/unofficial-rtabmap-config.cmake" - [[# Generated by CMake]] - [[# Generated by CMake -include(CMakeFindDependencyMacro) -find_dependency(OpenCV) -find_dependency(PCL) -find_dependency(ZLIB) -find_dependency(VTK) -find_dependency(OpenMP)]] -) +vcpkg_cmake_config_fixup(PACKAGE_NAME RTABMap CONFIG_PATH CMake) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") vcpkg_copy_tools(TOOL_NAMES rtabmap-res_tool AUTO_CLEAN) @@ -104,13 +104,39 @@ if("tools" IN_LIST FEATURES) rtabmap-globalBundleAdjustment AUTO_CLEAN ) -endif() + if("gui" IN_LIST FEATURES) + vcpkg_copy_tools( + TOOL_NAMES + rtabmap + rtabmap-calibration + rtabmap-databaseViewer + rtabmap-dataRecorder + rtabmap-odometryViewer + rtabmap-rgbd_camera + AUTO_CLEAN + ) + + # Remove duplicate files that were added by qtdeploy + # that would be already deployed by vcpkg_copy_tools + file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tmp) + file(GLOB RTABMAP_REL_LIBS ${CURRENT_PACKAGES_DIR}/tmp/rtabmap*) + file(COPY ${RTABMAP_REL_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tmp") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/translations") + file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${CURRENT_PACKAGES_DIR}/tools/${PORT}/plugins) + #qt.conf + file(WRITE ${CURRENT_PACKAGES_DIR}/tools/${PORT}/qt.conf "[Paths] + Prefix = .") -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug/include" - "${CURRENT_PACKAGES_DIR}/debug/share" - "${CURRENT_PACKAGES_DIR}/debug/CMake" - "${CURRENT_PACKAGES_DIR}/CMake" -) + # Debug + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/debug/tmp) + file(GLOB RTABMAP_DBG_LIBS ${CURRENT_PACKAGES_DIR}/debug/tmp/rtabmap*) + file(COPY ${RTABMAP_DBG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tmp") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/plugins") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/translations") + + endif() +endif() vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/rtabmap/vcpkg.json b/ports/rtabmap/vcpkg.json index 000b215aca854b..86754dd8dba660 100644 --- a/ports/rtabmap/vcpkg.json +++ b/ports/rtabmap/vcpkg.json @@ -1,12 +1,13 @@ { "name": "rtabmap", - "version": "0.20.23", - "port-version": 2, + "version": "0.21.0", "description": "Real-Time Appearance-Based Mapping", "homepage": "https://introlab.github.io/rtabmap/", "license": "BSD-3-Clause", "supports": "windows & !static", "dependencies": [ + "ceres", + "g2o", { "name": "opencv", "default-features": false @@ -18,6 +19,7 @@ "vtk" ] }, + "sqlite3", { "name": "vcpkg-cmake", "host": true @@ -29,11 +31,47 @@ "zlib" ], "default-features": [ - "opencv-contrib" + "gui", + "opencv-contrib", + "opencv-nonfree", + "tools" ], "features": { + "gui": { + "description": "Build RTAB-Map with GUI support (Qt)", + "dependencies": [ + { + "name": "pcl", + "default-features": false, + "features": [ + "qt" + ] + }, + { + "name": "qtbase", + "default-features": false, + "features": [ + "gui", + "opengl", + "widgets" + ] + } + ] + }, + "k4w2": { + "description": "Build RTAB-Map with Kinect For Windows SDK 2.0 camera driver", + "dependencies": [ + "kinectsdk2" + ] + }, + "octomap": { + "description": "Build RTAB-Map with OctoMap support", + "dependencies": [ + "octomap" + ] + }, "opencv-contrib": { - "description": "Use OpenCV with contrib modules", + "description": "Use OpenCV with contrib modules (e.g., xfeatures2d, aruco)", "dependencies": [ { "name": "opencv", @@ -44,8 +82,51 @@ } ] }, + "opencv-cuda": { + "description": "Use OpenCV with CUDA (accelerated SIFT ad SURF GPU options)", + "dependencies": [ + { + "name": "opencv", + "default-features": false, + "features": [ + "cuda" + ] + } + ] + }, + "opencv-nonfree": { + "description": "Use OpenCV with nonfree module (surf feature)", + "dependencies": [ + { + "name": "opencv", + "default-features": false, + "features": [ + "nonfree" + ] + } + ] + }, + "openni2": { + "description": "Build RTAB-Map with OpenNI2 camera driver", + "dependencies": [ + "kinectsdk1", + "openni2" + ] + }, + "realsense2": { + "description": "Build RTAB-Map with RealSense2 camera driver", + "dependencies": [ + { + "name": "realsense2", + "default-features": false, + "features": [ + "tm2" + ] + } + ] + }, "tools": { - "description": "Build tools", + "description": "Build RTAB-Map's tools", "dependencies": [ "yaml-cpp" ] diff --git a/versions/baseline.json b/versions/baseline.json index bb7795279fdd87..e1496392e97298 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6997,8 +6997,8 @@ "port-version": 1 }, "rtabmap": { - "baseline": "0.20.23", - "port-version": 2 + "baseline": "0.21.0", + "port-version": 0 }, "rtaudio": { "baseline": "2021-11-16", diff --git a/versions/r-/rtabmap.json b/versions/r-/rtabmap.json index 9202c36120544e..fb84b55756988e 100644 --- a/versions/r-/rtabmap.json +++ b/versions/r-/rtabmap.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "557a37dc751f64ec6040505e57074251f2441822", + "version": "0.21.0", + "port-version": 0 + }, { "git-tree": "f820f54d02aada9453b8d26fb72d03dc30e04bf9", "version": "0.20.23",