Skip to content

Commit 907b8c0

Browse files
committed
Merge branch 'release_2.17.4' into main
2 parents c816cb4 + a12bad4 commit 907b8c0

26 files changed

+1199
-79
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: DepthAI Core HIL Stability
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
tags:
10+
- 'v*'
11+
pull_request:
12+
branches:
13+
- main
14+
- develop
15+
16+
# Only allow latest run on same branch to be tested
17+
concurrency:
18+
group: ci-stability-${{ github.ref }}-1
19+
cancel-in-progress: true
20+
21+
jobs:
22+
23+
# Testing
24+
test:
25+
runs-on: ['self-hosted', 'hil-stability', 'linux']
26+
timeout-minutes: 1450 # 24h & 10minutes
27+
steps:
28+
- name: Cache .hunter folder
29+
uses: actions/cache@v2
30+
with:
31+
path: $HOME/.hun_vanilla
32+
key: hunter-linux-stability-vanilla
33+
- uses: actions/checkout@v2
34+
with:
35+
submodules: 'recursive'
36+
37+
# TODO also modify above hunter key to 'asan'
38+
# - name: Specify ASAN toolchain path
39+
# run: echo "CMAKE_TOOLCHAIN_PATH=$PWD/cmake/toolchain/asan.cmake" >> $GITHUB_ENV
40+
41+
# - name: Configure, Build and Test
42+
# run: |
43+
# cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D HUNTER_ROOT=$HOME/.hun_vanilla -D DEPTHAI_BUILD_TESTS=ON
44+
# cmake --build build --parallel 8 --config Release --target stability_stress_test
45+
# cd build
46+
# ../ci/stability_stress_test_combined.sh
47+
48+
# Release build
49+
- name: Configure, Build and Test
50+
run: |
51+
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D HUNTER_ROOT=$HOME/.hun_vanilla -D DEPTHAI_BUILD_TESTS=ON
52+
cmake --build build --parallel 8 --config Release --target stability_stress_test
53+
cd build
54+
../ci/stability_stress_test_combined.sh 86400

CMakeLists.txt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if(WIN32)
4040
endif()
4141

4242
# Create depthai project
43-
project(depthai VERSION "2.17.3" LANGUAGES CXX C)
43+
project(depthai VERSION "2.17.4" LANGUAGES CXX C)
4444
get_directory_property(has_parent PARENT_DIRECTORY)
4545
if(has_parent)
4646
set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
@@ -431,13 +431,14 @@ target_link_libraries(${TARGET_CORE_NAME}
431431
ZLIB::zlib
432432
)
433433

434-
# Add compile definitions
434+
# Add compile & CMake definitions
435+
set(DEPTHAI_DEVICE_VERSION "${DEPTHAI_DEVICE_SIDE_COMMIT}")
435436
target_compile_definitions(${TARGET_CORE_NAME}
436437
PRIVATE
437438
# XLink required define
438439
__PC__
439440
# Add depthai-device version
440-
DEPTHAI_DEVICE_VERSION="${DEPTHAI_DEVICE_SIDE_COMMIT}"
441+
DEPTHAI_DEVICE_VERSION="${DEPTHAI_DEVICE_VERSION}"
441442
# Add depthai-bootloader version
442443
DEPTHAI_BOOTLOADER_VERSION="${DEPTHAI_BOOTLOADER_VERSION}"
443444
)
@@ -454,7 +455,7 @@ if(DEPTHAI_USB2_PATCH_ONLY_MODE)
454455
endif()
455456

456457
# Helper function
457-
function(add_runtime_dependencies depending_target dependency)
458+
macro(add_runtime_dependencies depending_target dependency)
458459
if(WIN32)
459460
if(TARGET ${dependency})
460461
get_property(imported_configs TARGET ${dependency} PROPERTY IMPORTED_CONFIGURATIONS)
@@ -465,13 +466,16 @@ function(add_runtime_dependencies depending_target dependency)
465466
endforeach()
466467
endif()
467468
file(GLOB depthai_dll_libraries "${HUNTER_INSTALL_PREFIX}/bin/*.dll")
469+
# Create a list of required dll files
470+
set(required_dll_files ${dlls} ${depthai_dll_libraries})
468471
# Copy the required dlls
469472
add_custom_command(TARGET ${depending_target} POST_BUILD COMMAND
470-
${CMAKE_COMMAND} -E copy_if_different ${dlls} ${depthai_dll_libraries} $<TARGET_FILE_DIR:${depending_target}>
473+
${CMAKE_COMMAND} -E copy_if_different ${required_dll_files} $<TARGET_FILE_DIR:${depending_target}>
471474
COMMAND_EXPAND_LISTS
472475
)
476+
message(STATUS "Required dlls for core are: ${required_dll_files}")
473477
endif()
474-
endfunction()
478+
endmacro()
475479
# Add libusb dll in build time
476480
add_runtime_dependencies(${TARGET_CORE_NAME} usb-1.0)
477481

@@ -653,6 +657,10 @@ if(DEPTHAI_INSTALL)
653657
if(NOT DEPTHAI_BINARIES_RESOURCE_COMPILE)
654658
install(DIRECTORY "${DEPTHAI_RESOURCES_OUTPUT_DIR}/" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}")
655659
endif()
660+
# Install any required dll files
661+
if(DEFINED required_dll_files)
662+
install(FILES ${required_dll_files} DESTINATION "${CMAKE_INSTALL_BINDIR}")
663+
endif()
656664

657665
# Install export group (information about targets)
658666
install(EXPORT ${PROJECT_EXPORT_GROUP}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Cleanup in case the script dies
2+
cleanup() {
3+
# kill all processes whose parent is this process
4+
pkill -P $$
5+
}
6+
7+
for sig in INT QUIT HUP TERM; do
8+
trap "
9+
cleanup
10+
trap - $sig EXIT
11+
kill -s $sig "'"$$"' "$sig"
12+
done
13+
trap cleanup EXIT
14+
15+
# Print timeout if set, otherwise use default
16+
echo "Timeout set to: $1"
17+
18+
# Run USB & PoE stability stress test
19+
DEPTHAI_PROTOCOL=usb timeout $(($1+30)) ./tests/stability_stress_test $1 &
20+
jobUsb=$!
21+
DEPTHAI_PROTOCOL=tcpip timeout $(($1+30)) ./tests/stability_stress_test $1 &
22+
jobTcpip=$!
23+
24+
# Wait for tests and save result code
25+
wait $jobUsb ; resultUsb=$?
26+
wait $jobTcpip ; resultTcpip=$?
27+
28+
# Print results
29+
echo "Stability test USB: $resultUsb"
30+
echo "Stability test PoE: $resultTcpip"
31+
32+
# If both tests concluded successfully, exit with code 0
33+
if [[ "$resultUsb" == "0" ]] && [[ "$resultTcpip" == "0" ]]; then
34+
echo "Success!"
35+
exit 0
36+
fi
37+
echo "Failed!"
38+
exit 1

cmake/Depthai/DepthaiDeviceSideConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")
33

44
# "full commit hash of device side binary"
5-
set(DEPTHAI_DEVICE_SIDE_COMMIT "602822fe9eaca68a72c666497dc4979b29291b3e")
5+
set(DEPTHAI_DEVICE_SIDE_COMMIT "1a59c80266cd7a30ba874aa8d4a8277e0bf161ec")
66

77
# "version if applicable"
88
set(DEPTHAI_DEVICE_SIDE_VERSION "")

cmake/Hunter/config.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ hunter_config(
88
hunter_config(
99
XLink
1010
VERSION "luxonis-2021.4.2-develop"
11-
URL "https://github.com/luxonis/XLink/archive/b8a37de143d98cb0beb5393055fcdc9d621765bb.tar.gz"
12-
SHA1 "f8f91f0056bc46bba825bfff868136734f8585be"
11+
URL "https://github.com/luxonis/XLink/archive/4f8cd1f9b2ab1b44e36c448a4b7d5d80255f5872.tar.gz"
12+
SHA1 "fe7aaa8a61ddd7e9030c6c2720978e35a1449fba"
1313
)
1414

1515
hunter_config(

cmake/version.hpp.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@ namespace build
1616
constexpr static const char* COMMIT = "${BUILD_COMMIT}";
1717
constexpr static const char* COMMIT_DATETIME = "${BUILD_COMMIT_DATETIME}";
1818
constexpr static const char* BUILD_DATETIME = "${BUILD_DATETIME}";
19+
20+
constexpr static const char* DEVICE_VERSION = "${DEPTHAI_DEVICE_VERSION}";
21+
constexpr static const char* BOOTLOADER_VERSION = "${DEPTHAI_BOOTLOADER_VERSION}";
1922
} // namespace build
2023
} // namespace dai

examples/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ dai_add_example(feature_tracker FeatureTracker/feature_tracker.cpp ON)
233233
dai_add_example(device_queue_event host_side/device_queue_event.cpp ON)
234234
dai_add_example(opencv_support host_side/opencv_support.cpp ON)
235235
dai_add_example(queue_add_callback host_side/queue_add_callback.cpp ON)
236+
dai_add_example(device_information host_side/device_information.cpp ON)
236237

237238
# ImageManip
238239
dai_add_example(image_manip ImageManip/image_manip_example.cpp ON)
@@ -307,13 +308,15 @@ dai_add_example(script_nndata_example Script/script_nndata_example.cpp ON)
307308
dai_add_example(script_json_communication Script/script_json_communication.cpp ON)
308309
dai_add_example(script_change_pipeline_flow Script/script_change_pipeline_flow.cpp OFF)
309310
target_compile_definitions(script_change_pipeline_flow PRIVATE BLOB_PATH="${mobilenet_5shaves_blob}")
311+
dai_add_example(script_get_device_info Script/script_get_device_info.cpp ON)
310312

311313
# SpatialDetection
312314
dai_add_example(spatial_location_calculator SpatialDetection/spatial_location_calculator.cpp ON)
313315
dai_add_example(spatial_mobilenet_mono SpatialDetection/spatial_mobilenet_mono.cpp ON)
314316
dai_add_example(spatial_mobilenet SpatialDetection/spatial_mobilenet.cpp ON)
315317
dai_add_example(spatial_tiny_yolo_v3 SpatialDetection/spatial_tiny_yolo.cpp ON)
316318
dai_add_example(spatial_tiny_yolo_v4 SpatialDetection/spatial_tiny_yolo.cpp ON)
319+
dai_add_example(spatial_calculator_multi_roi SpatialDetection/spatial_calculator_multi_roi.cpp ON)
317320

318321
target_compile_definitions(spatial_mobilenet_mono PRIVATE BLOB_PATH="${mobilenet_blob}")
319322
target_compile_definitions(spatial_mobilenet PRIVATE BLOB_PATH="${mobilenet_blob}")
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include <iostream>
2+
3+
// Includes common necessary includes for development using depthai library
4+
#include "depthai/depthai.hpp"
5+
6+
int main() {
7+
using namespace std;
8+
9+
// Start defining a pipeline
10+
dai::Pipeline pipeline;
11+
12+
// Script node
13+
auto script = pipeline.create<dai::node::Script>();
14+
script->setScript(R"(
15+
import json
16+
data = json.dumps({
17+
'deviceId': __device_id__,
18+
'fwVersion': __version__
19+
}).encode('utf-8')
20+
21+
b = Buffer(len(data))
22+
b.setData(data)
23+
node.io['info'].send(b)
24+
)");
25+
26+
// XLinkOut
27+
auto xout = pipeline.create<dai::node::XLinkOut>();
28+
xout->setStreamName("info");
29+
script->outputs["info"].link(xout->input);
30+
31+
// Connect to device with pipeline
32+
dai::Device device(pipeline);
33+
auto msg = device.getOutputQueue("info")->get<dai::Buffer>();
34+
auto data = nlohmann::json::parse(msg->getData());
35+
std::cout << data.dump(4) << std::endl;
36+
37+
return 0;
38+
}

examples/Script/script_get_ip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int main() {
2727
2828
ip = get_ip_address('re0') # '192.168.0.110'
2929
node.warn(f'IP of the device: {ip}')
30-
node.io['end'].send(Buffer())
30+
node.io['end'].send(Buffer(32))
3131
)");
3232

3333
// XLinkOut

examples/Script/script_http_client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int main() {
2424
data1 = r1.read()
2525
node.warn(f'Public IP: {data1}')
2626
27-
node.io['end'].send(Buffer())
27+
node.io['end'].send(Buffer(32))
2828
)");
2929

3030
// XLinkOut

0 commit comments

Comments
 (0)