Windows CI: more sensor drivers + Windows/macOS bundle scripts

This commit is contained in:
matlabbe
2026-06-29 19:23:25 -07:00
parent 9d30b174e6
commit 36d851e349
24 changed files with 1162 additions and 75 deletions
@@ -0,0 +1,187 @@
name: 'Install macOS Source Dependencies'
description: 'Builds (and per-dependency caches) the source-only deps not available from Homebrew (GTSAM, libnabo+libpointmatcher, OrbbecSDK, depthai) and installs them into /usr/local.'
inputs:
os:
description: 'Runner os label (e.g. matrix.os), used to namespace the per-dependency caches. Required because intel/arm produce different binaries with identical Homebrew version strings.'
required: true
build_type:
description: 'CMake build type.'
required: false
default: 'Release'
runs:
using: "composite"
steps:
- name: Resolve dependency versions
id: depver
shell: bash
# The source deps link against these Homebrew libraries and are compiled
# with Xcode's toolchain, so both are folded into the cache keys: a
# Homebrew bump (e.g. a new Eigen) or an Xcode update forces a rebuild.
run: |
BREW=$(brew list --versions eigen boost yaml-cpp | sort)
XCODE=$(xcodebuild -version 2>/dev/null || clang --version | head -1)
HASH=$(printf '%s\n%s\n' "$BREW" "$XCODE" | shasum | cut -d' ' -f1)
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
# ----------------------------- GTSAM -----------------------------
- name: Cache GTSAM
id: cache-gtsam
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/deps-stage/gtsam
key: gtsam-4.2.1-${{ inputs.os }}-${{ hashFiles('.github/actions/install-macos-source-deps/patches/gtsam-4.2.1-eigen5.patch') }}-${{ steps.depver.outputs.hash }}
- name: Build GTSAM
if: steps.cache-gtsam.outputs.cache-hit != 'true'
shell: bash
run: |
set -e
NPROC=$(sysctl -n hw.logicalcpu)
PATCHES="${{ github.action_path }}/patches"
SRC="${{ runner.temp }}/src-deps/gtsam"
STAGE="${{ runner.temp }}/deps-stage/gtsam"
rm -rf "$SRC"; mkdir -p "$SRC" "$STAGE"
git clone --depth 1 --branch 4.2.1 https://github.com/borglab/gtsam.git "$SRC/gtsam"
cd "$SRC/gtsam"
git apply "$PATCHES/gtsam-4.2.1-eigen5.patch"
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
-DGTSAM_WITH_TBB=OFF \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
-DGTSAM_BUILD_TESTS=OFF \
-DGTSAM_BUILD_UNSTABLE=OFF \
-DGTSAM_USE_SYSTEM_EIGEN=ON \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
cmake --build build -j$NPROC
DESTDIR="$STAGE" cmake --install build
# ----------------- libnabo + libpointmatcher --------------------
# Built together: libpointmatcher depends on libnabo, so keeping them in one
# unit keeps the build order internal (lpm finds libnabo in the unit's stage).
- name: Cache pointmatcher
id: cache-pointmatcher
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/deps-stage/pointmatcher
key: pointmatcher-nabo1.1.2-lpm1.4.4-${{ inputs.os }}-${{ hashFiles('.github/actions/install-macos-source-deps/patches/libnabo-1.1.2.patch', '.github/actions/install-macos-source-deps/patches/libpointmatcher-1.4.4-boost.patch') }}-${{ steps.depver.outputs.hash }}
- name: Build pointmatcher
if: steps.cache-pointmatcher.outputs.cache-hit != 'true'
shell: bash
run: |
set -e
NPROC=$(sysctl -n hw.logicalcpu)
PATCHES="${{ github.action_path }}/patches"
SRC="${{ runner.temp }}/src-deps/pointmatcher"
STAGE="${{ runner.temp }}/deps-stage/pointmatcher"
rm -rf "$SRC"; mkdir -p "$SRC" "$STAGE"
# libnabo (required by libpointmatcher)
git clone --depth 1 --branch 1.1.2 https://github.com/ethz-asl/libnabo.git "$SRC/libnabo"
cd "$SRC/libnabo"
git apply "$PATCHES/libnabo-1.1.2.patch"
cmake -B build -DCMAKE_BUILD_TYPE=${{ inputs.build_type }}
cmake --build build -j$NPROC
DESTDIR="$STAGE" cmake --install build
# libpointmatcher (finds libnabo from the unit's staged prefix)
git clone --depth 1 --branch 1.4.4 https://github.com/ethz-asl/libpointmatcher.git "$SRC/libpointmatcher"
cd "$SRC/libpointmatcher"
git apply "$PATCHES/libpointmatcher-1.4.4-boost.patch"
cmake -B build -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DCMAKE_PREFIX_PATH="$STAGE/usr/local" -DBUILD_EVALUATIONS=OFF -DBUILD_EXAMPLES=OFF
cmake --build build -j$NPROC
DESTDIR="$STAGE" cmake --install build
# ----------------------------- OrbbecSDK ------------------------
- name: Cache OrbbecSDK
id: cache-orbbec
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/deps-stage/orbbec
key: orbbec-2.8.7-usrlocal-${{ inputs.os }}-${{ hashFiles('.github/actions/install-macos-source-deps/patches/orbbecsdk-2.8.7-cmake-config-install.patch') }}-${{ steps.depver.outputs.hash }}
- name: Build OrbbecSDK
if: steps.cache-orbbec.outputs.cache-hit != 'true'
shell: bash
run: |
set -e
NPROC=$(sysctl -n hw.logicalcpu)
PATCHES="${{ github.action_path }}/patches"
SRC="${{ runner.temp }}/src-deps/orbbec"
STAGE="${{ runner.temp }}/deps-stage/orbbec"
rm -rf "$SRC"; mkdir -p "$SRC" "$STAGE"
git clone --depth 1 --branch v2.8.7 https://github.com/orbbec/OrbbecSDK_v2.git "$SRC/OrbbecSDK_v2"
cd "$SRC/OrbbecSDK_v2"
git apply "$PATCHES/orbbecsdk-2.8.7-cmake-config-install.patch"
# OrbbecSDK defaults its install prefix to /opt/OrbbecSDK; force /usr/local
# so it stages under usr/local like the other deps and is installed/found.
cmake -B build -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} -DCMAKE_INSTALL_PREFIX=/usr/local -DOB_BUILD_DOCS=OFF -DOB_BUILD_EXAMPLES=OFF -DOB_BUILD_TOOLS=OFF -DOB_INSTALL_EXAMPLES_SOURCE=OFF
cmake --build build -j$NPROC
DESTDIR="$STAGE" cmake --install build
# ----------------------------- depthai --------------------------
- name: Cache depthai
id: cache-depthai
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/deps-stage/depthai
key: depthai-2.32.0-usrlocal-${{ inputs.os }}-${{ hashFiles('.github/actions/install-macos-source-deps/patches/depthai-2.32.0-hunter-macos.patch') }}-${{ steps.depver.outputs.hash }}
- name: Build depthai
if: steps.cache-depthai.outputs.cache-hit != 'true'
shell: bash
run: |
set -e
NPROC=$(sysctl -n hw.logicalcpu)
PATCHES="${{ github.action_path }}/patches"
SRC="${{ runner.temp }}/src-deps/depthai"
STAGE="${{ runner.temp }}/deps-stage/depthai"
rm -rf "$SRC"; mkdir -p "$SRC" "$STAGE"
# depthai 2.32.0 (Hunter-based; v2 does NOT use vcpkg/CMake presets)
git clone --depth 1 --branch v2.32.0 https://github.com/luxonis/depthai-core.git "$SRC/depthai-core"
cd "$SRC/depthai-core"
git submodule update --init --recursive
# Route zlib to Homebrew: Hunter's pinned zlib fork has a classic
# TARGET_OS_MAC fdopen block that won't compile against the modern macOS SDK.
git apply "$PATCHES/depthai-2.32.0-hunter-macos.patch"
# v2 and its old Hunter deps declare cmake_minimum_required < 3.5, which the
# runner's CMake 4.x rejects, and CMAKE_POLICY_VERSION_MINIMUM does not
# propagate into Hunter's sub-builds. Use a pinned CMake 3.x just for depthai
# (Hunter reuses the same cmake binary for its dependency sub-builds).
python3 -m venv "$SRC/cmake3-venv"
"$SRC/cmake3-venv/bin/pip" install -q "cmake==3.31.6"
CMAKE3="$SRC/cmake3-venv/bin/cmake"
# DEPTHAI_ENABLE_CURL=OFF: Hunter's CURL drags in the broken zlib and also
# fails to configure on this toolchain; rtabmap doesn't need depthai's CURL.
# depthai-core defaults its install prefix to <build>/install; force
# /usr/local so it stages under usr/local like the other deps.
"$CMAKE3" -B build \
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_SHARED_LIBS=ON \
-DDEPTHAI_ENABLE_CURL=OFF \
-DDEPTHAI_BUILD_TESTS=OFF \
-DDEPTHAI_BUILD_EXAMPLES=OFF \
-DCMAKE_PREFIX_PATH="$(brew --prefix zlib)"
"$CMAKE3" --build build -j$NPROC
DESTDIR="$STAGE" "$CMAKE3" --install build
# ------------------- install all units into /usr/local ----------
- name: Install source dependencies into /usr/local
shell: bash
# Copy each (cached or freshly built) staged tree into /usr/local so
# rtabmap's find_package() and the bundle fixup (which search /usr/local)
# pick them up. Runs on both cache hit and miss.
run: |
set -e
STAGE="${{ runner.temp }}/deps-stage"
found=0
for unit in gtsam pointmatcher orbbec depthai; do
if [ -d "$STAGE/$unit/usr/local" ]; then
sudo cp -a "$STAGE/$unit/usr/local/." /usr/local/
found=1
fi
done
if [ "$found" != "1" ]; then
echo "No staged source dependencies found under $STAGE" >&2
exit 1
fi
@@ -0,0 +1,41 @@
diff --git a/cmake/depthaiDependencies.cmake b/cmake/depthaiDependencies.cmake
index 6b0b44f98..672c26402 100644
--- a/cmake/depthaiDependencies.cmake
+++ b/cmake/depthaiDependencies.cmake
@@ -17,7 +17,9 @@ else()
hunter_add_package(FP16)
hunter_add_package(libarchive-luxonis)
hunter_add_package(spdlog)
- hunter_add_package(ZLIB)
+ # ZLIB: use the system/Homebrew copy instead of Hunter's (the old pinned
+ # zlib fork fails to build against the modern macOS SDK). Found below via
+ # the standard FindZLIB module, which provides the same ZLIB::ZLIB target.
if(DEPTHAI_ENABLE_BACKWARD)
hunter_add_package(Backward)
endif()
@@ -45,8 +47,23 @@ if(NOT CONFIG_MODE OR (CONFIG_MODE AND NOT DEPTHAI_SHARED_LIBS))
# libarchive for firmware packages
find_package(archive_static ${_QUIET} CONFIG REQUIRED)
find_package(lzma ${_QUIET} CONFIG REQUIRED)
- # ZLIB for compressing Apps
- find_package(ZLIB CONFIG REQUIRED)
+ # ZLIB for compressing Apps.
+ # Use the system/Homebrew zlib directly instead of Hunter's: Hunter's pinned
+ # zlib fork fails to build against the modern macOS SDK, and Hunter also
+ # intercepts find_package(ZLIB) via its own FindZLIB on the module path, so
+ # we locate it manually and expose the ZLIB::zlib target depthai expects.
+ find_path(SYSTEM_ZLIB_INCLUDE_DIR NAMES zlib.h)
+ find_library(SYSTEM_ZLIB_LIBRARY NAMES z)
+ if(NOT SYSTEM_ZLIB_INCLUDE_DIR OR NOT SYSTEM_ZLIB_LIBRARY)
+ message(FATAL_ERROR "System zlib not found (looked for zlib.h and libz). Install via: brew install zlib")
+ endif()
+ if(NOT TARGET ZLIB::zlib)
+ add_library(ZLIB::zlib UNKNOWN IMPORTED)
+ set_target_properties(ZLIB::zlib PROPERTIES
+ IMPORTED_LOCATION "${SYSTEM_ZLIB_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${SYSTEM_ZLIB_INCLUDE_DIR}"
+ )
+ endif()
# spdlog for library and device logging
find_package(spdlog ${_QUIET} CONFIG REQUIRED)
@@ -0,0 +1,83 @@
diff --git a/cmake/HandleEigen.cmake b/cmake/HandleEigen.cmake
index b3b4f66b6..651cd1009 100644
--- a/cmake/HandleEigen.cmake
+++ b/cmake/HandleEigen.cmake
@@ -59,7 +59,12 @@ else()
endif()
# Detect Eigen version:
-set(EIGEN_VER_H "${GTSAM_EIGEN_INCLUDE_FOR_BUILD}/Eigen/src/Core/util/Macros.h")
+# Since Eigen 5.0.0 the version macros moved from Eigen/src/Core/util/Macros.h
+# to a dedicated Eigen/Version header, so check the new location first.
+set(EIGEN_VER_H "${GTSAM_EIGEN_INCLUDE_FOR_BUILD}/Eigen/Version")
+if (NOT EXISTS ${EIGEN_VER_H})
+ set(EIGEN_VER_H "${GTSAM_EIGEN_INCLUDE_FOR_BUILD}/Eigen/src/Core/util/Macros.h")
+endif()
if (EXISTS ${EIGEN_VER_H})
file(READ "${EIGEN_VER_H}" STR_EIGEN_VERSION)
diff --git a/gtsam/base/Matrix.h b/gtsam/base/Matrix.h
index cfedf6d8c..9c9771407 100644
--- a/gtsam/base/Matrix.h
+++ b/gtsam/base/Matrix.h
@@ -54,7 +54,7 @@ using Matrix7##N = Eigen::Matrix<double, 7, N>; \
using Matrix8##N = Eigen::Matrix<double, 8, N>; \
using Matrix9##N = Eigen::Matrix<double, 9, N>; \
static const Eigen::MatrixBase<Matrix##N>::IdentityReturnType I_##N##x##N = Matrix##N::Identity(); \
-static const Eigen::MatrixBase<Matrix##N>::ConstantReturnType Z_##N##x##N = Matrix##N::Zero();
+static const decltype(Matrix##N::Zero()) Z_##N##x##N = Matrix##N::Zero();
GTSAM_MAKE_MATRIX_DEFS(1)
GTSAM_MAKE_MATRIX_DEFS(2)
diff --git a/gtsam/base/Vector.h b/gtsam/base/Vector.h
index f7923ff88..5410393f6 100644
--- a/gtsam/base/Vector.h
+++ b/gtsam/base/Vector.h
@@ -27,6 +27,7 @@
#include <gtsam/global_includes.h>
#include <Eigen/Core>
+#include <cassert>
#include <iosfwd>
#include <list>
@@ -42,14 +43,14 @@ typedef Eigen::Matrix<double, 1, 1> Vector1;
typedef Eigen::Vector2d Vector2;
typedef Eigen::Vector3d Vector3;
-static const Eigen::MatrixBase<Vector2>::ConstantReturnType Z_2x1 = Vector2::Zero();
-static const Eigen::MatrixBase<Vector3>::ConstantReturnType Z_3x1 = Vector3::Zero();
+static const decltype(Vector2::Zero()) Z_2x1 = Vector2::Zero();
+static const decltype(Vector3::Zero()) Z_3x1 = Vector3::Zero();
// Create handy typedefs and constants for vectors with N>3
// VectorN and Z_Nx1, for N=1..9
#define GTSAM_MAKE_VECTOR_DEFS(N) \
using Vector##N = Eigen::Matrix<double, N, 1>; \
- static const Eigen::MatrixBase<Vector##N>::ConstantReturnType Z_##N##x1 = Vector##N::Zero();
+ static const decltype(Vector##N::Zero()) Z_##N##x1 = Vector##N::Zero();
GTSAM_MAKE_VECTOR_DEFS(4)
GTSAM_MAKE_VECTOR_DEFS(5)
diff --git a/gtsam/linear/iterative.h b/gtsam/linear/iterative.h
index 22f65b8de..20a0c936e 100644
--- a/gtsam/linear/iterative.h
+++ b/gtsam/linear/iterative.h
@@ -61,7 +61,7 @@ namespace gtsam {
/** Apply operator A'*e */
Vector operator^(const Vector& e) const {
- return A_ ^ e;
+ return gtsam::operator^(A_, e);
}
/**
@@ -71,7 +71,7 @@ namespace gtsam {
/** gradient of objective function 0.5*|Ax-b_|^2 at x = A_'*(Ax-b_) */
Vector gradient(const Vector& x) const {
- return A() ^ (A() * x - b());
+ return gtsam::operator^(A(), Vector(A() * x - b()));
}
/** Apply operator A */
@@ -0,0 +1,87 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5f0c44..69340e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,18 +78,18 @@ elseif ()
endif ()
endif ()
-# enable C++11 support.
+# enable C++14 support (required by recent Eigen versions).
if (CMAKE_VERSION VERSION_LESS "3.1")
if (MSVC)
message(FATAL_ERROR "CMake version 3.1 or later is required to compile ${PROJECT_NAME} with Microsoft Visual C++")
endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
+ set (CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
else ()
- set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
+ set (CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
endif ()
else ()
- set (CMAKE_CXX_STANDARD 11)
+ set (CMAKE_CXX_STANDARD 14)
endif ()
#======================== External Dependencies ===============================
diff --git a/experimental/kdtree_cpu.cpp b/experimental/kdtree_cpu.cpp
index 302b672..d63fcd3 100644
--- a/experimental/kdtree_cpu.cpp
+++ b/experimental/kdtree_cpu.cpp
@@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "nabo_experimental.h"
#include "../nabo/index_heap.h"
+#include <cassert>
#include <iostream>
#include <stdexcept>
#include <limits>
diff --git a/nabo/kdtree_cpu.cpp b/nabo/kdtree_cpu.cpp
index cb1f8d1..52a444f 100644
--- a/nabo/kdtree_cpu.cpp
+++ b/nabo/kdtree_cpu.cpp
@@ -37,6 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <queue>
#include <algorithm>
#include <utility>
+#include <cassert>
#ifdef HAVE_OPENMP
#include <omp.h>
#endif
diff --git a/nabo/kdtree_opencl.cpp b/nabo/kdtree_opencl.cpp
index 5a9fee2..fb1345f 100644
--- a/nabo/kdtree_opencl.cpp
+++ b/nabo/kdtree_opencl.cpp
@@ -33,6 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "nabo_private.h"
#include "index_heap.h"
+#include <cassert>
#include <iostream>
#include <sstream>
#include <fstream>
diff --git a/tests/knnshow.cpp b/tests/knnshow.cpp
index 6f4d3fc..c612378 100644
--- a/tests/knnshow.cpp
+++ b/tests/knnshow.cpp
@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "nabo/nabo.h"
+#include <cassert>
#include <iostream>
#include <fstream>
#include <stdexcept>
diff --git a/tests/knnvalidate.cpp b/tests/knnvalidate.cpp
index 2430249..2a7dcc4 100644
--- a/tests/knnvalidate.cpp
+++ b/tests/knnvalidate.cpp
@@ -32,6 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "nabo/nabo.h"
#include "helpers.h"
//#include "experimental/nabo_experimental.h"
+#include <cassert>
#include <iostream>
#include <fstream>
#include <stdexcept>
@@ -0,0 +1,32 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9dabfd0..7b73418 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -128,9 +128,9 @@ endif()
#--------------------
# DEPENDENCY: boost
#--------------------
-find_package(Boost REQUIRED COMPONENTS thread system program_options date_time)
+find_package(Boost REQUIRED COMPONENTS thread program_options date_time)
if (Boost_MINOR_VERSION GREATER 47)
- find_package(Boost REQUIRED COMPONENTS thread system program_options date_time chrono)
+ find_package(Boost REQUIRED COMPONENTS thread program_options date_time chrono)
endif ()
#--------------------
diff --git a/libpointmatcherConfig.cmake.in b/libpointmatcherConfig.cmake.in
index 6de2c85..7c887fd 100644
--- a/libpointmatcherConfig.cmake.in
+++ b/libpointmatcherConfig.cmake.in
@@ -7,9 +7,9 @@
include(CMakeFindDependencyMacro)
find_dependency(libnabo REQUIRED)
find_dependency(yaml-cpp REQUIRED)
-find_package(Boost COMPONENTS thread system program_options date_time REQUIRED)
+find_package(Boost COMPONENTS thread program_options date_time REQUIRED)
if (Boost_MINOR_VERSION GREATER 47)
- find_package(Boost COMPONENTS thread system program_options date_time chrono REQUIRED)
+ find_package(Boost COMPONENTS thread program_options date_time chrono REQUIRED)
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/libpointmatcher-config.cmake)
@@ -0,0 +1,29 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 261f2cda..644e068f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -92,17 +92,20 @@ if(OB_IS_MAIN_PROJECT)
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/generated/Export.h" DESTINATION include/libobsensor/h)
- install(EXPORT ${OB_SDK_LIB_NAME}Config NAMESPACE ob:: DESTINATION lib)
+ install(EXPORT ${OB_SDK_LIB_NAME}Config NAMESPACE ob:: DESTINATION lib/cmake/${OB_SDK_LIB_NAME})
include(CMakePackageConfigHelpers)
+ # Name the version file <pkg>ConfigVersion.cmake (not <pkg>Version.cmake) and
+ # install it next to the config in lib/cmake/<pkg>, so find_package(OrbbecSDK)
+ # discovers it in config mode and reads its version.
write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}Version.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}ConfigVersion.cmake"
VERSION "${PROJECT_VERSION}"
COMPATIBILITY SameMajorVersion
)
install(
- FILES "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}Version.cmake"
- DESTINATION lib
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}ConfigVersion.cmake"
+ DESTINATION lib/cmake/${OB_SDK_LIB_NAME}
)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:${OB_SDK_LIB_NAME}> DESTINATION bin OPTIONAL)
+25 -21
View File
@@ -26,20 +26,16 @@ jobs:
include:
- build_name: macos-sequoia-intel
os: macos-15-intel
extra_deps: ""
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON'
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_ORBBEC_SDK=ON -DWITH_DEPTHAI=ON'
- build_name: macos-sequoia-apple-silicon
os: macos-15
extra_deps: ""
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON'
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_ORBBEC_SDK=ON -DWITH_DEPTHAI=ON'
- build_name: macos-tahoe-intel
os: macos-26-intel
extra_deps: ""
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON'
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_ORBBEC_SDK=ON -DWITH_DEPTHAI=ON'
- build_name: macos-tahoe-apple-silicon
os: macos-26
extra_deps: ""
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON'
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_ORBBEC_SDK=ON -DWITH_DEPTHAI=ON'
steps:
- uses: actions/checkout@v4
@@ -47,7 +43,15 @@ jobs:
- name: Install Brew Dependencies
run: |
# Update brew and install from Brewfile if present, or specific packages
brew install pcl opencv octomap g2o pdal
brew install pcl opencv octomap g2o pdal yaml-cpp librealsense libfreenect libusb zlib
- name: Install Source Dependencies
# Build (and per-dependency cache) the source-only deps not available from
# Homebrew, then install them into /usr/local. See the composite action.
uses: ./.github/actions/install-macos-source-deps
with:
os: ${{ matrix.os }}
build_type: ${{ env.BUILD_TYPE }}
- name: Configure CMake
run: |
@@ -61,19 +65,19 @@ jobs:
run: |
./rtabmap-console --version
# - name: Build MacOS Package
# run: |
# cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --target package
- name: Build MacOS Package
run: |
cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --target package
# - name: Upload RTABMap Artifacts (DMG)
# uses: actions/upload-artifact@v4
# with:
# name: RTABMap-Binaries-${{ matrix.build_name }}-zip
# path: |
# build/RTABMap-*.dmg
# compression-level: 0
# if-no-files-found: warn
# retention-days: ${{ github.event_name == 'pull_request' && 1 || 90 }}
- name: Upload RTABMap Artifacts (DMG)
uses: actions/upload-artifact@v4
with:
name: RTABMap-Binaries-${{ matrix.build_name }}-nonsigned-zip
path: |
build/RTABMap-*.dmg
compression-level: 0
if-no-files-found: warn
retention-days: ${{ github.event_name == 'pull_request' && 1 || 90 }}
# - name: Test
# working-directory: ${{github.workspace}}/build
+16 -2
View File
@@ -27,11 +27,11 @@ jobs:
- build_name: windows-2022
os: windows-2022
extra_deps: ""
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_PYTHON=ON -DWITH_TORCH=OFF'
extra_cmake_def: '-DWITH_TORCH=OFF -DWITH_ZED=OFF'
- build_name: windows-2022-cuda
os: windows-2022
extra_deps: ""
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_PYTHON=ON -DWITH_TORCH=ON'
extra_cmake_def: '-DWITH_TORCH=ON -DWITH_ZED=ON'
steps:
- uses: actions/checkout@v4
@@ -46,9 +46,23 @@ jobs:
- name: Configure CMake
run: |
# K4A and K4W2 are located via these env vars (FindK4A.cmake / FindKinectSDK2.cmake),
# pointing at the export where the bundle script staged their SDK files.
$env:K4A_ROOT_DIR = "${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release"
$env:KINECTSDK20_DIR = "${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release"
cmake `
-B ${{github.workspace}}/build `
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
-DBUILD_AS_BUNDLE=ON `
-DWITH_PYTHON=ON `
-DWITH_CERES=ON `
-DWITH_ORBBEC_SDK=ON `
-DWITH_FREENECT2=ON `
-DWITH_K4W2=ON `
-DWITH_K4A=ON `
-DWITH_DEPTHAI=ON `
-DWITH_REALSENSE2=ON `
-DWITH_CCCORELIB=ON `
${{ matrix.extra_cmake_def }} `
-DVCPKG_MANIFEST_INSTALL=OFF `
-DVCPKG_TARGET_TRIPLET=x64-windows-release `
+6
View File
@@ -12,3 +12,9 @@ compile_flags.txt
tags
build_*
*.bak
# Windows bundle: vcpkg tree, build output, and deps built from source (bundle_windows_deps.bat)
vcpkg/
vcpkg_installed/
vcpkg_binaries/
vcpkg_deps_from_source/
+5 -3
View File
@@ -208,7 +208,7 @@ option(WITH_REALSENSE "Include RealSense support" ON)
option(WITH_REALSENSE_SLAM "Include RealSenseSlam support" ON)
option(WITH_REALSENSE2 "Include RealSense2 support" ON)
option(WITH_MYNTEYE "Include mynteye-s support" ON)
option(WITH_DEPTHAI "Include depthai-core support" OFF)
option(WITH_DEPTHAI "Include depthai-core v2 support" OFF)
option(WITH_XVSDK "Include XVisio SDK support" OFF)
option(WITH_ORBBEC_SDK "Include Orbbec SDK v2 support" OFF)
option(WITH_OCTOMAP "Include OctoMap support" ON)
@@ -711,7 +711,9 @@ IF(WITH_MYNTEYE)
ENDIF(WITH_MYNTEYE)
IF(WITH_DEPTHAI)
FIND_PACKAGE(depthai 2.24)
# Force DepthAI major version 2 (>=2.24, <3.0): the v3 API is not yet
# supported (see CameraDepthAI).
FIND_PACKAGE(depthai 2.24...<3.0)
IF(depthai_FOUND)
MESSAGE(STATUS "Found depthai-core (targets)")
ENDIF(depthai_FOUND)
@@ -1877,7 +1879,7 @@ MESSAGE(STATUS " With DepthAI ${depthai_VERSION} = YES (License: MIT)")
ELSEIF(NOT WITH_DEPTHAI)
MESSAGE(STATUS " With DepthAI = NO (WITH_DEPTHAI=OFF)")
ELSE()
MESSAGE(STATUS " With DepthAI = NO (depthai-core not found)")
MESSAGE(STATUS " With DepthAI = NO (depthai-core v2 not found)")
ENDIF()
IF(xvsdk_FOUND)
+78 -13
View File
@@ -24,15 +24,23 @@ IF(WIN32)
ELSE( MINGW )
SET(SRC_FILES ${SRC_FILES} ${PROJECT_NAME}.rc)
ENDIF( MINGW )
ENDIF(WIN32)
IF(BUILD_AS_BUNDLE)
ADD_DEFINITIONS("-DBUILD_AS_BUNDLE")
ENDIF(WIN32)
IF(BUILD_AS_BUNDLE)
ADD_DEFINITIONS("-DBUILD_AS_BUNDLE")
ENDIF()
# Add binary
IF(APPLE AND BUILD_AS_BUNDLE)
ADD_EXECUTABLE(rtabmap_app MACOSX_BUNDLE ${SRC_FILES})
# Custom Info.plist providing NSCameraUsageDescription, required by macOS to
# grant the app access to USB/UVC cameras (e.g. Orbbec, RealSense). A bundle
# identifier is also set: macOS ties the camera (TCC) permission to it, so it
# must be non-empty for the permission to be granted/persisted.
SET_TARGET_PROPERTIES(rtabmap_app PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in
MACOSX_BUNDLE_GUI_IDENTIFIER "com.introlab.rtabmap"
MACOSX_BUNDLE_BUNDLE_NAME "${CMAKE_BUNDLE_NAME}")
ELSEIF(WIN32 AND BUILD_AS_BUNDLE)
ADD_EXECUTABLE(rtabmap_app ${SRC_FILES})
ELSE()
@@ -70,13 +78,13 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
SET(thirdparty_dest_dir bin)
IF(APPLE)
SET(plugin_dest_dir MacOS/plugins)
IF(Qt6_FOUND)
SET(plugin_dest_dir PlugIns)
SET(plugin_dest_dir MacOS/plugins)
IF(Qt6_FOUND)
SET(plugin_dest_dir PlugIns)
ENDIF()
SET(qtconf_dest_dir Resources)
SET(thirdparty_dest_dir MacOS)
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
SET(APPS "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}")
ENDIF(APPLE)
IF(OpenNI2_FOUND)
@@ -241,14 +249,49 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
ENDIF(WIN32)
ENDIF(Python3_FOUND)
IF(Qt6_FOUND)
IF(Qt6_FOUND AND APPLE)
# On macOS we do NOT use qt_deploy_runtime_dependencies (macdeployqt):
# macdeployqt cannot deploy VTK 9.6+, whose libraries reference each other
# via @rpath relative to "@loader_path/../lib". Instead we install the Qt plugins
# manually and let fixup_bundle() below deploy all libraries.
IF(TARGET Qt6::QCocoaIntegrationPlugin)
get_target_property(_qt_plugin_loc Qt6::QCocoaIntegrationPlugin LOCATION)
get_filename_component(_qt_plugins_dir "${_qt_plugin_loc}" DIRECTORY) # .../plugins/platforms
get_filename_component(_qt_plugins_dir "${_qt_plugins_dir}" DIRECTORY) # .../plugins
FOREACH(_qt_plugin_type platforms styles imageformats iconengines)
IF(EXISTS "${_qt_plugins_dir}/${_qt_plugin_type}")
# Homebrew Qt plugins are symlinks into the Cellar; resolve them to the
# real files so they aren't installed as dangling symlinks (which would
# break fixup_bundle and codesign).
FILE(GLOB _qt_plugin_files "${_qt_plugins_dir}/${_qt_plugin_type}/*${CMAKE_SHARED_LIBRARY_SUFFIX}")
SET(_qt_plugin_real "")
FOREACH(_qt_plugin_file ${_qt_plugin_files})
GET_FILENAME_COMPONENT(_qt_plugin_file "${_qt_plugin_file}" REALPATH)
LIST(APPEND _qt_plugin_real "${_qt_plugin_file}")
ENDFOREACH()
IF(_qt_plugin_real)
INSTALL(FILES ${_qt_plugin_real}
DESTINATION ${plugin_dest_dir}/${_qt_plugin_type}
COMPONENT runtime)
ENDIF()
ENDIF()
ENDFOREACH()
ELSE()
MESSAGE(WARNING "Qt6::QCocoaIntegrationPlugin target not found: Qt plugins may be missing from the bundle")
ENDIF()
# qt.conf so Qt finds the bundled plugins (path is relative to Contents/)
SET(QT_CONF_FILE [Paths]\nPlugins=${plugin_dest_dir})
INSTALL(CODE "
file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
" COMPONENT runtime)
ELSEIF(Qt6_FOUND)
# Reference: https://doc-snapshots.qt.io/qt6-6.4/qt-deploy-runtime-dependencies.html
# The following script must only be executed at install time
set(deploy_script "${CMAKE_CURRENT_BINARY_DIR}/deploy_app$<CONFIG>.cmake")
file(GENERATE OUTPUT ${deploy_script} CONTENT "
# Including the file pointed to by QT_DEPLOY_SUPPORT ensures the generated
# deployment script has access to qt_deploy_runtime_dependencies()
include(\"${QT_DEPLOY_SUPPORT}\")
include(\"${QT_DEPLOY_SUPPORT}\")
qt_deploy_runtime_dependencies(
EXECUTABLE \"${APPS}\"
PLUGINS_DIR ${plugin_dest_dir}
@@ -328,10 +371,13 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
INSTALL(CODE "
file(WRITE \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"${QT_CONF_FILE}\")
" COMPONENT runtime)
ENDIF()
ENDIF()
# directories to look for dependencies
SET(DIRS "${QT_LIBRARY_DIRS}" "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib")
# CMAKE_LIBRARY_OUTPUT_DIRECTORY is where rtabmap's own libraries (e.g.
# librtabmap_core) are built; fixup_bundle needs it to resolve the app's
# @rpath references to them (macdeployqt used to handle this via rpath).
SET(DIRS "${QT_LIBRARY_DIRS}" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib")
IF(APPLE)
SET(DIRS ${DIRS} /usr/local /usr/local/lib /opt/homebrew /opt/homebrew/lib /opt/homebrew/lib/gcc/current)
ENDIF(APPLE)
@@ -363,6 +409,25 @@ IF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
include(\"BundleUtilities\")
fixup_bundle(\"${APPS}\" \"\${ALL_LIBS}\" \"${DIRS}\")
" COMPONENT runtime)
IF(APPLE)
# Re-sign ad-hoc AFTER fixup_bundle has finished all its install_name_tool
# edits.
install(CODE "
set(_contents \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\")
get_filename_component(_app \"\${_contents}\" DIRECTORY)
file(GLOB_RECURSE _nested \"\${_contents}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
foreach(_f \${_nested})
execute_process(COMMAND codesign --force --sign - --timestamp=none \"\${_f}\")
endforeach()
file(GLOB _frameworks \"\${_contents}/Frameworks/*.framework\")
foreach(_f \${_frameworks})
execute_process(COMMAND codesign --force --sign - --timestamp=none \"\${_f}\")
endforeach()
message(STATUS \"Ad-hoc re-signing bundle: \${_app}\")
execute_process(COMMAND codesign --force --sign - --timestamp=none \"\${_app}\")
" COMPONENT runtime)
ENDIF(APPLE)
ENDIF(BUILD_AS_BUNDLE AND (APPLE OR WIN32))
+40
View File
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSCameraUsageDescription</key>
<string>RTAB-Map needs access to the camera to capture images from connected RGB-D/stereo cameras (e.g. Orbbec, RealSense).</string>
</dict>
</plist>
+196 -13
View File
@@ -4,6 +4,8 @@ setlocal enabledelayedexpansion
:: --- CONFIGURATION ---
set "VCPKG_ROOT=%~dp0vcpkg"
set "EXPORT_DIR=%~dp0vcpkg_binaries"
:: All deps downloaded/built from source (git clones + the pinned CMake) live here.
set "SRC_DIR=%~dp0vcpkg_deps_from_source"
set "TRIPLET=x64-windows-release"
set "SEVENZIP_EXE=C:\Program Files\7-Zip\7z.exe"
@@ -43,7 +45,9 @@ echo [+] Installing dependencies via vcpkg manifest...
--x-feature=openni2 ^
--x-feature=gtsam-deps ^
--x-feature=python ^
--x-feature=libpointmatcher-deps || exit /b !errorlevel!
--x-feature=pdal ^
--x-feature=libpointmatcher-deps ^
--x-feature=libfreenect2-deps || exit /b !errorlevel!
:: 3. Export
echo [+] Exporting built binaries to raw folder...
@@ -52,13 +56,7 @@ for /f "usebackq tokens=*" %%i in (`"%VS_LOCATOR%" -latest -property catalog_pro
set TARGET_NAME=vcpkg-export-%VCPKG_COMMIT_SHORT%-x64-%VS_YEAR%
set TARGET_FULL_PATH=%EXPORT_DIR%\%TARGET_NAME%
if exist "%TARGET_FULL_PATH%" rd /s /q "%TARGET_FULL_PATH%"
"%VCPKG_ROOT%\vcpkg.exe" export --raw --output-dir="%EXPORT_DIR%" --triplet=%TRIPLET% || exit /b !errorlevel!
:: Find the actual exported folder name (it usually contains a date/hash)
for /d %%i in ("%EXPORT_DIR%\vcpkg-export-20??????-??????") do set "FINAL_EXPORT_PATH=%%i"
echo [+] Rename folder %FINAL_EXPORT_PATH% to %TARGET_NAME%
ren "%FINAL_EXPORT_PATH%" "%TARGET_NAME%" || exit /b !errorlevel!
"%VCPKG_ROOT%\vcpkg.exe" export --raw --output-dir="%EXPORT_DIR%" --output=%TARGET_NAME% --triplet=%TRIPLET% || exit /b !errorlevel!
set "FINAL_EXPORT_PATH=%TARGET_FULL_PATH%"
echo [+] Add numpy...
@@ -68,6 +66,66 @@ echo [+] Add numpy...
%FINAL_EXPORT_PATH%/installed/%TRIPLET%/tools/python3/python.exe -m pip install "numpy<2" || exit /b !errorlevel!
:: 4. Other dependencies not in vcpkg
:: Everything cloned/downloaded below goes into %SRC_DIR% to keep the repo root clean.
if not exist "%SRC_DIR%" mkdir "%SRC_DIR%"
cd /d "%SRC_DIR%"
:: Kinect for Windows SDK v2 (k4w2): rtabmap's FindKinectSDK2.cmake expects the
:: Microsoft SDK layout (KINECTSDK20_DIR\inc and \Lib\x64), but vcpkg's kinectsdk2
:: port installs vcpkg-style (include\ and lib\). Mirror the bundled headers/lib into
:: the expected layout so it is found with KINECTSDK20_DIR pointing at the export.
echo [+] Arranging Kinect SDK v2 layout for FindKinectSDK2...
set "K4W2_ROOT=%FINAL_EXPORT_PATH%\installed\%TRIPLET%"
robocopy "%K4W2_ROOT%\include" "%K4W2_ROOT%\inc" Kinect*.h Nui*.h /XO >nul
robocopy "%K4W2_ROOT%\lib" "%K4W2_ROOT%\Lib\x64" Kinect20*.lib /XO >nul
:: Robocopy exit codes under 8 mean successful copies/no changes; 8+ is a failure.
if !errorlevel! GEQ 8 (
echo Error: Robocopy failed with exit code !errorlevel!
pause
exit /b !errorlevel!
)
:: orbbec SDK2
echo [+] Building OrbbecSDK_v2...
if not exist OrbbecSDK_v2 (
echo [+] Downloading and applying patch...
git clone https://github.com/orbbec/OrbbecSDK_v2.git
cd OrbbecSDK_v2
git checkout v2.8.7
:: Install the CMake package config under lib/cmake/<pkg> so find_package(OrbbecSDK) works
git apply "%~dp0patches\orbbecsdk_2.8.7.patch"
cd ..
)
cd OrbbecSDK_v2
cmake -S . -B build -GNinja ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%FINAL_EXPORT_PATH%\installed" ^
-DCMAKE_TOOLCHAIN_FILE="%FINAL_EXPORT_PATH%\scripts\buildsystems\vcpkg.cmake" ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DCMAKE_BUILD_TYPE=Release ^
-DOB_BUILD_DOCS=OFF ^
-DOB_BUILD_EXAMPLES=OFF ^
-DOB_BUILD_TOOLS=OFF ^
-DOB_INSTALL_EXAMPLES_SOURCE=OFF || exit /b !errorlevel!
cmake --build build --config Release --target install || exit /b !errorlevel!
cd ..
if "%K4A_ROOT_DIR%"=="" (
echo Error: K4A_ROOT_DIR environment variable is not set! Install K4A: https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md
pause
exit /b 1
)
echo Copying Kinect For Azure components...
robocopy "%K4A_ROOT_DIR%\sdk" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\sdk" /E /XO
:: Robocopy exit codes under 8 mean successful copies/no changes.
:: 8 or higher means there was a failure.
if !errorlevel! GEQ 8 (
echo Error: Robocopy failed with exit code !errorlevel!
pause
exit /b !errorlevel!
)
:: libnabo
echo [+] Building libnabo...
if not exist libnabo (
@@ -76,7 +134,7 @@ if not exist libnabo (
cd libnabo
:: Jan 27, 2022
git checkout c925c47
git apply ../patches/libnabo_c925c47.patch
git apply "%~dp0patches\libnabo_c925c47.patch"
cd ..
)
cd libnabo
@@ -103,7 +161,7 @@ if not exist libpointmatcher (
cd libpointmatcher
:: Mar 17, 2023
git checkout 7dc58e5
git apply ../patches/pointmatcher_7dc58e5.patch
git apply "%~dp0patches\pointmatcher_7dc58e5.patch"
cd ..
)
cd libpointmatcher
@@ -136,7 +194,7 @@ if not exist gtsam (
:: June 18, 2025
git checkout 4.3a0-ros
git cherry-pick 18af4e6
git apply ../patches/gtsam_4_3a0-ros.patch
git apply "%~dp0patches\gtsam_4_3a0-ros.patch"
cd ..
)
cd gtsam
@@ -167,7 +225,7 @@ if not exist opengv (
cd opengv
:: Aug 6, 2020
git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3
git apply ../patches/opengv_91f4b19c.patch
git apply "%~dp0patches\opengv_91f4b19c.patch"
cd ..
)
cd opengv
@@ -182,6 +240,117 @@ cmake -S . -B build -GNinja ^
cmake --build build --config Release --target install || exit /b !errorlevel!
cd ..
:: libfreenect2
echo [+] Building libfreenect2...
if not exist libfreenect2 (
echo [+] Downloading and applying patch...
git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2
:: Aug 6, 2021
git checkout v0.2.1
:: Patch makes freenect2Config.cmake relocatable so the prebuilt bundle works
:: after being moved/unzipped, drops cudaDeviceProp::clockRate/computeMode
:: removed in CUDA 13 from the CUDA build, and renames a CL_ICDL_VERSION local
:: that collides with the OpenCL 3.0 macro.
git apply "%~dp0patches\libfreenect2_v0.2.1.patch"
cd ..
)
cd libfreenect2
:: libfreenect2's FindLibUSB.cmake locates libusb via pkg-config. It declares an
:: ancient cmake_minimum_required (2.8.12), which makes FindPkgConfig default
:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH=OFF, so it ignores the vcpkg CMAKE_PREFIX_PATH.
:: Force it ON so the bundle's lib/pkgconfig (libusb-1.0.pc, libturbojpeg.pc) is
:: searched, use the vcpkg-bundled pkgconf, and also set PKG_CONFIG_PATH as a belt.
set "PKG_CONFIG_PATH=%FINAL_EXPORT_PATH%\installed\%TRIPLET%\lib\pkgconfig"
cmake -S . -B build -GNinja ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%FINAL_EXPORT_PATH%\installed" ^
-DCMAKE_TOOLCHAIN_FILE="%FINAL_EXPORT_PATH%\scripts\buildsystems\vcpkg.cmake" ^
-DPKG_CONFIG_EXECUTABLE="%FINAL_EXPORT_PATH%\installed\%TRIPLET%\tools\pkgconf\pkgconf.exe" ^
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON ^
-DCMAKE_BUILD_TYPE=Release ^
-DENABLE_CUDA=OFF ^
-DENABLE_OPENCL=OFF ^
-DBUILD_EXAMPLES=OFF ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DBUILD_SHARED_LIBS=ON || exit /b !errorlevel!
cmake --build build --config Release --target install || exit /b !errorlevel!
cd ..
:: depthai
echo [+] Building depthai...
if not exist depthai-core (
echo [+] Downloading...
git clone https://github.com/luxonis/depthai-core.git
cd depthai-core
:: depthai 2.32.0 (Hunter-based; v2 does NOT use vcpkg/CMake presets)
git checkout v2.32.0
git submodule update --init --recursive
cd ..
)
cd depthai-core
:: v2 and its old Hunter sub-deps declare cmake_minimum_required < 3.5, which
:: CMake 4.x rejects, and CMAKE_POLICY_VERSION_MINIMUM does not propagate into
:: Hunter's sub-builds. Use a pinned CMake 3.x just for depthai (Hunter reuses the
:: same cmake binary for its dependency sub-builds).
set "CMAKE3_VER=3.31.12"
set "CMAKE3_NAME=cmake-%CMAKE3_VER%-windows-x86_64"
set "CMAKE3_DIR=%SRC_DIR%\%CMAKE3_NAME%"
set "CMAKE3=%CMAKE3_DIR%\bin\cmake.exe"
if not exist "%CMAKE3_DIR%" (
echo [+] Downloading CMake %CMAKE3_VER% ...
curl -L -o "%SRC_DIR%\%CMAKE3_NAME%.zip" "https://github.com/Kitware/CMake/releases/download/v%CMAKE3_VER%/%CMAKE3_NAME%.zip" || exit /b !errorlevel!
"%SEVENZIP_EXE%" x "%SRC_DIR%\%CMAKE3_NAME%.zip" -o"%SRC_DIR%" -y || exit /b !errorlevel!
)
:: v2 is fully Hunter-managed (no vcpkg toolchain). depthaiDependencies.cmake
:: unconditionally does find_package(OpenCV 4 QUIET CONFIG) (not gated by
:: DEPTHAI_OPENCV_SUPPORT); if it finds the bundle's OpenCV, OpenCVModules does
:: find_dependency(TIFF) which collides with Hunter's config-less FindTIFF. We don't
:: need depthai's OpenCV at all (CameraDepthAI converts ImgFrame->cv::Mat itself), so
:: hard-disable the lookup. DEPTHAI_ENABLE_CURL=OFF avoids Hunter's old zlib/curl.
"%CMAKE3%" -S . -B build -GNinja ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_SHARED_LIBS=ON ^
-DDEPTHAI_OPENCV_SUPPORT=OFF ^
-DCMAKE_DISABLE_FIND_PACKAGE_OpenCV=ON ^
-DDEPTHAI_ENABLE_CURL=OFF ^
-DDEPTHAI_BUILD_EXAMPLES=OFF ^
-DDEPTHAI_BUILD_TESTS=OFF || exit /b !errorlevel!
"%CMAKE3%" --build build --config Release --target install || exit /b !errorlevel!
cd ..
:: CCCoreLib
echo [+] Building CCCoreLib...
if not exist CCCoreLib (
echo [+] Downloading...
git clone https://github.com/CloudCompare/CCCoreLib.git
cd CCCoreLib
:: June 20, 2026
git checkout 4095bea6552096cb528c3b8b5cb9505df2aa6002
git submodule update --init --recursive
:: nanoflann is an internal dep (only used in src/Kriging.cpp, no public header),
:: but CCCoreLib links it PUBLIC, leaking nanoflann::nanoflann into the exported
:: interface and breaking find_package(CCCoreLib). Link it PRIVATE instead.
git apply "%~dp0patches\cccorelib_4095bea.patch"
cd ..
)
cd CCCoreLib
cmake -S . -B build -GNinja ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%FINAL_EXPORT_PATH%\installed" ^
-DCMAKE_TOOLCHAIN_FILE="%FINAL_EXPORT_PATH%\scripts\buildsystems\vcpkg.cmake" ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCCCORELIB_SHARED=ON ^
-DCCCORELIB_USE_CGAL=OFF ^
-DCCCORELIB_USE_TBB=ON ^
-DCCCORELIB_USE_QT_CONCURRENT=OFF || exit /b !errorlevel!
cmake --build build --config Release --target install || exit /b !errorlevel!
cd ..
:: 5. ZIP the folder
echo [+] Creating final package with 7-Zip...
:: Rip off pdb files
@@ -205,13 +374,27 @@ if !errorlevel! EQU 0 (
:: Example building rtabmap afterwards
goto :EndComment
:: The vcpkg export folder should not be in the rtabmap source directory
:: (otherwise we get some cmake errors about that)
set VCPKG_UNZIPPED_EXPORT_PATH=%USERPROFILE%\Downloads\vcpkg-export-########-x64-vs2022
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release\bin;%PATH%
set K4A_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
set KINECTSDK20_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
cmake -B build -GNinja ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_AS_BUNDLE=ON -DWITH_PYTHON=ON ^
-DBUILD_AS_BUNDLE=ON ^
-DWITH_PYTHON=ON ^
-DWITH_ZED=OFF ^
-DWITH_CERES=ON ^
-DWITH_ORBBEC_SDK=ON ^
-DWITH_FREENECT2=ON ^
-DWITH_K4W2=ON ^
-DWITH_K4A=ON ^
-DWITH_DEPTHAI=ON ^
-DWITH_REALSENSE2=ON ^
-DWITH_CCCORELIB=ON ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%VCPKG_UNZIPPED_EXPORT_PATH%/installed" ^
+69 -12
View File
@@ -34,6 +34,8 @@ echo Installed CUDA Toolkit: %CUDA_VER%
:: --- CONFIGURATION ---
set "VCPKG_ROOT=%~dp0vcpkg"
set "EXPORT_DIR=%~dp0vcpkg_binaries"
:: All deps downloaded/built from source (pytorch, torchvision, opencv, libfreenect2, ...) live here.
set "SRC_DIR=%~dp0vcpkg_deps_from_source"
set "TRIPLET=x64-windows-release"
set "SEVENZIP_EXE=C:\Program Files\7-Zip\7z.exe"
@@ -70,11 +72,34 @@ if not exist "%FINAL_EXPORT_PATH%" (
xcopy "%CUDA_PATH%\bin\x64\cudnn*.dll" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\bin\" /Y
)
:: For ZED, modify zed-config.cmake and remove all dependencies
if "%ZED_SDK_ROOT_DIR%"=="" (
echo Error: ZED_SDK_ROOT_DIR environment variable is not set!
pause
exit /b 1
)
echo Copying ZED main library only...
robocopy "%ZED_SDK_ROOT_DIR%\bin" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\bin" *.dll /XF nv*.dll
robocopy "%ZED_SDK_ROOT_DIR%\lib" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\lib" /E /XO
robocopy "%ZED_SDK_ROOT_DIR%\include" "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\include" /E /XO
:: Robocopy exit codes under 8 mean successful copies/no changes.
:: 8 or higher means there was a failure.
if !errorlevel! GEQ 8 (
echo Error: Robocopy failed with exit code !errorlevel!
pause
exit /b !errorlevel!
)
:: pytorch deps
%FINAL_EXPORT_PATH%/installed/%TRIPLET%/tools/python3/python.exe -m pip install numpy packaging "setuptools<82" pyyaml typing_extensions
git config --global core.longpaths true
:: All deps cloned/built below go into %SRC_DIR% (incl. libfreenect2 built by
:: bundle_windows_deps.bat) to keep the repo root clean.
if not exist "%SRC_DIR%" mkdir "%SRC_DIR%"
cd /d "%SRC_DIR%"
:: pytorch, build with local cuda libraries to avoid duplicating them when we install rtabmap
echo [+] Building pytorch with cuda support...
if not exist pytorch (
@@ -124,6 +149,7 @@ set TORCHVISION_LIBRARY=%FINAL_EXPORT_PATH%\installed\%TRIPLET%\lib
%FINAL_EXPORT_PATH%/installed/%TRIPLET%/tools/python3/python.exe -m pip install . -v --no-build-isolation || exit /b !errorlevel!
cd ..
:: opencv_cuda
echo [+] Building opencv with cuda support...
if not exist opencv (
@@ -138,7 +164,7 @@ if not exist opencv (
if not exist opencv_contrib (
echo [+] Downloading opencv_contrib...
git clone https://github.com/opencv/opencv_contrib.git || exit /b !errorlevel!
cd opencv
cd opencv_contrib
:: 4.13.0 minimum required to be compatible with cuda 13
:: Dec 31, 2025
git checkout 4.13.0
@@ -174,6 +200,34 @@ robocopy "%FINAL_EXPORT_PATH%\installed\%TRIPLET%\bin\Lib" "%FINAL_EXPORT_PATH%\
cd ..
:: freenect2 with cuda support
:: libfreenect2's CUDA processors include <helper_math.h>, which modern CUDA toolkits
:: no longer ship (it moved to the NVIDIA/cuda-samples repo). Fetch it and point
:: NVCUDASAMPLES_ROOT at it; libfreenect2 adds %NVCUDASAMPLES_ROOT%\common\inc to nvcc.
set "CUDA_SAMPLES_DIR=%SRC_DIR%\cuda-samples"
if not exist "%CUDA_SAMPLES_DIR%\common\inc\helper_math.h" (
mkdir "%CUDA_SAMPLES_DIR%\common\inc"
curl -L -o "%CUDA_SAMPLES_DIR%\common\inc\helper_math.h" "https://raw.githubusercontent.com/NVIDIA/cuda-samples/v12.5/Common/helper_math.h" || exit /b !errorlevel!
)
set "NVCUDASAMPLES_ROOT=%CUDA_SAMPLES_DIR%"
cd libfreenect2
cmake -S . -B build_cuda -GNinja ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=x64-windows-release ^
-DVCPKG_INSTALLED_DIR="%FINAL_EXPORT_PATH%\installed" ^
-DCMAKE_TOOLCHAIN_FILE="%FINAL_EXPORT_PATH%\scripts\buildsystems\vcpkg.cmake" ^
-DPKG_CONFIG_EXECUTABLE="%FINAL_EXPORT_PATH%\installed\%TRIPLET%\tools\pkgconf\pkgconf.exe" ^
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON ^
-DCMAKE_INSTALL_PREFIX="%FINAL_EXPORT_PATH%\installed\%TRIPLET%" ^
-DCMAKE_BUILD_TYPE=Release ^
-DENABLE_CUDA=ON ^
-DENABLE_OPENCL=ON ^
-DENABLE_OPENGL=ON ^
-DBUILD_EXAMPLES=OFF ^
-DBUILD_SHARED_LIBS=ON || exit /b !errorlevel!
cmake --build build_cuda --config Release --target install || exit /b !errorlevel!
cd ..
:: 5. ZIP the folder
echo [+] Creating final package with 7-Zip...
:: Rip off pdb files
@@ -195,8 +249,9 @@ if !errorlevel! EQU 0 (
:: Example building rtabmap with opencv cuda and libtorch afterwards
goto :EndComment
:: Set path of unzipped deps
set VCPKG_UNZIPPED_EXPORT_PATH=
:: The vcpkg export folder should not be in the rtabmap source directory
:: (otherwise we get some cmake errors about that)
set VCPKG_UNZIPPED_EXPORT_PATH=%USERPROFILE%\Downloads\vcpkg-export-########-x64-vs2022
set TRIPLET=x64-windows-release
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\bin;%PATH%
@@ -206,15 +261,9 @@ set PATH=%CUDA_PATH%\bin\x64;%PATH%
set PATH=%CUDA_PATH%\extras\CUPTI\lib64;%PATH%
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\tools\python3\Lib\site-packages\torch\lib;%PATH%
set PATH=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\%TRIPLET%\tools\python3\Lib\site-packages\numpy.libs;%PATH%
:: Other dependencies
:: For ZED, modify zed-config.cmake and remove all dependencies
set PATH=%PATH%;%ZED_SDK_ROOT_DIR%\bin
:: For kinect 4 windows SDK v2, move kinect20.dll from system32 to KINECTSDK20_DIR\bin
:: For kinect 4 windows SDK v1, move kinect10.dll and KinectAudio10.dll to KINECTSDK20_DIR\bin
set PATH=%PATH%;%KINECTSDK20_DIR%\bin
set K4A_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
set KINECTSDK20_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
set ZED_SDK_ROOT_DIR=%VCPKG_UNZIPPED_EXPORT_PATH%\installed\x64-windows-release
cmake -B build_cuda -GNinja ^
-DCMAKE_BUILD_TYPE=Release ^
@@ -222,6 +271,14 @@ cmake -B build_cuda -GNinja ^
-DWITH_PYTHON=ON ^
-DWITH_TORCH=ON ^
-DWITH_ZED=ON ^
-DWITH_CERES=ON ^
-DWITH_ORBBEC_SDK=ON ^
-DWITH_FREENECT2=ON ^
-DWITH_K4W2=ON ^
-DWITH_K4A=ON ^
-DWITH_DEPTHAI=ON ^
-DWITH_REALSENSE2=ON ^
-DWITH_CCCORELIB=ON ^
-DVCPKG_MANIFEST_INSTALL=OFF ^
-DVCPKG_TARGET_TRIPLET=%TRIPLET% ^
-DVCPKG_INSTALLED_DIR="%VCPKG_UNZIPPED_EXPORT_PATH%/installed" ^
+7 -1
View File
@@ -40,7 +40,13 @@ if(NOT Eigen3_FIND_VERSION)
endif()
macro(_eigen3_check_version)
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
# Since Eigen 5.0.0 the version macros moved from Eigen/src/Core/util/Macros.h
# to a dedicated Eigen/Version header, so check the new location first.
if(EXISTS "${EIGEN3_INCLUDE_DIR}/Eigen/Version")
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/Version" _eigen3_version_header)
else()
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
endif()
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
-1
View File
@@ -392,7 +392,6 @@ IF(depthai_FOUND)
SET(PUBLIC_LIBRARIES
${PUBLIC_LIBRARIES}
depthai::core
depthai::opencv
)
ENDIF(depthai_FOUND)
+16 -1
View File
@@ -729,6 +729,21 @@ std::string CameraDepthAI::getSerial() const
return "";
}
#ifdef RTABMAP_DEPTHAI
namespace {
// Convert the depthai depth ImgFrame to cv::Mat (similar to dai::ImgFrame::getCvFrame())
cv::Mat depthImgFrameToCvMat(const std::shared_ptr<dai::ImgFrame> & frame)
{
if(frame->getType() != dai::ImgFrame::Type::RAW16)
{
UERROR("Expected RAW16 depth ImgFrame but got type %d", (int)frame->getType());
return cv::Mat();
}
return cv::Mat((int)frame->getHeight(), (int)frame->getWidth(), CV_16UC1, frame->getData().data()).clone();
}
}
#endif
SensorData CameraDepthAI::captureImage(SensorCaptureInfo * info)
{
SensorData data;
@@ -740,7 +755,7 @@ SensorData CameraDepthAI::captureImage(SensorCaptureInfo * info)
double stamp = std::chrono::duration<double>(depthOrRight->getTimestampDevice(dai::CameraExposureOffset::MIDDLE).time_since_epoch()).count();
if(outputMode_)
data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_ANYCOLOR), depthOrRight->getCvFrame(), stereoModel_.left(), this->getNextSeqID(), stamp);
data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_ANYCOLOR), depthImgFrameToCvMat(depthOrRight), stereoModel_.left(), this->getNextSeqID(), stamp);
else
data = SensorData(cv::imdecode(rgbOrLeft->getData(), cv::IMREAD_GRAYSCALE), cv::imdecode(depthOrRight->getData(), cv::IMREAD_GRAYSCALE), stereoModel_, this->getNextSeqID(), stamp);
+46 -7
View File
@@ -220,6 +220,12 @@ bool CameraOrbbecSDK::init(const std::string & calibrationFolder, const std::str
#ifdef RTABMAP_ORBBEC_SDK
this->close();
// The Orbbec SDK reports failures by throwing ob::Error (e.g. uvc_open
// access denied on macOS without camera permission, or unsupported config).
// Catch them here so init() logs the error and returns false instead of
// letting the exception propagate and abort the whole process.
try {
std::shared_ptr<ob::Device> device;
ob::Context context;
@@ -276,16 +282,20 @@ bool CameraOrbbecSDK::init(const std::string & calibrationFolder, const std::str
}
if(device.get() == nullptr) {
#ifdef __APPLE__
const std::string connectHint = "camera is correctly connected. On macOS the Orbbec "
"camera can only be accessed with root privileges, so run the application with sudo.";
#else
const std::string connectHint = "camera is correctly connected and the udev rules are installed.";
#endif
if(deviceId_.empty()) {
UERROR( "Could not find any orbbec compatible devices! Verify that the "
"camera is correctly connected and the udev rules are installed.");
UERROR("Could not find any orbbec compatible devices! Verify that the %s", connectHint.c_str());
}
else {
UERROR("Could not find an orbbec device with ID \"%s\"! Verify that the "
"camera is correctly connected and the udev rules are installed. "
"Unset the ID to choose the first camera found.");
UERROR("Could not find an orbbec device with ID \"%s\"! Verify that the %s "
"Unset the ID to choose the first camera found.", deviceId_.c_str(), connectHint.c_str());
}
return false;
}
@@ -546,6 +556,22 @@ bool CameraOrbbecSDK::init(const std::string & calibrationFolder, const std::str
return false;
}
}
catch(const ob::Error & e)
{
#ifdef __APPLE__
UERROR("Failed to initialize Orbbec camera: %s. On macOS the Orbbec SDK accesses "
"the camera through libusb, which must take the USB interface from the system "
"UVC driver; this requires root privileges. If this is a USB access error "
"(e.g. \"uvc_open failed ... Return Code: -3\"), run the application with sudo.",
e.what());
#else
UERROR("Failed to initialize Orbbec camera: %s", e.what());
#endif
this->close();
return false;
}
return true;
#else
UERROR("CameraOrbbecSDK: RTAB-Map is not built with Orbbec SDK support!");
@@ -598,13 +624,19 @@ SensorData CameraOrbbecSDK::captureImage(SensorCaptureInfo * info)
UERROR("Camera is not initialized!");
return data;
}
// The streaming calls below can throw ob::Error (transient frame/USB
// errors, filter or profile failures). Catch them so a bad frame is logged
// and skipped (empty SensorData) instead of aborting the whole process.
try {
auto frameset = pipeline_->waitForFrameset();
if(frameset == nullptr || frameset->getCount() == 0) {
UWARN("No frame received!");
return data;
}
if(frameset->getCount() != 2) {
UWARN("Received %s frames, expecting 2!", frameset->getCount());
UWARN("Received %u frames, expecting 2!", frameset->getCount());
return data;
}
@@ -733,6 +765,13 @@ SensorData CameraOrbbecSDK::captureImage(SensorCaptureInfo * info)
}
}
}
catch(const ob::Error & e)
{
UERROR("Error capturing Orbbec camera frame: %s", e.what());
return data;
}
#else
UERROR("CameraOrbbecSDK: RTAB-Map is not built with Orbbec SDK support!");
#endif
+12
View File
@@ -508,7 +508,14 @@ bool CameraRealSense2::init(const std::string & calibrationFolder, const std::st
rs2::device_list list = ctx_.query_devices();
if (0 == list.size())
{
#ifdef __APPLE__
UERROR("No RealSense2 devices were found! On macOS the RealSense SDK accesses "
"the camera through libusb, which must take the USB interface from the "
"system driver; this requires root privileges. If a device is connected "
"but not detected, run the application with sudo.");
#else
UERROR("No RealSense2 devices were found!");
#endif
return false;
}
@@ -546,7 +553,12 @@ bool CameraRealSense2::init(const std::string & calibrationFolder, const std::st
}
catch(const rs2::error & error)
{
#ifdef __APPLE__
UWARN("%s. Is the camera already used with another app? On macOS, accessing a "
"RealSense camera requires root privileges, so try running with sudo.", error.what());
#else
UWARN("%s. Is the camera already used with another app?", error.what());
#endif
}
if (!found)
+13
View File
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e671b87..86b590c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +121,7 @@ set( NANOFLANN_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE )
set( NANOFLANN_BUILD_TESTS OFF CACHE BOOL "" FORCE )
add_subdirectory( extern/nanoflann EXCLUDE_FROM_ALL )
target_link_libraries( CCCoreLib
- PUBLIC
+ PRIVATE
nanoflann::nanoflann
)
+102
View File
@@ -0,0 +1,102 @@
diff --git a/freenect2.cmake.in b/freenect2.cmake.in
index 05df1af..2195bb4 100644
--- a/freenect2.cmake.in
+++ b/freenect2.cmake.in
@@ -1,10 +1,15 @@
+# Resolve paths relative to this config file (<prefix>/lib/cmake/freenect2/) so the
+# install tree stays relocatable (e.g. when shipped/unzipped as a prebuilt bundle).
+get_filename_component(_freenect2_prefix "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY)
+get_filename_component(_freenect2_prefix "${_freenect2_prefix}" DIRECTORY)
+get_filename_component(_freenect2_prefix "${_freenect2_prefix}" DIRECTORY)
FIND_LIBRARY(freenect2_LIBRARY freenect2
- PATHS @CMAKE_INSTALL_PREFIX@/lib
+ PATHS "${_freenect2_prefix}/lib"
NO_DEFAULT_PATH
)
SET(freenect2_LIBRARIES ${freenect2_LIBRARY} @LIBFREENECT2_THREADING_LIBRARIES@)
FIND_PATH(freenect2_INCLUDE_DIR @PROJECT_NAME@/libfreenect2.hpp
- PATHS @CMAKE_INSTALL_PREFIX@/include
+ PATHS "${_freenect2_prefix}/include"
NO_DEFAULT_PATH
)
SET(freenect2_INCLUDE_DIRS ${freenect2_INCLUDE_DIR})
diff --git a/src/cuda_depth_packet_processor.cu b/src/cuda_depth_packet_processor.cu
index 7ca5974..95c8e11 100644
--- a/src/cuda_depth_packet_processor.cu
+++ b/src/cuda_depth_packet_processor.cu
@@ -779,12 +779,7 @@ public:
cudaDeviceProp prop;
CHECK_CUDA(cudaGetDeviceProperties(&prop, i));
- LOG_INFO << "device " << i << ": " << prop.name << " @ " << (prop.clockRate / 1000) << "MHz Memory " << (prop.totalGlobalMem >> 20) << "MB";
-
- if (prop.computeMode == cudaComputeModeProhibited) {
- LOG_INFO << " Compute Mode Prohibited";
- continue;
- }
+ LOG_INFO << "device " << i << ": " << prop.name << " Memory " << (prop.totalGlobalMem >> 20) << "MB";
if (prop.major < 1) {
LOG_INFO << " does not support CUDA";
diff --git a/src/cuda_kde_depth_packet_processor.cu b/src/cuda_kde_depth_packet_processor.cu
index 0a16f55..bca00cc 100644
--- a/src/cuda_kde_depth_packet_processor.cu
+++ b/src/cuda_kde_depth_packet_processor.cu
@@ -1192,12 +1192,7 @@ public:
cudaDeviceProp prop;
CHECK_CUDA(cudaGetDeviceProperties(&prop, i));
- LOG_INFO << "device " << i << ": " << prop.name << " @ " << (prop.clockRate / 1000) << "MHz Memory " << (prop.totalGlobalMem >> 20) << "MB";
-
- if (prop.computeMode == cudaComputeModeProhibited) {
- LOG_INFO << " Compute Mode Prohibited";
- continue;
- }
+ LOG_INFO << "device " << i << ": " << prop.name << " Memory " << (prop.totalGlobalMem >> 20) << "MB";
if (prop.major < 1) {
LOG_INFO << " does not support CUDA";
diff --git a/src/opencl_depth_packet_processor.cpp b/src/opencl_depth_packet_processor.cpp
index d8db14d..51d0883 100644
--- a/src/opencl_depth_packet_processor.cpp
+++ b/src/opencl_depth_packet_processor.cpp
@@ -251,7 +251,7 @@ public:
newIrFrame();
newDepthFrame();
- const int CL_ICDL_VERSION = 2;
+ const int clIcdlVersion = 2;
typedef cl_int (*icdloader_func)(int, size_t, void*, size_t*);
#ifdef _MSC_VER
#pragma warning(push)
@@ -269,7 +269,7 @@ public:
if (clGetICDLoaderInfoOCLICD != NULL)
{
char buf[16];
- if (clGetICDLoaderInfoOCLICD(CL_ICDL_VERSION, sizeof(buf), buf, NULL) == CL_SUCCESS)
+ if (clGetICDLoaderInfoOCLICD(clIcdlVersion, sizeof(buf), buf, NULL) == CL_SUCCESS)
{
if (strcmp(buf, "2.2.4") < 0 && strlen(buf) <= 5)
LOG_WARNING << "Your ocl-icd has deadlock bugs. Update to 2.2.4+ is recommended.";
diff --git a/src/opencl_kde_depth_packet_processor.cpp b/src/opencl_kde_depth_packet_processor.cpp
index 98dbdff..97fbc6d 100644
--- a/src/opencl_kde_depth_packet_processor.cpp
+++ b/src/opencl_kde_depth_packet_processor.cpp
@@ -259,7 +259,7 @@ public:
newIrFrame();
newDepthFrame();
- const int CL_ICDL_VERSION = 2;
+ const int clIcdlVersion = 2;
typedef cl_int (*icdloader_func)(int, size_t, void*, size_t*);
#ifdef _MSC_VER
#pragma warning(push)
@@ -277,7 +277,7 @@ public:
if (clGetICDLoaderInfoOCLICD != NULL)
{
char buf[16];
- if (clGetICDLoaderInfoOCLICD(CL_ICDL_VERSION, sizeof(buf), buf, NULL) == CL_SUCCESS)
+ if (clGetICDLoaderInfoOCLICD(clIcdlVersion, sizeof(buf), buf, NULL) == CL_SUCCESS)
{
if (strcmp(buf, "2.2.4") < 0)
LOG_WARNING << "Your ocl-icd has deadlock bugs. Update to 2.2.4+ is recommended.";
+29
View File
@@ -0,0 +1,29 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 261f2cda..644e068f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -92,17 +92,20 @@ if(OB_IS_MAIN_PROJECT)
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/generated/Export.h" DESTINATION include/libobsensor/h)
- install(EXPORT ${OB_SDK_LIB_NAME}Config NAMESPACE ob:: DESTINATION lib)
+ install(EXPORT ${OB_SDK_LIB_NAME}Config NAMESPACE ob:: DESTINATION lib/cmake/${OB_SDK_LIB_NAME})
include(CMakePackageConfigHelpers)
+ # Name the version file <pkg>ConfigVersion.cmake (not <pkg>Version.cmake) and
+ # install it next to the config in lib/cmake/<pkg>, so find_package(OrbbecSDK)
+ # discovers it in config mode and reads its version.
write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}Version.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}ConfigVersion.cmake"
VERSION "${PROJECT_VERSION}"
COMPATIBILITY SameMajorVersion
)
install(
- FILES "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}Version.cmake"
- DESTINATION lib
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/${OB_SDK_LIB_NAME}ConfigVersion.cmake"
+ DESTINATION lib/cmake/${OB_SDK_LIB_NAME}
)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:${OB_SDK_LIB_NAME}> DESTINATION bin OPTIONAL)
+25 -1
View File
@@ -48,6 +48,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
#include <signal.h>
#include <QApplication>
#include <QSurfaceFormat>
#include <vtkVersionMacros.h>
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
#include <QVTKRenderWidget.h>
#endif
void showUsage(const char * executableName)
{
@@ -168,7 +173,6 @@ int main(int argc, char * argv[])
}
if (strcmp(argv[i], "-pcl") == 0)
{
++i;
usePCLViz = true;
continue;
}
@@ -370,6 +374,18 @@ int main(int argc, char * argv[])
exit(1);
}
#ifdef __APPLE__
if(usePCLViz)
{
// pcl::visualization::CloudViewer creates its render window on its own
// background thread, but macOS only allows NSWindow creation on the main
// thread, so it aborts. Fall back to the default (Qt) viewer.
printf("-pcl is not supported on macOS (pcl::visualization::CloudViewer creates its "
"window on a background thread, which macOS forbids). Using the default viewer instead.\n");
usePCLViz = false;
}
#endif
if(usePCLViz)
{
rtabmap::SensorData data = camera->takeData();
@@ -485,6 +501,14 @@ int main(int argc, char * argv[])
}
else // Use our own visualizer
{
#if VTK_MAJOR_VERSION > 9 || (VTK_MAJOR_VERSION==9 && VTK_MINOR_VERSION >= 1)
// Needed to ensure the appropriate OpenGL context is created for VTK
// rendering (QVTKOpenGLNativeWidget). Without it the embedded VTK widget
// gets an incompatible context and VTK calls a null GL function pointer
// (crash in vtkOpenGLVertexArrayObject::Bind on first paint). Must be set
// before QApplication is constructed.
QSurfaceFormat::setDefaultFormat(QVTKRenderWidget::defaultFormat());
#endif
QApplication app(argc, argv);
rtabmap::CameraViewer cameraViewer;
+18
View File
@@ -113,6 +113,18 @@
"kinectsdk2"
]
},
"libfreenect2-deps": {
"description": "Build libfreenect2's dependencies",
"dependencies": [
"libusb",
"libjpeg-turbo",
"glfw3",
{
"name": "pkgconf",
"host": true
}
]
},
"libpointmatcher-deps": {
"description": "Build libpointmatcher's dependencies",
"dependencies": [
@@ -173,6 +185,12 @@
}
]
},
"pdal": {
"description": "Build RTAB-Map with pdal support",
"dependencies": [
"pdal"
]
},
"python": {
"description": "Build RTAB-Map with python support",
"dependencies": [