Skip to content

Commit

Permalink
Ros release 2.28.0 (luxonis#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serafadam authored Aug 21, 2024
1 parent 1aeacdd commit ef1481f
Show file tree
Hide file tree
Showing 27 changed files with 938 additions and 53 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/main.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-11, windows-latest, ubuntu-latest]
cmake: ['3.10.x', ''] # Older version (Ubuntu 18.04) and newest
os: [macos-latest, windows-latest, ubuntu-latest]
cmake: ['3.10.x', '3.29.x'] # Older version (Ubuntu 18.04) and newest
exclude:
- os: windows-latest
cmake: '3.10.x'
Expand Down Expand Up @@ -185,6 +185,8 @@ jobs:
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.29.x'

- name: Configure ${{ matrix.build-type }}, shared ${{ matrix.shared }}, ${{ matrix.platform }}
run: cmake -S . -B build -D BUILD_SHARED_LIBS=${{ matrix.shared}} -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install ${{ env.CMAKE_ARGS }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/python-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: Depthai Python CI/CD

# Added to main to allow workflow_dispath on v3 branches
on:
workflow_dispatch:
18 changes: 18 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package depthai
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2.28.0 (2024-08-21)
-----------
Features
* Changed the automatic crashdump collection to always on unless DEPTHAI_DISABLE_CRASHDUMP_COLLECTION is set.
* Added DEPTHAI_ENABLE_ANALYTICS_COLLECTION environment varialbe - when set, analytic data (pipeline schema) is sent to Luxonis which will be used to further improve the library.
* Undistort both outputs of ToF by default.
* Improved 3A syncing on OAK-D-LR
* Added support for YoloV10
* Bug fixes
* Fix Camera node to correctly allocate resources for undistortion
* Fix StereoDepth node when decimation filter and depth alignment are used
* Fix host timestamps of thermal frames to be synced
* Misc
* Updated XLink to support clangd and shared libraries on Windows:
* luxonis/XLink#81
* luxonis/XLink#84
* Remove a custom assert to always produce a crash dump to improve the UX with the automatic crashdump collection
* Increased watchdog priority on device side to improve stability during high load

2.26.1 (2024-06-12)
-----------
Expand Down
38 changes: 35 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Early options
option(DEPTHAI_ENABLE_LIBUSB "Enable usage of libusb and interaction with USB devices" ON)

# Early options
option(DEPTHAI_ENABLE_LIBUSB "Enable usage of libusb and interaction with USB devices" ON)

# Set to use native tls for windows before including Hunter (used for Curl)
if(WIN32)
set(DEPTHAI_CURL_USE_SCHANNEL ON)
set(DEPTHAI_CURL_USE_OPENSSL OFF)
else()
set(DEPTHAI_CURL_USE_SCHANNEL OFF)
set(DEPTHAI_CURL_USE_OPENSSL ON)
endif()

# Set type to canonicalize relative paths for user-provided toolchain
set(CMAKE_TOOLCHAIN_FILE "" CACHE FILEPATH "CMake toolchain path")

Expand All @@ -39,8 +51,8 @@ endif()

include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.322.tar.gz"
SHA1 "cb0ea1f74f4a2c49a807de34885743495fccccbe"
URL "https://github.com/cpp-pm/hunter/archive/9d9242b60d5236269f894efd3ddd60a9ca83dd7f.tar.gz"
SHA1 "16cc954aa723bccd16ea45fc91a858d0c5246376"
LOCAL # Local config for dependencies
)

Expand All @@ -50,7 +62,7 @@ if(WIN32)
endif()

# Create depthai project
project(depthai VERSION "2.26.1" LANGUAGES CXX C)
project(depthai VERSION "2.28.0" LANGUAGES CXX C)
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
Expand Down Expand Up @@ -115,6 +127,16 @@ else()
endif()
endif()

# Check if on 32 bit linux - default without CURL support
if(CMAKE_SIZEOF_VOID_P EQUAL 4 AND UNIX)
set(DEPTHAI_DEFAULT_CURL_SUPPORT OFF)
else()
set(DEPTHAI_DEFAULT_CURL_SUPPORT ON)
endif()

option(DEPTHAI_ENABLE_CURL "Enable CURL support" ${DEPTHAI_DEFAULT_CURL_SUPPORT})
message(STATUS "CURL support: ${DEPTHAI_ENABLE_CURL}")

# Force Colored output when using Ninja
# Global option - affects all targets
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)" OFF)
Expand Down Expand Up @@ -271,6 +293,7 @@ add_library(${TARGET_CORE_NAME}
src/utility/XLinkGlobalProfilingLogger.cpp
src/utility/Logging.cpp
src/utility/EepromDataParser.cpp
src/utility/LogCollection.cpp
src/xlink/XLinkConnection.cpp
src/xlink/XLinkStream.cpp
src/openvino/OpenVINO.cpp
Expand Down Expand Up @@ -461,8 +484,17 @@ target_link_libraries(${TARGET_CORE_NAME}
archive_static
spdlog::spdlog
ZLIB::zlib
ghcFilesystem::ghc_filesystem
)

if(DEPTHAI_ENABLE_CURL)
target_link_libraries(${TARGET_CORE_NAME} PRIVATE
CURL::libcurl
cpr::cpr
)
target_compile_definitions(${TARGET_CORE_NAME} PRIVATE DEPTHAI_ENABLE_CURL)
endif()

# Add compile & CMake definitions
set(DEPTHAI_DEVICE_VERSION "${DEPTHAI_DEVICE_SIDE_COMMIT}")
target_compile_definitions(${TARGET_CORE_NAME}
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ To install PCL:
MacOS: `brew install pcl`
Linux: `sudo apt install libpcl-dev`

> ℹ️ On Linux distributions based on RPMs, you need to install `perl-core` required by OpenSSL dependency.
>```
>sudo yum install perl-core
>```
>
> Another option is to disable CURL support by setting `DEPTHAI_ENABLE_CURL=OFF` when configuring CMake.
> ```
> cmake -S. -Bbuild -D'DEPTHAI_ENABLE_CURL=OFF'
> ```
## Building
Make sure submodules are updated
Expand Down Expand Up @@ -194,7 +203,8 @@ The following environment variables can be set to alter default behavior of the
| DEPTHAI_LIBUSB_ANDROID_JAVAVM | JavaVM pointer that is passed to libusb for rootless Android interaction with devices. Interpreted as decimal value of uintptr_t |
| DEPTHAI_CRASHDUMP | Directory in which to save the crash dump. |
| DEPTHAI_CRASHDUMP_TIMEOUT | Specifies the duration in seconds to wait for device reboot when obtaining a crash dump. Crash dump retrieval disabled if 0. |
| DEPTHAI_PCL_SUPPORT | Enables PCL support. |
| DEPTHAI_ENABLE_ANALYTICS_COLLECTION | Enables automatic analytics collection (pipeline schemas) used to improve the library |
| DEPTHAI_DISABLE_CRASHDUMP_COLLECTION | Disables automatic crash dump collection used to improve the library |
## Running tests
Expand Down
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "24a3b465b979de3f69410cd225914d8bd029f3ba")
set(DEPTHAI_DEVICE_SIDE_COMMIT "9ed7c9ae4c232ff93a3500a585a6b1c00650e22c")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
41 changes: 36 additions & 5 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
hunter_config(
nlohmann_json
VERSION "3.9.1"
URL "https://github.com/nlohmann/json/archive/v3.9.1.tar.gz"
SHA1 "f8a20a7e19227906d77de0ede97468fbcfea03e7"
)

hunter_config(
XLink
VERSION "luxonis-2021.4.2-xlink-linkid-race-fix"
URL "https://github.com/luxonis/XLink/archive/e9eb1ef38030176ad70cddd3b545d5e6c509f1e1.tar.gz"
SHA1 "b1e4ded41cd7b9c37189468e2aaddbb10cbda9f6"
VERSION "luxonis-2021.4.2-master"
URL "https://github.com/luxonis/XLink/archive/2b517e1cb1ca77bea17679f9fdeb739812431174.tar.gz"
SHA1 "fa7eeb46abeb97626dad923b7733899198284587"
CMAKE_ARGS
XLINK_ENABLE_LIBUSB=${DEPTHAI_ENABLE_LIBUSB}
)
Expand Down Expand Up @@ -126,3 +124,36 @@ hunter_config(
# Build shared libs by default to not cause licensing issues
BUILD_SHARED_LIBS=ON
)

hunter_config(
CURL
VERSION "7.88.1-p0-custom"
URL "https://github.com/cpp-pm/curl/archive/25d45e89d140d6ab27103cd7f8f6d7d6cf548d47.tar.gz"
SHA1 "db96d87e078e529a90dfb74de8d360a785c053aa"
CMAKE_ARGS
BUILD_CURL_TESTS=OFF
BUILD_CURL_EXE=OFF
CURL_USE_SCHANNEL=${DEPTHAI_CURL_USE_SCHANNEL}
CURL_USE_OPENSSL=${DEPTHAI_CURL_USE_OPENSSL} # Override hunter flags - no OpenSSL needed on Windows
BUILD_STATIC_CURL=ON
BUILD_SHARED_LIBS=OFF
BUILD_STATIC_LIBS=ON
)

# A hunterized and patched version of cpr- see https://github.com/luxonis/cpr/pull/1
hunter_config(
cpr
VERSION "1.4.0"
URL "https://github.com/luxonis/cpr/archive/50a1321738554e0152b0a6f1b0ca24e4fdecff5c.tar.gz"
SHA1 "2e2ba9920ed99c19887592ca89d9be5ffce4722b"
)

hunter_config(
ghc_filesystem
VERSION "1.5.14-luxonis"
URL "https://github.com/luxonis/filesystem/archive/d29630953f3526b61842d937764f012503a79ec3.tar.gz"
SHA1 "1cee5c95b53e014710970c920230ad1d3f3b5055"
CMAKE_ARGS
GHC_FILESYSTEM_BUILD_EXAMPLES=OFF
GHC_FILESYSTEM_BUILD_TESTING=OFF
)
2 changes: 2 additions & 0 deletions cmake/depthaiConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set(DEPTHAI_SHARED_LIBS @BUILD_SHARED_LIBS@)
# Get whether library was build with Backward or not
set(DEPTHAI_ENABLE_BACKWARD @DEPTHAI_ENABLE_BACKWARD@)

set(DEPTHAI_ENABLE_CURL @DEPTHAI_ENABLE_CURL@)

# Specify that this is config mode (Called by find_package)
set(CONFIG_MODE TRUE)

Expand Down
12 changes: 12 additions & 0 deletions cmake/depthaiDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ else()
if(DEPTHAI_PCL_SUPPORT)
hunter_add_package(jsoncpp)
endif()

if(DEPTHAI_ENABLE_CURL)
hunter_add_package(CURL)
hunter_add_package(cpr)
endif()
hunter_add_package(ghc_filesystem)
endif()

# If library was build as static, find all dependencies
Expand Down Expand Up @@ -58,6 +64,12 @@ if(NOT CONFIG_MODE OR (CONFIG_MODE AND NOT DEPTHAI_SHARED_LIBS))
unset(STACK_DETAILS_AUTO_DETECT)
endif()

# Log collection dependencies
if(DEPTHAI_ENABLE_CURL)
find_package(CURL ${_QUIET} CONFIG REQUIRED)
find_package(cpr ${_QUIET} CONFIG REQUIRED)
endif()
find_package(ghc_filesystem ${_QUIET} CONFIG REQUIRED)
endif()

# Add threads (c++)
Expand Down
15 changes: 7 additions & 8 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ dai_add_example(rgb_encoding_mono_mobilenet mixed/rgb_encoding_mono_mobilenet.cp
dai_add_example(rgb_encoding_mono_mobilenet_depth mixed/rgb_encoding_mono_mobilenet_depth.cpp ON OFF)
dai_add_example(rgb_encoding_mobilenet mixed/rgb_encoding_mobilenet.cpp ON OFF)
dai_add_example(multiple_devices mixed/multiple_devices.cpp OFF OFF)
dai_add_example(frame_sync mixed/frame_sync.cpp ON OFF)

target_compile_definitions(mono_depth_mobilenetssd PRIVATE BLOB_PATH="${mobilenet_blob}")
target_compile_definitions(rgb_encoding_mono_mobilenet PRIVATE BLOB_PATH="${mobilenet_blob}")
Expand Down Expand Up @@ -410,15 +409,15 @@ dai_add_example(thermal_align ImageAlign/thermal_align.cpp OFF OFF)
dai_add_example(depth_align ImageAlign/depth_align.cpp ON OFF)

# Cast
dai_add_example(blur Cast/blur.cpp ON OFF)
target_compile_definitions(blur PRIVATE BLOB_PATH="${blur_model}")
dai_add_example(concat Cast/concat.cpp ON OFF)
target_compile_definitions(concat PRIVATE BLOB_PATH="${concat_model}")
dai_add_example(diff Cast/diff.cpp ON OFF)
target_compile_definitions(diff PRIVATE BLOB_PATH="${diff_model}")
dai_add_example(cast_blur Cast/cast_blur.cpp ON OFF)
target_compile_definitions(cast_blur PRIVATE BLOB_PATH="${blur_model}")
dai_add_example(cast_concat Cast/cast_concat.cpp ON OFF)
target_compile_definitions(cast_concat PRIVATE BLOB_PATH="${concat_model}")
dai_add_example(cast_diff Cast/cast_diff.cpp ON OFF)
target_compile_definitions(cast_diff PRIVATE BLOB_PATH="${diff_model}")


# ToF
dai_add_example(spatial_tiny_yolo_tof_v3 SpatialDetection/spatial_tiny_yolo_tof.cpp OFF OFF)
dai_add_example(spatial_tiny_yolo_tof_v4 SpatialDetection/spatial_tiny_yolo_tof.cpp OFF OFF)
target_compile_definitions(spatial_tiny_yolo_tof_v3 PRIVATE BLOB_PATH="${tiny_yolo_v3_blob}")
target_compile_definitions(spatial_tiny_yolo_tof_v4 PRIVATE BLOB_PATH="${tiny_yolo_v4_blob}")
50 changes: 50 additions & 0 deletions examples/Cast/cast_blur.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include <depthai/depthai.hpp>
#include <opencv2/opencv.hpp>

constexpr int SHAPE = 300;

int main() {
dai::Pipeline p;

auto camRgb = p.create<dai::node::ColorCamera>();
auto nn = p.create<dai::node::NeuralNetwork>();
auto rgbOut = p.create<dai::node::XLinkOut>();
auto cast = p.create<dai::node::Cast>();
auto castXout = p.create<dai::node::XLinkOut>();

camRgb->setPreviewSize(SHAPE, SHAPE);
camRgb->setInterleaved(false);

nn->setBlobPath(BLOB_PATH);

rgbOut->setStreamName("rgb");
castXout->setStreamName("cast");

cast->setOutputFrameType(dai::ImgFrame::Type::BGR888p);

// Linking
camRgb->preview.link(nn->input);
camRgb->preview.link(rgbOut->input);
nn->out.link(cast->input);
cast->output.link(castXout->input);

dai::Device device(p);
auto qCam = device.getOutputQueue("rgb", 4, false);
auto qCast = device.getOutputQueue("cast", 4, false);

while(true) {
auto inCast = qCast->get<dai::ImgFrame>();
auto inRgb = qCam->get<dai::ImgFrame>();

if(inCast && inRgb) {
cv::imshow("Blur", inCast->getCvFrame());
cv::imshow("Original", inRgb->getCvFrame());
}

if(cv::waitKey(1) == 'q') {
break;
}
}

return 0;
}
Loading

0 comments on commit ef1481f

Please sign in to comment.