Skip to content

Commit 43e81d2

Browse files
author
Jakob Socan
committed
Fix some FW asan+ubsan issues
1 parent 1285505 commit 43e81d2

File tree

4 files changed

+49
-9
lines changed

4 files changed

+49
-9
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,10 @@ if(DEPTHAI_USB2_PATCH_ONLY_MODE)
889889
target_compile_definitions(${TARGET_CORE_NAME} PRIVATE DEPTHAI_PATCH_ONLY_MODE)
890890
endif()
891891

892+
if(DEPTHAI_INTERNAL_DEVICE_BUILD_RVC4)
893+
target_compile_definitions(${TARGET_CORE_NAME} PRIVATE DEPTHAI_INTERNAL_DEVICE_BUILD_RVC4)
894+
endif()
895+
892896
# Helper function
893897
macro(add_runtime_dependencies depending_target dependency)
894898
if(TARGET ${dependency})

cmake/depthaiOptions.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,6 @@ option(DEPTHAI_SANITIZE "Enable Address and Undefined sanitizers for library, ex
121121
# Local override paths
122122
set(DEPTHAI_XLINK_LOCAL "" CACHE STRING "Path to local XLink source to use instead of Hunter")
123123
set(DEPTHAI_BOOTLOADER_SHARED_LOCAL "" CACHE STRING "Path to local depthai-bootloader-shared source to use instead of submodule")
124+
125+
# Options for internal use
126+
option(DEPTHAI_INTERNAL_DEVICE_BUILD_RVC4 "This build is part of the rvc4 firmware build" OFF)

cmake/ports/libnop/portfile.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
vcpkg_from_github(
22
OUT_SOURCE_PATH SOURCE_PATH
3-
REPO luxonis/libnop
4-
REF ab842f51dc2eb13916dc98417c2186b78320ed10
5-
SHA512 6353765ac8c489e66e0c91dc1da899e5a89200eb3834c95a1697b5e22e4d7186d920c24a67272ff92fdf22a0fac5b6b838345ad077e67693f35815c1cc9dbf17
3+
REPO jakgra/libnop
4+
REF 00938ba06ad513e4e0a12f9f2ec41cecad7e40d1
5+
SHA512 1377cc955148b9106e173d5877623df4f18400234ad2a3c0e6ab12970c53886478520f7bc591f4e8d89ae1a325c4cd030063043795e34f99ec6efe77457c6664
66
HEAD_REF develop
77
)
88
vcpkg_cmake_configure(

include/depthai/pipeline/node/SpatialDetectionNetwork.hpp

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@ namespace node {
2424
class SpatialDetectionNetwork : public DeviceNodeCRTP<DeviceNode, SpatialDetectionNetwork, SpatialDetectionNetworkProperties> {
2525
public:
2626
explicit SpatialDetectionNetwork(const std::shared_ptr<Device>& device)
27-
: DeviceNodeCRTP<DeviceNode, SpatialDetectionNetwork, SpatialDetectionNetworkProperties>(device),
27+
: DeviceNodeCRTP<DeviceNode, SpatialDetectionNetwork, SpatialDetectionNetworkProperties>(device)
28+
#ifndef DEPTHAI_INTERNAL_DEVICE_BUILD_RVC4
29+
,
2830
input{neuralNetwork->input},
2931
outNetwork{neuralNetwork->out},
30-
passthrough{neuralNetwork->passthrough} {
32+
passthrough {
33+
neuralNetwork->passthrough
34+
}
35+
#endif
36+
{
3137
if(device) {
3238
auto platform = device->getPlatform();
3339
if(platform == Platform::RVC4) {
@@ -36,7 +42,16 @@ class SpatialDetectionNetwork : public DeviceNodeCRTP<DeviceNode, SpatialDetecti
3642
}
3743
};
3844
SpatialDetectionNetwork(std::unique_ptr<Properties> props)
39-
: DeviceNodeCRTP(std::move(props)), input{neuralNetwork->input}, outNetwork{neuralNetwork->out}, passthrough{neuralNetwork->passthrough} {
45+
: DeviceNodeCRTP(std::move(props))
46+
#ifndef DEPTHAI_INTERNAL_DEVICE_BUILD_RVC4
47+
,
48+
input{neuralNetwork->input},
49+
outNetwork{neuralNetwork->out},
50+
passthrough {
51+
neuralNetwork->passthrough
52+
}
53+
#endif
54+
{
4055
auto device = getDevice();
4156
if(device) {
4257
auto platform = device->getPlatform();
@@ -46,7 +61,16 @@ class SpatialDetectionNetwork : public DeviceNodeCRTP<DeviceNode, SpatialDetecti
4661
}
4762
};
4863
SpatialDetectionNetwork(std::unique_ptr<Properties> props, bool confMode)
49-
: DeviceNodeCRTP(std::move(props), confMode), input{neuralNetwork->input}, outNetwork{neuralNetwork->out}, passthrough{neuralNetwork->passthrough} {
64+
: DeviceNodeCRTP(std::move(props), confMode)
65+
#ifndef DEPTHAI_INTERNAL_DEVICE_BUILD_RVC4
66+
,
67+
input{neuralNetwork->input},
68+
outNetwork{neuralNetwork->out},
69+
passthrough {
70+
neuralNetwork->passthrough
71+
}
72+
#endif
73+
{
5074
auto device = getDevice();
5175
if(device) {
5276
auto platform = device->getPlatform();
@@ -56,10 +80,17 @@ class SpatialDetectionNetwork : public DeviceNodeCRTP<DeviceNode, SpatialDetecti
5680
}
5781
};
5882
SpatialDetectionNetwork(const std::shared_ptr<Device>& device, std::unique_ptr<Properties> props, bool confMode)
59-
: DeviceNodeCRTP(device, std::move(props), confMode),
83+
: DeviceNodeCRTP(device, std::move(props), confMode)
84+
#ifndef DEPTHAI_INTERNAL_DEVICE_BUILD_RVC4
85+
,
86+
6087
input{neuralNetwork->input},
6188
outNetwork{neuralNetwork->out},
62-
passthrough{neuralNetwork->passthrough} {
89+
passthrough {
90+
neuralNetwork->passthrough
91+
}
92+
#endif
93+
{
6394
if(device) {
6495
auto platform = device->getPlatform();
6596
if(platform == Platform::RVC4) {
@@ -83,6 +114,7 @@ class SpatialDetectionNetwork : public DeviceNodeCRTP<DeviceNode, SpatialDetecti
83114
Subnode<DetectionParser> detectionParser{*this, "detectionParser"};
84115
std::unique_ptr<Subnode<ImageAlign>> depthAlign;
85116

117+
#ifndef DEPTHAI_INTERNAL_DEVICE_BUILD_RVC4
86118
/**
87119
* Input message with data to be inferred upon
88120
* Default queue is blocking with size 5
@@ -100,6 +132,7 @@ class SpatialDetectionNetwork : public DeviceNodeCRTP<DeviceNode, SpatialDetecti
100132
* Suitable for when input queue is set to non-blocking behavior.
101133
*/
102134
Output& passthrough;
135+
#endif
103136

104137
/**
105138
* Input message with depth data used to retrieve spatial information about detected object

0 commit comments

Comments
 (0)