diff --git a/.github/workflows/test.workflow.yml b/.github/workflows/test.workflow.yml index 550123a232..3465fa3c82 100644 --- a/.github/workflows/test.workflow.yml +++ b/.github/workflows/test.workflow.yml @@ -54,8 +54,8 @@ jobs: uses: ./.github/workflows/test_child.yml with: flavor: "vanilla" - luxonis_os_versions_to_test: "['1.14.1', '1.15.0', '1.18.3']" - luxonis_os_versions_to_test_rgb: "['1.18.3']" + luxonis_os_versions_to_test: "['1.14.1', '1.15.0', '1.18.3', 'usb-testing-build']" + luxonis_os_versions_to_test_rgb: "['1.18.3', 'usb-testing-build']" secrets: CONTAINER_REGISTRY: ${{ secrets.CONTAINER_REGISTRY }} HIL_PAT_TOKEN: ${{ secrets.HIL_PAT_TOKEN }} diff --git a/cmake/Depthai/DepthaiDeviceRVC4Config.cmake b/cmake/Depthai/DepthaiDeviceRVC4Config.cmake index 1e26e9d084..893a6463d2 100644 --- a/cmake/Depthai/DepthaiDeviceRVC4Config.cmake +++ b/cmake/Depthai/DepthaiDeviceRVC4Config.cmake @@ -3,4 +3,5 @@ set(DEPTHAI_DEVICE_RVC4_MATURITY "snapshot") # "version if applicable" -set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+cd0fc231d8c860acf11ab424109d7e42500626ae") +# set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+93f7b75a885aa32f44c5e9f53b74470c49d2b1af") +set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+aa774579d184a6d4ad93cc7af357e0a5d772036f") \ No newline at end of file diff --git a/cmake/depthaiDependencies.cmake b/cmake/depthaiDependencies.cmake index f50ff81912..08752ec36c 100644 --- a/cmake/depthaiDependencies.cmake +++ b/cmake/depthaiDependencies.cmake @@ -177,7 +177,7 @@ else() FetchContent_Declare( XLink GIT_REPOSITORY https://github.com/luxonis/XLink.git - GIT_TAG 7958fece3f7b303b1a2038ea7e78f53405f89843 + GIT_TAG e56ec8ad10381ef58cde3be430ebf77a470623d2 ) FetchContent_MakeAvailable( diff --git a/examples/cpp/Camera/camera_max_resolution.cpp b/examples/cpp/Camera/camera_max_resolution.cpp index 5be761ebbf..86eb996f82 100644 --- a/examples/cpp/Camera/camera_max_resolution.cpp +++ b/examples/cpp/Camera/camera_max_resolution.cpp @@ -31,4 +31,4 @@ int main() { } return 0; -} \ No newline at end of file +} diff --git a/examples/cpp/Camera/camera_output.cpp b/examples/cpp/Camera/camera_output.cpp index cdaeac32d9..e12e8adb77 100644 --- a/examples/cpp/Camera/camera_output.cpp +++ b/examples/cpp/Camera/camera_output.cpp @@ -30,4 +30,4 @@ int main() { } return 0; -} \ No newline at end of file +} diff --git a/include/depthai/device/DeviceGate.hpp b/include/depthai/device/DeviceGate.hpp index 7e75c97b04..019892ecc7 100644 --- a/include/depthai/device/DeviceGate.hpp +++ b/include/depthai/device/DeviceGate.hpp @@ -14,6 +14,7 @@ #include "depthai/device/Version.hpp" #include "depthai/utility/Pimpl.hpp" #include "depthai/xlink/XLinkConnection.hpp" +#include "depthai/xlink/XLinkStream.hpp" namespace dai { /** @@ -55,6 +56,64 @@ class DeviceGate { private: // private + class GateImpl { + public: + virtual ~GateImpl() = default; + virtual bool isOkay() = 0; + virtual bool createSession(std::string version, bool exclusive, XLinkPlatform_t platform, std::string& sessionId, std::atomic_bool& sessionCreated) = 0; + virtual bool startSession(std::string sessionId) = 0; + virtual bool stopSession(std::string sessionId) = 0; + virtual bool deleteSession(std::string sessionId) = 0; + virtual bool destroySession(std::string sessionId) = 0; + virtual SessionState getState(std::string sessionId) = 0; + virtual Version getVersion() = 0; + virtual VersionInfo getAllVersion() = 0; + virtual std::optional> getFile(const std::string& fileUrl, std::string& filename) = 0; + }; + + class USBImpl : public GateImpl { + public: + USBImpl(DeviceInfo deviceInfo, int timeout); + ~USBImpl() = default; + bool isOkay() override; + bool createSession(std::string version, bool exclusive, XLinkPlatform_t platform, std::string& sessionId, std::atomic_bool& sessionCreated) override; + bool startSession(std::string sessionId) override; + bool stopSession(std::string sessionId) override; + bool deleteSession(std::string sessionId) override; + bool destroySession(std::string sessionId) override; + SessionState getState(std::string sessionId) override; + Version getVersion() override; + VersionInfo getAllVersion() override; + std::optional> getFile(const std::string& fileUrl, std::string& filename) override; + + private: + DeviceInfo deviceInfo; + int timeout; + }; + + class HTTPImpl : public GateImpl { + public: + HTTPImpl(DeviceInfo deviceInfo); + ~HTTPImpl() = default; + bool isOkay() override; + bool createSession(std::string version, bool exclusive, XLinkPlatform_t platform, std::string& sessionId, std::atomic_bool& sessionCreated) override; + bool startSession(std::string sessionId) override; + bool stopSession(std::string sessionId) override; + bool deleteSession(std::string sessionId) override; + bool destroySession(std::string sessionId) override; + SessionState getState(std::string sessionId) override; + Version getVersion() override; + VersionInfo getAllVersion() override; + std::optional> getFile(const std::string& fileUrl, std::string& filename) override; + + private: + // pimpl + class Impl; + Pimpl pimpl; + }; + + std::shared_ptr impl; + DeviceInfo deviceInfo; std::thread stateMonitoringThread; @@ -65,10 +124,9 @@ class DeviceGate { std::atomic_bool sessionCreated{false}; XLinkPlatform_t platform; + std::shared_ptr gateConnection; + std::shared_ptr gateStream; std::string version; - // pimpl - class Impl; - Pimpl pimpl; std::string sessionId; }; diff --git a/include/depthai/pipeline/MessageQueue.hpp b/include/depthai/pipeline/MessageQueue.hpp index e7667e6238..4538668dec 100644 --- a/include/depthai/pipeline/MessageQueue.hpp +++ b/include/depthai/pipeline/MessageQueue.hpp @@ -44,13 +44,13 @@ class MessageQueue : public std::enable_shared_from_this { explicit MessageQueue(std::string name, unsigned int maxSize = 16, bool blocking = true); MessageQueue(const MessageQueue& c) - : enable_shared_from_this(c), queue(c.queue), name(c.name), callbacks(c.callbacks), uniqueCallbackId(c.uniqueCallbackId){}; + : enable_shared_from_this(c), queue(c.queue), name(c.name), callbacks(c.callbacks), uniqueCallbackId(c.uniqueCallbackId) {}; MessageQueue(MessageQueue&& m) noexcept : enable_shared_from_this(m), queue(std::move(m.queue)), name(std::move(m.name)), callbacks(std::move(m.callbacks)), - uniqueCallbackId(m.uniqueCallbackId){}; + uniqueCallbackId(m.uniqueCallbackId) {}; MessageQueue& operator=(const MessageQueue& c) { queue = c.queue; diff --git a/include/depthai/pipeline/Node.hpp b/include/depthai/pipeline/Node.hpp index cd6ef073ef..6e5993fa79 100644 --- a/include/depthai/pipeline/Node.hpp +++ b/include/depthai/pipeline/Node.hpp @@ -65,7 +65,9 @@ class Node : public std::enable_shared_from_this { static constexpr auto DEFAULT_NAME = ""; #define DEFAULT_TYPES \ { \ - { DatatypeEnum::Buffer, true } \ + { \ + DatatypeEnum::Buffer, true \ + } \ } static constexpr auto DEFAULT_BLOCKING = true; static constexpr auto DEFAULT_QUEUE_SIZE = 3; diff --git a/include/depthai/utility/ImageManipImpl.hpp b/include/depthai/utility/ImageManipImpl.hpp index 505e0e09c1..184f361a6b 100644 --- a/include/depthai/utility/ImageManipImpl.hpp +++ b/include/depthai/utility/ImageManipImpl.hpp @@ -457,8 +457,7 @@ class ColorChange { template