Skip to content

Commit

Permalink
Merge branch 'master' into 144-realsense-synchronisation
Browse files Browse the repository at this point in the history
# Conflicts:
#	cwipc_realsense2
#	cwipc_util
  • Loading branch information
cwidisgroup committed Nov 6, 2024
2 parents 129ef62 + ae8b949 commit 533215d
Show file tree
Hide file tree
Showing 13 changed files with 260 additions and 45 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,83 @@ jobs:
if-no-files-found: error
include-hidden-files: true

build-android:
name: build-android
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: 'recursive'
lfs: 'true'
fetch-depth: 0
- name: Get all tags
run: |
git show-ref --tags
git log -40
git describe --debug
git describe --tags --debug
- name: Free some space
run: |
df -h
# Remove software and language runtimes we're not using
sudo rm -rf \
"$AGENT_TOOLSDIRECTORY" \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/lib/node_modules \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
df -h
- name: Install Android NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r27b
add-to-path: true

- name: Build & Test
uses: ashutoshvarma/action-cmake-build@master
with:
build-dir: ${{ github.workspace }}/build
configure-options: --preset android-production -Wno-dev
build-options: --preset android-production
run-test: false
install-build: false
install-options: --prefix ${{ github.workspace }}/installed
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
- name: Create installer
shell: bash
run: |
cpack --config build/CPackConfig.cmake -D CPACK_PACKAGE_FILE_NAME="cwipc_${{ github.ref_name }}_android_arm64"
ls -l build/package
- name: Capture build folder as artifact
if: ${{ failure() }}
shell: bash
run: tar cfz build.tgz build
- name: Upload build folder
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: android-build-folder
path: build.tgz

- name: Upload installer package
uses: actions/upload-artifact@v3
with:
name: android-arm64-package
path: build/package/*.tar.gz

build-ubuntu2404:
name: build-ubuntu2404
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -390,6 +467,7 @@ jobs:
- build-macos
- build-ubuntu2204
- build-ubuntu2404
- build-android
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -450,6 +528,11 @@ jobs:
with:
name: windows-installer.exe
path: ../Assets/
- name: Download Android installer
uses: actions/download-artifact@v3
with:
name: android-arm64-package
path: ../Assets/
- name: Find Artefact names
run: |
windows_exe_path=$(ls ../Assets/*.exe | head -n 1)
Expand Down Expand Up @@ -512,6 +595,16 @@ jobs:
asset_path: ../Assets/${{ github.ref_name }}-complete.tar.gz
asset_name: cwipc-${{ github.ref_name }}-source-including-submodules.tar.gz
asset_content_type: application/zip

- name: Upload Android package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../Assets/cwipc_${{ github.ref_name }}_android_arm64.tar.gz
asset_name: cwipc_${{ github.ref_name }}_android_arm64.tar.gz
asset_content_type: application/zip
- name: Upload complete source (zip)
uses: actions/upload-release-asset@v1
env:
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
update = merge
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/Microsoft/vcpkg.git
url = git@github.com:jackjansen/vcpkg.git
12 changes: 7 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Realsense capturer can now record during live capture, using `system.record_to_directory` config setting. (#119)
- Debian packages for Ubuntu 24.04 (#143), for the time being without Kinect and Realsense support.
- Android-arm64 build added (#91), untested for now.

### Changed

- Minor documentation fixes
- More resilience against incomplete installations (#108)
- Don't use numpy 2.0 until issues with open3d are fixed (#109)
- Fixed colors for cwipc_view --rgb with RealSense camera (#115)
- Fixed cwipc_register for multiple RealSense cameras (#106)
- Fixed cwipc_synthetic reader to not wait on available(False) (#117)
- Realsense cameraconfig.json file rationalized. Major code cleanup. (#137, #125, #118)
- Fixed colors for `cwipc_view --rgb` with RealSense camera (#115)
- Fixed `cwipc_register` for multiple RealSense cameras (#106)
- Fixed `cwipc_synthetic` reader to not wait on available(False) (#117)
- Realsense `cameraconfig.json` file rationalized. Major code cleanup. (#137, #125, #118)
- Calibration of Realsense D455 cameras fixed. (#127)
- Use cmake presets for building (#120)
- Use pyproject.toml for Python package generation (#79)
- Use `pyproject.toml` for Python package generation (#79)
- Implemented recording while capturing for both Realsense and Kinect (#139)
- Glfw is now used via normal dependencies, no longer slurped (#123)
- `cwipc_forward` can now serve streams to multiple connections at the same time (#151)

## [7.5.3] - 2024-04-30

Expand Down
5 changes: 4 additions & 1 deletion CMakeFiles/CwipcInstallers.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

# Creating installers
if(APPLE)
if(ANDROID)
set(CPACK_GENERATOR TGZ)
set(CPACK_SOURCE_GENERATOR TGZ)
elseif(APPLE)
set(CPACK_GENERATOR TGZ)
set(CPACK_SOURCE_GENERATOR TGZ)
elseif(UNIX)
Expand Down
114 changes: 87 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,65 @@ cmake_policy(SET CMP0074 NEW)
cmake_policy(SET CMP0072 NEW)
#cmake_policy(SET CMP0135 NEW)

#
# Set auxiliary CMake variables that control which optional parts are built.
# These can be overridden on the command line, or through the CMake presets.
#
set(CWIPC_API_ONLY NO CACHE BOOL "Only build libraries")
if(CWIPC_API_ONLY)
set(CWIPC_WITH_APPS NO CACHE BOOL "Build command line apps")
set(CWIPC_WITH_PYTHON NO CACHE BOOL "Build Python support and tests")
set(CWIPC_WITH_GUI NO CACHE BOOL "Include cwipc_window() and other gui")
set(CWIPC_WITH_TESTS NO CACHE BOOL "Include tests")
set(CWIPC_WITH_DATA NO CACHE BOOL "Include data")
else()
set(CWIPC_WITH_APPS YES CACHE BOOL "Build command line apps")
set(CWIPC_WITH_PYTHON YES CACHE BOOL "Build Python support and tests")
set(CWIPC_WITH_GUI YES CACHE BOOL "Include cwipc_window() and other gui")
set(CWIPC_WITH_TESTS YES CACHE BOOL "Include tests")
set(CWIPC_WITH_DATA YES CACHE BOOL "Include data")
endif()
set(CWIPC_WITH_CAPTURERS YES CACHE BOOL "Include camera capturers")
if(CWIPC_WITH_CAPTURERS)
set(CWIPC_WITH_KINECT YES CACHE BOOL "Include Azure Kinect capturer")
set(CWIPC_WITH_REALSENSE YES CACHE BOOL "Include Intel Realsense capturer")
else()
set(CWIPC_WITH_KINECT NO CACHE BOOL "Include Azure Kinect support (if available)")
set(CWIPC_WITH_REALSENSE NO CACHE BOOL "Include Realsense2 support (if available)")
endif()
set(CWIPC_WITH_INSTALLER YES)
#
# If we are using vcpkg we want to set some options based on the setting above.
#
if(CWIPC_WITH_CAPTURERS)
list(APPEND VCPKG_MANIFEST_FEATURES "capturers")
endif()
if(CWIPC_WITH_GUI)
list(APPEND VCPKG_MANIFEST_FEATURES "gui")
endif()
if(CWIPC_WITH_PYTHON)
list(APPEND VCPKG_MANIFEST_FEATURES "python")
endif()

# Add extension directories (for things like Find<package>)
set(CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/CMakeFiles
${CMAKE_CURRENT_LIST_DIR}/cwipc_util/CMakeFiles
${CMAKE_CURRENT_LIST_DIR}/cwipc_codec/CMakeFiles
${CMAKE_CURRENT_LIST_DIR}/cwipc_realsense2/CMakeFiles
${CMAKE_CURRENT_LIST_DIR}/cwipc_kinect/CMakeFiles
${CMAKE_MODULE_PATH}
)
if(CWIPC_WITH_REALSENSE)
set(CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/cwipc_realsense2/CMakeFiles
${CMAKE_MODULE_PATH}
)
endif()
if(CWIPC_WITH_KINECT)
set(CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/cwipc_kinect/CMakeFiles
${CMAKE_MODULE_PATH}
)
endif()

# Get version from git if not specified on the command line
if(NOT CWIPC_VERSION)
Expand All @@ -30,7 +80,6 @@ project(cwipc VERSION ${CWIPC_BASE_VERSION})

include(CTest)
include(GNUInstallDirs)
include(CwipcPythonSupport)

# Ensure all executable, dll/so and link-library outputs end up in the same directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
Expand All @@ -42,12 +91,7 @@ set(CMAKE_TESTDATA_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/share/cwipc/tests)
set(CMAKE_TESTDATA_INSTALL_DIRECTORY ${CMAKE_INSTALL_DATADIR}/cwipc/tests)
set(CMAKE_REGISTRATIONDATA_INSTALL_DIRECTORY ${CMAKE_INSTALL_DATADIR}/cwipc/registration)
set(CMAKE_SCRIPTS_INSTALL_DIRECTORY ${CMAKE_INSTALL_LIBEXECDIR}/cwipc)
#
# Ensure we clean out the Python wheels directory before installing
#
GNUInstallDirs_get_absolute_install_dir(WHEELDEST CMAKE_PYWHEELS_INSTALL_DIRECTORY WHEELDEST)
install(CODE "message(\"-- Remove ${WHEELDEST}\")")
install(CODE "file(REMOVE_RECURSE \"${WHEELDEST}\")")

#
# Ensure we use the correct RPATH in installed binaries.
# This also works in the build tree, because we use the staging area to
Expand All @@ -64,16 +108,26 @@ elseif(UNIX)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()

# The upper limit on the Python version is caused by opencv and open3d,
# which can lag behind some times. As soon as those packages are available
# for a new release of Python we can update this version.
#
find_package(Python3 3.9...<3.12 REQUIRED COMPONENTS Interpreter)

#
# Now we can setup the venv.
#
cwipc_setup_python_venv()
if(CWIPC_WITH_PYTHON)
include(CwipcPythonSupport)
#
# Ensure we clean out the Python wheels directory before installing
#
GNUInstallDirs_get_absolute_install_dir(WHEELDEST CMAKE_PYWHEELS_INSTALL_DIRECTORY WHEELDEST)
install(CODE "message(\"-- Remove ${WHEELDEST}\")")
install(CODE "file(REMOVE_RECURSE \"${WHEELDEST}\")")

# The upper limit on the Python version is caused by opencv and open3d,
# which can lag behind some times. As soon as those packages are available
# for a new release of Python we can update this version.
#
find_package(Python3 3.9...<3.12 REQUIRED COMPONENTS Interpreter)

#
# Now we can setup the venv.
#
cwipc_setup_python_venv()
endif()

#
# Packages required by all submodules
Expand All @@ -96,7 +150,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
else()
find_package(libjpeg-turbo REQUIRED)
endif()
find_package(PCL REQUIRED COMPONENTS common io octree filters features geometry kdtree)
find_package(PCL REQUIRED COMPONENTS common io octree filters features geometry kdtree OPTIONAL_COMPONENTS io_ply)


#
Expand All @@ -118,8 +172,12 @@ endif()
#
# Optional packages, required by some submodules
#
find_package(k4a)
find_package(REALSENSE2)
if(CWIPC_WITH_KINECT)
find_package(k4a)
endif()
if(CWIPC_WITH_REALSENSE)
find_package(REALSENSE2)
endif()

add_subdirectory("cwipc_util")
add_subdirectory("cwipc_codec")
Expand All @@ -129,9 +187,11 @@ endif()
if(k4a_FOUND)
add_subdirectory("cwipc_kinect")
endif()

if(CWIPC_WITH_APPS)
# Install scripts to help installing prerequisites
install(DIRECTORY scripts DESTINATION ${CMAKE_SCRIPTS_INSTALL_DIRECTORY})

# Creating installers
include(CwipcInstallers)
install(DIRECTORY scripts DESTINATION ${CMAKE_SCRIPTS_INSTALL_DIRECTORY})
endif()
if(CWIPC_WITH_INSTALLER)
# Creating installers
include(CwipcInstallers)
endif()
31 changes: 29 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,24 @@
},
"hidden": true
},
{
"name" : "api-only",
"description" : "Build only native API libraries",
"generator" : "Unix Makefiles",
"inherits" : "vcpkg",
"cacheVariables" : {
"CMAKE_BUILD_TYPE" : "Release",
"CWIPC_API_ONLY" : "YES"
}
},
{
"name" : "windows",
"description" : "Build for production on Windows",
"generator" : "Visual Studio 17 2022",
"inherits" : "vcpkg",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows"
},
},
"installDir": "${sourceDir}/../installed",
"condition": {
"type": "equals",
Expand All @@ -49,6 +59,18 @@
"inherits" : "windows"
},
{
"name" : "android-production",
"description" : "Build for production for Android",
"inherits" : "api-only",
"cacheVariables" : {
"CWIPC_WITH_CAPTURERS" : "NO",
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE" : "${sourceDir}/vcpkg/scripts/toolchains/android.cmake",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/vcpkg-additions/triplets",
"VCPKG_TARGET_TRIPLET" : "arm64-android-release",
"ANDROID_ABI" : "arm64-v8a",
"ANDROID_NATIVE_API_LEVEL" : "32"
}
},{
"name" : "mac-production",
"description" : "Build for production on Mac",
"generator" : "Unix Makefiles",
Expand Down Expand Up @@ -165,7 +187,12 @@
"lhs": "${hostSystemName}",
"rhs": "Linux"
}
}
},
{
"name" : "android-production",
"configurePreset" : "android-production",
"configuration" : "Release"
}
],
"testPresets" : [
{
Expand Down
2 changes: 1 addition & 1 deletion cwipc_codec
Loading

0 comments on commit 533215d

Please sign in to comment.