From 75246755d7e1b6a8464d7755ac575eabc4e5fdbf Mon Sep 17 00:00:00 2001 From: Matevz Morato Date: Fri, 14 Mar 2025 17:50:22 +0100 Subject: [PATCH 1/2] Add RVC4 discovery and a notice to use v3.x version for RVC4 devices --- depthai-core | 2 +- src/DeviceBindings.cpp | 11 +++++++++-- src/XLinkBindings.cpp | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/depthai-core b/depthai-core index 79cdb20cc..f5497b989 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 79cdb20ccea2f158b370c5c207a4e178c377c3b3 +Subproject commit f5497b9893ee2dbd0e8cb7afa9faa64c33f2d983 diff --git a/src/DeviceBindings.cpp b/src/DeviceBindings.cpp index 7f94027d1..ac4d10e4a 100644 --- a/src/DeviceBindings.cpp +++ b/src/DeviceBindings.cpp @@ -9,6 +9,7 @@ #include "depthai-shared/device/CrashDump.hpp" // std::chrono bindings +#include #include // py::detail #include @@ -41,8 +42,14 @@ static auto deviceSearchHelper(Args&&... args){ auto numConnected = DEVICE::getAllAvailableDevices().size(); if(numConnected > 0) { throw std::runtime_error("No available devices (" + std::to_string(numConnected) + " connected, but in use)"); - } else { - throw std::runtime_error("No available devices"); + } + auto numDevicesAnyPlatform = dai::XLinkConnection::getAllConnectedDevices(X_LINK_ANY_STATE, false, X_LINK_ANY_PLATFORM).size(); + auto numDevicesRVC2 = dai::XLinkConnection::getAllConnectedDevices( + X_LINK_ANY_STATE, false, X_LINK_MYRIAD_X) + .size(); + auto nonRVC2Devices = numDevicesAnyPlatform - numDevicesRVC2; + if(nonRVC2Devices > 0) { + throw std::runtime_error("No available RVC2 devices found, but found " + std::to_string(nonRVC2Devices) + " non RVC2 device[s]. To use RVC4 devices, please update DepthAI to version v3.x or newer."); } } diff --git a/src/XLinkBindings.cpp b/src/XLinkBindings.cpp index bb5475fd3..b76ac864f 100644 --- a/src/XLinkBindings.cpp +++ b/src/XLinkBindings.cpp @@ -133,7 +133,7 @@ void XLinkBindings::bind(pybind11::module &m, void *pCallstack) .def(py::init >()) .def(py::init()) .def(py::init()) - .def_static("getAllConnectedDevices", &XLinkConnection::getAllConnectedDevices, py::arg("state") = X_LINK_ANY_STATE, py::arg("skipInvalidDevices") = true) + .def_static("getAllConnectedDevices", &XLinkConnection::getAllConnectedDevices, py::arg("state") = X_LINK_ANY_STATE, py::arg("skipInvalidDevices") = true, py::arg("platform") = X_LINK_MYRIAD_X) .def_static("getFirstDevice", &XLinkConnection::getFirstDevice, py::arg("state") = X_LINK_ANY_STATE, py::arg("skipInvalidDevice") = true) .def_static("getDeviceByMxId", &XLinkConnection::getDeviceByMxId, py::arg("mxId"), py::arg("state") = X_LINK_ANY_STATE, py::arg("skipInvalidDevice") = true) .def_static("bootBootloader", &XLinkConnection::bootBootloader, py::arg("devInfo")) From 4545b69a1fd4d6b55bb1957a878ed012ccaaa53f Mon Sep 17 00:00:00 2001 From: Matevz Morato Date: Fri, 14 Mar 2025 20:04:34 +0100 Subject: [PATCH 2/2] Update core --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index f5497b989..2cfb31061 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit f5497b9893ee2dbd0e8cb7afa9faa64c33f2d983 +Subproject commit 2cfb31061d3c23db34167b1fe4b838c91b1d02e9