Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2cd0570
Changed XLink commit.
Jul 1, 2025
e470ea6
Added new protocol handling in log collection
Jul 1, 2025
7a82389
Updated XLink to support USB EP discovery
Jul 10, 2025
74f5a3a
Updated XLink
Jul 10, 2025
ef65dd0
Updated xlink
Jul 10, 2025
c71236a
Reset example
Jul 11, 2025
461e015
Updated XLink
Jul 11, 2025
b539e7b
Updated xlink and added test for Gate Write
Jul 16, 2025
8a03d04
Added debug message
Jul 16, 2025
6784c4f
Testing request via USB.
Jul 17, 2025
1f362b0
Finalised GATE via USB.
Jul 18, 2025
fa9efd6
Null terminated all respBuffers
Jul 18, 2025
ff1ca69
Added error handler for create session
Jul 18, 2025
0bd8b42
Updated XLink
Aug 5, 2025
29abe4d
Updated to use wrappers of Gate functions.
Aug 5, 2025
27526a6
Removed the packed tag for device gate.
Aug 5, 2025
5acfb3f
Added Impl inside DepthaiGate to split USB and HTTP request + ran cla…
Sep 2, 2025
e0801fb
Removed depthai-shared
Sep 2, 2025
7159156
Added USB tests for RVC4
Sep 3, 2025
52a92ba
Fixed GateImpl destructors and removed unnecessary functions
Sep 3, 2025
a08d62b
Updated XLink with new Gate Discovery features.
Sep 4, 2025
8495aa5
Merge remote-tracking branch 'origin/develop' into oak4-usb-support
Sep 10, 2025
f2750d6
Updated XLink+
Sep 11, 2025
e69b2c9
DeviceGate: bugfixing for USB.
Sep 18, 2025
c80eb9d
XLink: Updated XLink for USB EPs
Sep 24, 2025
825dbf3
Merge branch 'develop' into oak4-usb-support
Sep 24, 2025
e0de70b
DeviceGate: Added serious error handling and ran clangformat.
Sep 25, 2025
94187c3
XLink: updated XLink with new fixes for USB EP.
Sep 25, 2025
748ed44
XLink: updated to merge between usb and usb_ep
Oct 1, 2025
596c5d7
XLink: updated with newer usb_ep
Oct 6, 2025
3ccb575
XLink: updated with server-side on usb_host
Oct 6, 2025
36e4581
DeviceGate: Updated with new gate updates.
Oct 7, 2025
d9ab27b
USB: Testing OS added.
Oct 8, 2025
dd41350
Update tests/run_tests.py
TheMutta Oct 8, 2025
9eb8f18
Update tests/run_tests.py
TheMutta Oct 8, 2025
5402984
Updated XLink and added usb-testing OS build in the CI.
Oct 8, 2025
4f37bf7
Merge branch 'develop' into oak4-usb-support
TheMutta Oct 8, 2025
3e95126
Updated XLink.
Oct 8, 2025
18a04b1
Merge branch 'oak4-usb-support' of github.com:luxonis/depthai-core in…
Oct 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/depthaiDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ else()
FetchContent_Declare(
XLink
GIT_REPOSITORY https://github.com/luxonis/XLink.git
GIT_TAG 13790284ce12969c169940f88aad755bd91146db
GIT_TAG cc65c5ee9da6a5a9904a3c58cbeccede26fccfca
)

FetchContent_MakeAvailable(
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/Camera/camera_max_resolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ int main() {
}

return 0;
}
}
2 changes: 1 addition & 1 deletion examples/cpp/Camera/camera_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ int main() {
}

return 0;
}
}
59 changes: 56 additions & 3 deletions include/depthai/device/DeviceGate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand Down Expand Up @@ -55,6 +56,59 @@ 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<std::vector<uint8_t>> getFile(const std::string& fileUrl, std::string& filename) = 0;
};

class USBImpl : public GateImpl {
public:
~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<std::vector<uint8_t>> getFile(const std::string& fileUrl, std::string& filename) override;
};

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<std::vector<uint8_t>> getFile(const std::string& fileUrl, std::string& filename) override;

private:
// pimpl
class Impl;
Pimpl<Impl> pimpl;
};

std::shared_ptr<GateImpl> impl;

DeviceInfo deviceInfo;

std::thread stateMonitoringThread;
Expand All @@ -65,10 +119,9 @@ class DeviceGate {
std::atomic_bool sessionCreated{false};

XLinkPlatform_t platform;
std::shared_ptr<XLinkConnection> gateConnection;
std::shared_ptr<XLinkStream> gateStream;
std::string version;
// pimpl
class Impl;
Pimpl<Impl> pimpl;

std::string sessionId;
};
Expand Down
4 changes: 2 additions & 2 deletions include/depthai/pipeline/MessageQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ class MessageQueue : public std::enable_shared_from_this<MessageQueue> {
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;
Expand Down
4 changes: 3 additions & 1 deletion include/depthai/pipeline/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ class Node : public std::enable_shared_from_this<Node> {
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;
Expand Down
36 changes: 12 additions & 24 deletions include/depthai/utility/ImageManipImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,7 @@ class ColorChange {

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
class ImageManipOperations {
static_assert(std::is_base_of<Warp<ImageManipBuffer, ImageManipData>, WarpBackend<ImageManipBuffer, ImageManipData>>::value,
"WarpBackend must be derived from Warp");
Expand Down Expand Up @@ -2697,8 +2696,7 @@ inline dai::ImgFrame::Type getValidType(dai::ImgFrame::Type type) {

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>& ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::build(
const ImageManipOpsBase<Container>& newBase, ImgFrame::Type outType, FrameSpecs srcFrameSpecs, ImgFrame::Type inFrameType) {
const auto newCfgStr = newBase.str();
Expand Down Expand Up @@ -2826,8 +2824,7 @@ size_t getFrameSize(const ImgFrame::Type type, const FrameSpecs& specs);

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
bool ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::apply(const std::shared_ptr<ImageManipData> src,
std::shared_ptr<ImageManipData> dst) {
size_t requiredSize = getFrameSize(inType, srcSpecs);
Expand Down Expand Up @@ -2879,24 +2876,21 @@ bool ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::apply(

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
size_t ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getOutputWidth() const {
return base.outputWidth;
}

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
size_t ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getOutputHeight() const {
return base.outputHeight;
}

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
size_t ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getOutputStride(uint8_t plane) const {
if(mode == 0) return plane == 0 ? srcSpecs.p1Stride : (plane == 1 ? srcSpecs.p2Stride : (plane == 2 ? srcSpecs.p3Stride : 0));
auto specs = getOutputFrameSpecs(outputFrameType);
Expand All @@ -2912,8 +2906,7 @@ size_t ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getO

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
size_t ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getOutputPlaneSize(uint8_t plane) const {
if(mode == 0) return 0;
size_t size = 0;
Expand Down Expand Up @@ -2978,8 +2971,7 @@ size_t ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getO

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
size_t ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getOutputSize() const {
if(mode == 0) return 0;
size_t size = 0;
Expand Down Expand Up @@ -3034,8 +3026,7 @@ size_t ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getO

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
FrameSpecs ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getOutputFrameSpecs(ImgFrame::Type type) const {
if(mode == 0)
return srcSpecs;
Expand All @@ -3045,8 +3036,7 @@ FrameSpecs ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
std::vector<RotatedRect> ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getSrcCrops() const {
std::vector<RotatedRect> crops;
for(const auto& corners : srcCorners) {
Expand All @@ -3058,16 +3048,14 @@ std::vector<RotatedRect> ImageManipOperations<ImageManipBuffer, ImageManipData,

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
std::array<std::array<float, 3>, 3> ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::getMatrix() const {
return matrix;
}

template <template <typename T> typename ImageManipBuffer,
typename ImageManipData,
template <template <typename T> typename Buf, typename Dat>
typename WarpBackend>
template <template <typename T> typename Buf, typename Dat> typename WarpBackend>
std::string ImageManipOperations<ImageManipBuffer, ImageManipData, WarpBackend>::toString() const {
std::stringstream cStr;
cStr << getConfigString(base);
Expand Down
4 changes: 2 additions & 2 deletions include/depthai/utility/LockingQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class LockingQueue {
this->maxSize = maxSize;
this->blocking = blocking;
}
LockingQueue(const LockingQueue& obj) : maxSize(obj.maxSize), blocking(obj.blocking), queue(obj.queue), destructed(obj.destructed){};
LockingQueue(LockingQueue&& obj) noexcept : maxSize(obj.maxSize), blocking(obj.blocking), queue(std::move(obj.queue)), destructed(obj.destructed){};
LockingQueue(const LockingQueue& obj) : maxSize(obj.maxSize), blocking(obj.blocking), queue(obj.queue), destructed(obj.destructed) {};
LockingQueue(LockingQueue&& obj) noexcept : maxSize(obj.maxSize), blocking(obj.blocking), queue(std::move(obj.queue)), destructed(obj.destructed) {};
LockingQueue& operator=(const LockingQueue& obj) {
maxSize = obj.maxSize;
blocking = obj.blocking;
Expand Down
2 changes: 1 addition & 1 deletion include/depthai/utility/Memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ holder(std::move(holder)) {}
// memory as interface
class Memory {
public:
virtual ~Memory(){};
virtual ~Memory() {};
virtual span<std::uint8_t> getData() = 0;
virtual span<const std::uint8_t> getData() const = 0;
virtual std::size_t getMaxSize() const = 0;
Expand Down
2 changes: 1 addition & 1 deletion include/depthai/utility/MemoryWrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// memfd_create wrapper for glibc < 2.27
#if defined(__unix__) && !defined(__APPLE__)
#if(__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 27)
#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 27)

int memfd_create(const char* name, unsigned int flags);

Expand Down
4 changes: 2 additions & 2 deletions include/depthai/utility/NlohmannJsonCompat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include <nlohmann/json.hpp>

// Check version of nlohmann json
#if(defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR))
#if((NLOHMANN_JSON_VERSION_MAJOR < 3) || ((NLOHMANN_JSON_VERSION_MAJOR == 3) && (NLOHMANN_JSON_VERSION_MINOR < 6)))
#if (defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR))
#if ((NLOHMANN_JSON_VERSION_MAJOR < 3) || ((NLOHMANN_JSON_VERSION_MAJOR == 3) && (NLOHMANN_JSON_VERSION_MINOR < 6)))
static_assert(0, "DepthAI requires nlohmann library version 3.6.0 or higher");
#else
// Set up compat macros for nlohmann json (independent of version)
Expand Down
Loading