[rtabmap] update to 0.21.0 (#30254)

* updated rtabmap port

* Update vcpkg.json

* Addressing review comments, fixed missing deployed qt plugins, fixed CI error

* applied format-manifest

* ran  x-add-version

* Making octomap dependency optional because it doesn't work for debug build (see https://github.com/introlab/rtabmap/issues/995)

* updated upstream version, fixed debug config

* updated versions

* fixing version

* Added explicit depedency to qtbase. Added optional dependencies openni2, realsense2, k4w2

* Updated versions

* Updated versions

* cleanup versions

* cleanup all versions

* Applying format.diff from ci

* overwrite version

* qtbase: not using defaults

* updated versions sha

* added --trace-expand

* Explicitly set autouic to OFF

* Update rtabmap.json

* removing cmake trace debug

* updated versions

---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
matlabbe 2023-04-02 20:54:56 -07:00 committed by GitHub
parent f60f31fc9e
commit 21c801ea47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 188 additions and 238 deletions

View File

@ -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)

View File

@ -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<Entry, Entry, bool> {
+ 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<Entry, Entry, bool> {
+ 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<const unsigned char*> (a),
reinterpret_cast<const unsigned char*> (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 <cstring>
#include <stdarg.h>
#include <cmath>
+#include <random>
#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<T,T,bool>
+ 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 <iostream>
#include <iomanip>
#include <limits.h>
+#include <random>
// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP
#if RTFLANN_USE_UNORDERED_MAP
#include <unordered_map>
@@ -362,9 +363,11 @@ inline LshTable<unsigned char>::LshTable(unsigned int feature_size, unsigned int
mask_ = std::vector<size_t>((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<size_t> 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 <cstdlib>
#include <cstddef>
#include <vector>
+#include <random>
#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;
}

View File

@ -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 $<INSTALL_INTERFACE:include/rtabmap-0.20>)
+TARGET_INCLUDE_DIRECTORIES(rtabmap_core INTERFACE $<INSTALL_INTERFACE:include/rtabmap-0.20>)
+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")

View File

@ -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})

View File

@ -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)")

View File

@ -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
)
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 = .")
# 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()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/CMake"
"${CURRENT_PACKAGES_DIR}/CMake"
)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -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"
]

View File

@ -7021,8 +7021,8 @@
"port-version": 1
},
"rtabmap": {
"baseline": "0.20.23",
"port-version": 2
"baseline": "0.21.0",
"port-version": 0
},
"rtaudio": {
"baseline": "2021-11-16",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "557a37dc751f64ec6040505e57074251f2441822",
"version": "0.21.0",
"port-version": 0
},
{
"git-tree": "f820f54d02aada9453b8d26fb72d03dc30e04bf9",
"version": "0.20.23",