Skip to content

Commit 82d9152

Browse files
author
Petr Hodina
committed
depthai-core: track the latest v3_develop branch
1 parent 35a9b21 commit 82d9152

10 files changed

Lines changed: 482 additions & 88 deletions

pkgs/by-name/de/depthai-core/0002-cmake-Fix-build-dependencies.patch renamed to pkgs/by-name/de/depthai-core/0001-Refactor-the-Nixpkgs-dependencies.patch

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,61 @@
1-
From c644fd410d8b3211b488b43a768e6dc0c3d64119 Mon Sep 17 00:00:00 2001
2-
From: Petr Hodina <phodina@protonmail.com>
3-
Date: Mon, 21 Apr 2025 18:34:14 +0200
4-
Subject: [PATCH] cmake: Fix build dependencies
1+
From a2c99f32c799af5a4900063e0946b89a6c412334 Mon Sep 17 00:00:00 2001
2+
From: Petr Hodina <phodina@luxonis.com>
3+
Date: Tue, 20 May 2025 16:59:57 +0200
4+
Subject: [PATCH 1/4] Refactor the Nixpkgs dependencies
55

66

77
diff --git a/CMakeLists.txt b/CMakeLists.txt
8-
index 505a1ef20..aea2ed923 100644
8+
index 6af55ba64..f03209fa2 100644
99
--- a/CMakeLists.txt
1010
+++ b/CMakeLists.txt
11-
@@ -238,6 +238,7 @@ set(PROJECT_EXPORT_GROUP "${PROJECT_NAME}Targets")
11+
@@ -118,6 +118,7 @@ set(PROJECT_EXPORT_GROUP "${PROJECT_NAME}Targets")
1212

1313
## Check if cloned or sources
1414
find_package(Git)
1515
+find_package(foxglove-websocket)
1616
if(GIT_FOUND)
1717
execute_process(
1818
COMMAND ${GIT_EXECUTABLE} rev-parse --show-toplevel
19-
@@ -832,12 +833,10 @@ target_link_libraries(${TARGET_CORE_NAME}
20-
Threads::Threads
21-
BZip2::BZip2
19+
@@ -407,11 +408,11 @@ if(DEPTHAI_BUILD_ZOO_HELPER)
20+
src/utility/Logging.cpp
21+
)
22+
set(ZOO_HELPER_LINK_LIBRARIES
23+
- nlohmann_json::nlohmann_json
24+
+ nlohmann_json
25+
fmt::fmt
26+
yaml-cpp::yaml-cpp
27+
- CURL::libcurl
28+
- cpr::cpr
29+
+ curl
30+
+ cpr
31+
)
32+
target_compile_definitions(zoo_helper PRIVATE DEPTHAI_ENABLE_CURL)
33+
add_executable(zoo_helper ${ZOO_HELPER_SOURCES})
34+
@@ -681,10 +682,7 @@ endif()
35+
# link libraries
36+
target_link_libraries(${TARGET_CORE_NAME}
37+
PUBLIC
38+
- nlohmann_json::nlohmann_json
39+
- libnop
40+
- INTERFACE
41+
- XLinkPublic
42+
+ nlohmann_json
43+
PRIVATE
44+
fmt::fmt
45+
yaml-cpp::yaml-cpp
46+
@@ -695,10 +693,8 @@ target_link_libraries(${TARGET_CORE_NAME}
2247
LibArchive::LibArchive
23-
- liblzma::liblzma
2448
ZLIB::ZLIB
25-
- lz4::lz4
26-
+ lz4
2749
httplib::httplib
28-
- mp4v2::mp4v2
2950
- semver::semver
30-
+ mp4v2
3151
magic_enum::magic_enum
52+
- liblzma::liblzma
53+
- lz4::lz4
54+
+ lz4
3255
)
3356

34-
@@ -851,9 +850,9 @@ if(DEPTHAI_ENABLE_PROTOBUF)
57+
if(DEPTHAI_ENABLE_MP4V2)
58+
@@ -716,9 +712,9 @@ if(DEPTHAI_ENABLE_PROTOBUF)
3559
endif()
3660

3761
if(DEPTHAI_ENABLE_REMOTE_CONNECTION)
@@ -44,29 +68,20 @@ index 505a1ef20..aea2ed923 100644
4468
target_compile_definitions(${TARGET_CORE_NAME} PRIVATE DEPTHAI_ENABLE_REMOTE_CONNECTION)
4569
endif()
4670

47-
@@ -865,13 +864,13 @@ endif()
71+
@@ -758,7 +754,7 @@ endif()
4872

49-
if(DEPTHAI_ENABLE_CURL)
50-
target_link_libraries(${TARGET_CORE_NAME} PRIVATE
51-
- CURL::libcurl
52-
- cpr::cpr
53-
+ curl
54-
+ cpr
55-
)
56-
target_compile_definitions(${TARGET_CORE_NAME} PRIVATE DEPTHAI_ENABLE_CURL)
57-
target_link_libraries(zoo_helper PRIVATE
58-
- CURL::libcurl
59-
- cpr::cpr
60-
+ curl
61-
+ cpr
62-
)
63-
target_compile_definitions(zoo_helper PRIVATE DEPTHAI_ENABLE_CURL)
73+
if(DEPTHAI_XTENSOR_SUPPORT)
74+
target_compile_definitions(${TARGET_CORE_NAME} PUBLIC DEPTHAI_XTENSOR_SUPPORT)
75+
- target_link_libraries(${TARGET_CORE_NAME} PUBLIC xtensor)
76+
+ target_link_libraries(${TARGET_CORE_NAME} PUBLIC)
6477
endif()
78+
79+
# Specify available FW
6580
diff --git a/cmake/depthaiDependencies.cmake b/cmake/depthaiDependencies.cmake
66-
index de396c68c..812623291 100644
81+
index 3a44e70f2..7abbfa57c 100644
6782
--- a/cmake/depthaiDependencies.cmake
6883
+++ b/cmake/depthaiDependencies.cmake
69-
@@ -48,7 +48,6 @@ if(NOT CONFIG_MODE OR (CONFIG_MODE AND NOT DEPTHAI_SHARED_LIBS))
84+
@@ -47,7 +47,6 @@ if(NOT CONFIG_MODE OR (CONFIG_MODE AND NOT DEPTHAI_SHARED_LIBS))
7085
endif()
7186
# libarchive for firmware packages
7287
find_package(LibArchive ${_QUIET} REQUIRED)
@@ -75,5 +90,5 @@ index de396c68c..812623291 100644
7590
find_package(httplib ${_QUIET} CONFIG REQUIRED)
7691
# ZLIB for compressing Apps
7792
--
78-
2.48.1
93+
2.47.2
7994

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From af22d8f1177b5baaa01df32dcf7b68dd9fb43a66 Mon Sep 17 00:00:00 2001
2+
From: Petr Hodina <phodina@luxonis.com>
3+
Date: Tue, 20 May 2025 17:05:29 +0200
4+
Subject: [PATCH 2/4] cmake: Add option to enable/disable 3rdparty dependencies
5+
6+
- Introduced `DEPTHAI_3RDPARTY_ENABLE` CMake option to control inclusion of 3rdparty components.
7+
8+
diff --git a/CMakeLists.txt b/CMakeLists.txt
9+
index f03209fa2..42613b722 100644
10+
--- a/CMakeLists.txt
11+
+++ b/CMakeLists.txt
12+
@@ -162,9 +162,12 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
13+
14+
15+
# TODO Remove shared naming
16+
+if(DEPTHAI_3RDPARTY_ENABLE)
17+
set(DEPTHAI_SHARED_3RDPARTY_INCLUDE
18+
${CMAKE_CURRENT_LIST_DIR}/include/3rdparty/
19+
)
20+
+endif()
21+
+
22+
# Add depthai-bootloader-shared
23+
include(${CMAKE_CURRENT_LIST_DIR}/shared/depthai-bootloader-shared.cmake)
24+
25+
diff --git a/cmake/depthaiDependencies.cmake b/cmake/depthaiDependencies.cmake
26+
index 7abbfa57c..e9b82e262 100644
27+
--- a/cmake/depthaiDependencies.cmake
28+
+++ b/cmake/depthaiDependencies.cmake
29+
@@ -106,7 +106,9 @@ endif()
30+
31+
if(DEPTHAI_ENABLE_REMOTE_CONNECTION)
32+
get_filename_component(PARENT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/.. ABSOLUTE)
33+
+ if(DEPTHAI_3RDPARTY_ENABLE)
34+
add_subdirectory("${PARENT_DIRECTORY}/3rdparty/foxglove/ws-protocol/cpp/foxglove-websocket" foxglove-websocket)
35+
+ endif()
36+
endif()
37+
38+
# Add threads (c++)
39+
diff --git a/cmake/depthaiOptions.cmake b/cmake/depthaiOptions.cmake
40+
index 61999df16..072fb96b1 100644
41+
--- a/cmake/depthaiOptions.cmake
42+
+++ b/cmake/depthaiOptions.cmake
43+
@@ -14,6 +14,7 @@ endif()
44+
# ---------- Core Feature Toggles (private) -------------
45+
option(DEPTHAI_ENABLE_LIBUSB "Enable usage of libusb and interaction with USB devices" ON)
46+
option(DEPTHAI_FETCH_ARTIFACTS "Enable fetching artifacts from remote repository" ON)
47+
+option(DEPTHAI_3RDPARTY_ENABLE "Build 3rdparty dependencies" ON)
48+
option(DEPTHAI_ENABLE_APRIL_TAG "Enable AprilTag node (not available for Windows)" ON)
49+
option(DEPTHAI_ENABLE_PROTOBUF "Enable Protobuf support" ON)
50+
option(DEPTHAI_ENABLE_CURL "Enable CURL support" ${DEPTHAI_DEFAULT_CURL_SUPPORT})
51+
--
52+
2.47.2
53+
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
From c77f3fca85479b6ffb1b9fba9ef9d805adfcadbf Mon Sep 17 00:00:00 2001
2+
From: Petr Hodina <phodina@luxonis.com>
3+
Date: Tue, 20 May 2025 19:09:54 +0200
4+
Subject: [PATCH 3/4] Allow offline build
5+
6+
7+
diff --git a/cmake/DepthaiDeviceKbDownloader.cmake b/cmake/DepthaiDeviceKbDownloader.cmake
8+
index 2cd26d535..a22d02d78 100644
9+
--- a/cmake/DepthaiDeviceKbDownloader.cmake
10+
+++ b/cmake/DepthaiDeviceKbDownloader.cmake
11+
@@ -126,19 +126,19 @@ function(DepthaiDeviceDownloader)
12+
endif()
13+
14+
# Download firmware package
15+
- message(STATUS "Downloading and checking ${device_type}-fwp.tar.xz")
16+
- message(STATUS "Download URL: ${_download_directory_url}/${device_type}-fwp-${_version_commit_identifier}.tar.xz")
17+
- DownloadAndChecksum(
18+
- "${_download_directory_url}/${device_type}-fwp-${_version_commit_identifier}.tar.xz" # File
19+
- "${_download_directory_url}/${device_type}-fwp-${_version_commit_identifier}.tar.xz.sha256" # File checksum
20+
- "${folder}/${device_type}-fwp-${_version_commit_identifier}.tar.xz"
21+
- status
22+
- )
23+
- if(${status})
24+
- message(STATUS "\nCouldn't download ${device_type}-fwp.tar.xz\n")
25+
- PrintErrorMessage(${status})
26+
- message(FATAL_ERROR "Aborting.\n")
27+
- endif()
28+
+ # message(STATUS "Downloading and checking ${device_type}-fwp.tar.xz")
29+
+ # message(STATUS "Download URL: ${_download_directory_url}/${device_type}-fwp-${_version_commit_identifier}.tar.xz")
30+
+ # DownloadAndChecksum(
31+
+ # "${_download_directory_url}/${device_type}-fwp-${_version_commit_identifier}.tar.xz" # File
32+
+ # "${_download_directory_url}/${device_type}-fwp-${_version_commit_identifier}.tar.xz.sha256" # File checksum
33+
+ # "${folder}/${device_type}-fwp-${_version_commit_identifier}.tar.xz"
34+
+ # status
35+
+ # )
36+
+ # if(${status})
37+
+ # message(STATUS "\nCouldn't download ${device_type}-fwp.tar.xz\n")
38+
+ # PrintErrorMessage(${status})
39+
+ # message(FATAL_ERROR "Aborting.\n")
40+
+ # endif()
41+
# add depthai-device-kb-fwp.tar.xz to list
42+
list(APPEND "${output_list_var}" "${folder}/${device_type}-fwp-${_version_commit_identifier}.tar.xz")
43+
44+
diff --git a/cmake/DepthaiDownloader.cmake b/cmake/DepthaiDownloader.cmake
45+
index 66d555e5c..77563d279 100644
46+
--- a/cmake/DepthaiDownloader.cmake
47+
+++ b/cmake/DepthaiDownloader.cmake
48+
@@ -142,18 +142,18 @@ function(DepthaiDownload)
49+
50+
51+
# Download depthai-device firmware package
52+
- message(STATUS "Downloading and checking depthai-device-fwp.tar.xz")
53+
- DownloadAndChecksum(
54+
- "${_download_directory_url}/depthai-device-fwp-${_version_commit_identifier}.tar.xz" # File
55+
- "${_download_directory_url}/depthai-device-fwp-${_version_commit_identifier}.tar.xz.sha256" # File checksum
56+
- "${folder}/depthai-device-fwp-${_version_commit_identifier}.tar.xz"
57+
- status
58+
- )
59+
- if(${status})
60+
- message(STATUS "\nCouldn't download depthai-device-fwp.tar.xz\n")
61+
- PrintErrorMessage(${status})
62+
- message(FATAL_ERROR "Aborting.\n")
63+
- endif()
64+
+ # message(STATUS "Downloading and checking depthai-device-fwp.tar.xz")
65+
+ # DownloadAndChecksum(
66+
+ # "${_download_directory_url}/depthai-device-fwp-${_version_commit_identifier}.tar.xz" # File
67+
+ # "${_download_directory_url}/depthai-device-fwp-${_version_commit_identifier}.tar.xz.sha256" # File checksum
68+
+ # "${folder}/depthai-device-fwp-${_version_commit_identifier}.tar.xz"
69+
+ # status
70+
+ # )
71+
+ # if(${status})
72+
+ # message(STATUS "\nCouldn't download depthai-device-fwp.tar.xz\n")
73+
+ # PrintErrorMessage(${status})
74+
+ # message(FATAL_ERROR "Aborting.\n")
75+
+ # endif()
76+
# add depthai-device-fwp.tar.xz to list
77+
list(APPEND "${output_list_var}" "${folder}/depthai-device-fwp-${_version_commit_identifier}.tar.xz")
78+
79+
@@ -252,4 +252,4 @@ function(DepthaiLocal patch_only patch_only_on_off output_dir output_list_var pa
80+
81+
set("${output_list_var}" "${_resource_list}" PARENT_SCOPE)
82+
83+
-endfunction()
84+
\ No newline at end of file
85+
+endfunction()
86+
diff --git a/cmake/DepthaiVisualizerDownloader.cmake b/cmake/DepthaiVisualizerDownloader.cmake
87+
index b8300968a..e747bb729 100644
88+
--- a/cmake/DepthaiVisualizerDownloader.cmake
89+
+++ b/cmake/DepthaiVisualizerDownloader.cmake
90+
@@ -37,18 +37,18 @@ function(DepthaiVisualizerDownloader)
91+
92+
93+
# Download firmware package
94+
- message(STATUS "Downloading and checking ${device_type}-fwp.tar.xz")
95+
- DownloadAndChecksum(
96+
- "${_download_directory_url}/${visualizer_hash}/depthai-visualizer-${visualizer_hash}.tar.xz" # File
97+
- "${_download_directory_url}/${visualizer_hash}/depthai-visualizer-${visualizer_hash}.tar.xz.sha256" # File checksum
98+
- "${folder}/depthai-visualizer-${visualizer_hash}.tar.xz"
99+
- status
100+
- )
101+
- if(${status})
102+
- message(STATUS "\nCouldn't download depthai-visualizer static files\n")
103+
- PrintErrorMessage(${status})
104+
- message(FATAL_ERROR "Aborting.\n")
105+
- endif()
106+
+ #message(STATUS "Downloading and checking ${device_type}-fwp.tar.xz")
107+
+ #DownloadAndChecksum(
108+
+ # "${_download_directory_url}/${visualizer_hash}/depthai-visualizer-${visualizer_hash}.tar.xz" # File
109+
+ # "${_download_directory_url}/${visualizer_hash}/depthai-visualizer-${visualizer_hash}.tar.xz.sha256" # File checksum
110+
+ # "${folder}/depthai-visualizer-${visualizer_hash}.tar.xz"
111+
+ # status
112+
+ #)
113+
+ #if(${status})
114+
+ # message(STATUS "\nCouldn't download depthai-visualizer static files\n")
115+
+ # PrintErrorMessage(${status})
116+
+ # message(FATAL_ERROR "Aborting.\n")
117+
+ #endif()
118+
# add depthai-device-kb-fwp.tar.xz to list
119+
list(APPEND "${output_list_var}" "${folder}/depthai-visualizer-${visualizer_hash}.tar.xz")
120+
121+
diff --git a/cmake/depthaiDependencies.cmake b/cmake/depthaiDependencies.cmake
122+
index e9b82e262..b224fdd29 100644
123+
--- a/cmake/depthaiDependencies.cmake
124+
+++ b/cmake/depthaiDependencies.cmake
125+
@@ -174,19 +174,20 @@ endif()
126+
if(DEPTHAI_XLINK_LOCAL AND (NOT CONFIG_MODE))
127+
add_subdirectory("${DEPTHAI_XLINK_LOCAL}" ${CMAKE_CURRENT_BINARY_DIR}/XLink)
128+
else()
129+
- FetchContent_Declare(
130+
- XLink
131+
- GIT_REPOSITORY https://github.com/luxonis/XLink.git
132+
- GIT_TAG 87785828fabdb1718760bb0a044405d5bbfbb3a2
133+
- )
134+
135+
- FetchContent_MakeAvailable(
136+
- XLink
137+
- )
138+
+# FetchContent_Declare(
139+
+# XLink
140+
+# GIT_REPOSITORY https://github.com/luxonis/XLink.git
141+
+# GIT_TAG 87785828fabdb1718760bb0a044405d5bbfbb3a2
142+
+# )
143+
+#
144+
+# FetchContent_MakeAvailable(
145+
+# XLink
146+
+# )
147+
endif()
148+
set(BUILD_SHARED_LIBS "${_BUILD_SHARED_LIBS_SAVED}")
149+
unset(_BUILD_SHARED_LIBS_SAVED)
150+
-list(APPEND targets_to_export XLinkPublic)
151+
+#list(APPEND targets_to_export XLinkPublic)
152+
153+
# OpenCV 4 - (optional)
154+
message("DEPTHAI_OPENCV_SUPPORT: ${DEPTHAI_OPENCV_SUPPORT}")
155+
--
156+
2.47.2
157+

pkgs/by-name/de/depthai-core/0003-cmake-Skip-some-dependencies.patch

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 84f39be26d955fc7b15efdbe5237fc073f8dd5d9 Mon Sep 17 00:00:00 2001
2+
From: Petr Hodina <phodina@luxonis.com>
3+
Date: Wed, 21 May 2025 08:40:06 +0200
4+
Subject: [PATCH 4/4] use external nanorpc
5+
6+
7+
diff --git a/src/device/DeviceBase.cpp b/src/device/DeviceBase.cpp
8+
index db40d77b1..6fd52b375 100644
9+
--- a/src/device/DeviceBase.cpp
10+
+++ b/src/device/DeviceBase.cpp
11+
@@ -40,8 +40,8 @@
12+
// libraries
13+
#include "XLink/XLink.h"
14+
#include "XLink/XLinkTime.h"
15+
-#include "nanorpc/core/client.h"
16+
-#include "nanorpc/packer/nlohmann_msgpack.h"
17+
+#include <nanorpc/core/client.h>
18+
+#include <nanorpc/packer/nlohmann_msgpack.h>
19+
#include "spdlog/details/os.h"
20+
#include "spdlog/fmt/bin_to_hex.h"
21+
#include "spdlog/fmt/chrono.h"
22+
--
23+
2.47.2
24+

0 commit comments

Comments
 (0)