From 2ae8ce3350bf19b4d36074d9e0d1f6672f23c8ec Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Mon, 14 Jun 2021 11:19:55 +0900 Subject: [PATCH 01/15] Mark member functions `dai::Node::get{In,Out}put` as const --- include/depthai/pipeline/Node.hpp | 4 ++-- include/depthai/pipeline/node/ColorCamera.hpp | 4 ++-- include/depthai/pipeline/node/DetectionNetwork.hpp | 4 ++-- include/depthai/pipeline/node/IMU.hpp | 4 ++-- include/depthai/pipeline/node/ImageManip.hpp | 4 ++-- include/depthai/pipeline/node/MonoCamera.hpp | 4 ++-- include/depthai/pipeline/node/MyProducer.hpp | 4 ++-- include/depthai/pipeline/node/NeuralNetwork.hpp | 4 ++-- include/depthai/pipeline/node/ObjectTracker.hpp | 4 ++-- include/depthai/pipeline/node/SPIOut.hpp | 4 ++-- include/depthai/pipeline/node/SpatialDetectionNetwork.hpp | 4 ++-- include/depthai/pipeline/node/SpatialLocationCalculator.hpp | 4 ++-- include/depthai/pipeline/node/StereoDepth.hpp | 4 ++-- include/depthai/pipeline/node/SystemLogger.hpp | 4 ++-- include/depthai/pipeline/node/VideoEncoder.hpp | 4 ++-- include/depthai/pipeline/node/XLinkIn.hpp | 4 ++-- include/depthai/pipeline/node/XLinkOut.hpp | 4 ++-- src/pipeline/node/ColorCamera.cpp | 4 ++-- src/pipeline/node/DetectionNetwork.cpp | 4 ++-- src/pipeline/node/IMU.cpp | 4 ++-- src/pipeline/node/ImageManip.cpp | 4 ++-- src/pipeline/node/MonoCamera.cpp | 4 ++-- src/pipeline/node/MyProducer.cpp | 4 ++-- src/pipeline/node/NeuralNetwork.cpp | 4 ++-- src/pipeline/node/ObjectTracker.cpp | 4 ++-- src/pipeline/node/SpatialDetectionNetwork.cpp | 4 ++-- src/pipeline/node/SpatialLocationCalculator.cpp | 4 ++-- src/pipeline/node/StereoDepth.cpp | 4 ++-- src/pipeline/node/SystemLogger.cpp | 4 ++-- src/pipeline/node/VideoEncoder.cpp | 4 ++-- src/pipeline/node/XLinkIn.cpp | 4 ++-- src/pipeline/node/XLinkOut.cpp | 4 ++-- 32 files changed, 64 insertions(+), 64 deletions(-) diff --git a/include/depthai/pipeline/Node.hpp b/include/depthai/pipeline/Node.hpp index 4d771e68a..0a8800942 100644 --- a/include/depthai/pipeline/Node.hpp +++ b/include/depthai/pipeline/Node.hpp @@ -154,9 +154,9 @@ class Node { /// Retrieves nodes name virtual std::string getName() const = 0; /// Retrieves all nodes outputs - virtual std::vector getOutputs() = 0; + virtual std::vector getOutputs() const = 0; /// Retrieves all nodes inputs - virtual std::vector getInputs() = 0; + virtual std::vector getInputs() const = 0; /// Retrieves all nodes assets virtual std::vector> getAssets(); diff --git a/include/depthai/pipeline/node/ColorCamera.hpp b/include/depthai/pipeline/node/ColorCamera.hpp index b59ec0322..90f841c83 100644 --- a/include/depthai/pipeline/node/ColorCamera.hpp +++ b/include/depthai/pipeline/node/ColorCamera.hpp @@ -21,8 +21,8 @@ class ColorCamera : public Node { Properties properties; std::string getName() const override; - std::vector getOutputs() override; - std::vector getInputs() override; + std::vector getOutputs() const override; + std::vector getInputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/DetectionNetwork.hpp b/include/depthai/pipeline/node/DetectionNetwork.hpp index 68eff2f53..177b8f21f 100644 --- a/include/depthai/pipeline/node/DetectionNetwork.hpp +++ b/include/depthai/pipeline/node/DetectionNetwork.hpp @@ -22,8 +22,8 @@ class DetectionNetwork : public NeuralNetwork { using Properties = dai::DetectionNetworkProperties; std::string getName() const override; - std::vector getOutputs() override; - std::vector getInputs() override; + std::vector getOutputs() const override; + std::vector getInputs() const override; protected: DetectionNetwork(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/IMU.hpp b/include/depthai/pipeline/node/IMU.hpp index 3aebf0e8b..016f69ca9 100644 --- a/include/depthai/pipeline/node/IMU.hpp +++ b/include/depthai/pipeline/node/IMU.hpp @@ -19,8 +19,8 @@ class IMU : public Node { Properties properties; std::string getName() const override; - std::vector getOutputs() override; - std::vector getInputs() override; + std::vector getOutputs() const override; + std::vector getInputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/ImageManip.hpp b/include/depthai/pipeline/node/ImageManip.hpp index 6ca32a14b..13fb80fa7 100644 --- a/include/depthai/pipeline/node/ImageManip.hpp +++ b/include/depthai/pipeline/node/ImageManip.hpp @@ -20,8 +20,8 @@ class ImageManip : public Node { Properties properties; std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; + std::vector getInputs() const override; + std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/MonoCamera.hpp b/include/depthai/pipeline/node/MonoCamera.hpp index fe3b81314..6e0a0de0b 100644 --- a/include/depthai/pipeline/node/MonoCamera.hpp +++ b/include/depthai/pipeline/node/MonoCamera.hpp @@ -22,8 +22,8 @@ class MonoCamera : public Node { Properties properties; std::string getName() const override; - std::vector getOutputs() override; - std::vector getInputs() override; + std::vector getOutputs() const override; + std::vector getInputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/MyProducer.hpp b/include/depthai/pipeline/node/MyProducer.hpp index 812a486bf..b86b60ede 100644 --- a/include/depthai/pipeline/node/MyProducer.hpp +++ b/include/depthai/pipeline/node/MyProducer.hpp @@ -11,8 +11,8 @@ class MyProducer : public Node { dai::MyProducerProperties properties; std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; + std::vector getInputs() const override; + std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/NeuralNetwork.hpp b/include/depthai/pipeline/node/NeuralNetwork.hpp index 75a284be6..e1745b7cf 100644 --- a/include/depthai/pipeline/node/NeuralNetwork.hpp +++ b/include/depthai/pipeline/node/NeuralNetwork.hpp @@ -20,8 +20,8 @@ class NeuralNetwork : public Node { using Properties = dai::NeuralNetworkProperties; std::string getName() const override; - std::vector getOutputs() override; - std::vector getInputs() override; + std::vector getOutputs() const override; + std::vector getInputs() const override; protected: nlohmann::json getProperties() override; diff --git a/include/depthai/pipeline/node/ObjectTracker.hpp b/include/depthai/pipeline/node/ObjectTracker.hpp index a2bf5b999..0af957057 100644 --- a/include/depthai/pipeline/node/ObjectTracker.hpp +++ b/include/depthai/pipeline/node/ObjectTracker.hpp @@ -22,8 +22,8 @@ class ObjectTracker : public Node { private: std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; + std::vector getInputs() const override; + std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/SPIOut.hpp b/include/depthai/pipeline/node/SPIOut.hpp index a84a28f04..e9354d8f7 100644 --- a/include/depthai/pipeline/node/SPIOut.hpp +++ b/include/depthai/pipeline/node/SPIOut.hpp @@ -18,11 +18,11 @@ class SPIOut : public Node { return "SPIOut"; } - std::vector getInputs() { + std::vector getInputs() const { return {input}; } - std::vector getOutputs() { + std::vector getOutputs() const { return {}; } diff --git a/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp b/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp index 1ccab0900..37c5b23b3 100644 --- a/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp +++ b/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp @@ -22,8 +22,8 @@ class SpatialDetectionNetwork : public DetectionNetwork { using Properties = dai::SpatialDetectionNetworkProperties; std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; + std::vector getInputs() const override; + std::vector getOutputs() const override; protected: SpatialDetectionNetwork(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/SpatialLocationCalculator.hpp b/include/depthai/pipeline/node/SpatialLocationCalculator.hpp index 146f087bd..d6f178f47 100644 --- a/include/depthai/pipeline/node/SpatialLocationCalculator.hpp +++ b/include/depthai/pipeline/node/SpatialLocationCalculator.hpp @@ -22,8 +22,8 @@ class SpatialLocationCalculator : public Node { private: std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; + std::vector getInputs() const override; + std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/StereoDepth.hpp b/include/depthai/pipeline/node/StereoDepth.hpp index 984d60b85..0e07ba7d2 100644 --- a/include/depthai/pipeline/node/StereoDepth.hpp +++ b/include/depthai/pipeline/node/StereoDepth.hpp @@ -20,8 +20,8 @@ class StereoDepth : public Node { Properties properties; std::string getName() const override; - std::vector getOutputs() override; - std::vector getInputs() override; + std::vector getOutputs() const override; + std::vector getInputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; std::shared_ptr rawConfig; diff --git a/include/depthai/pipeline/node/SystemLogger.hpp b/include/depthai/pipeline/node/SystemLogger.hpp index 389a7ce77..aa3e131a4 100644 --- a/include/depthai/pipeline/node/SystemLogger.hpp +++ b/include/depthai/pipeline/node/SystemLogger.hpp @@ -15,8 +15,8 @@ class SystemLogger : public Node { dai::SystemLoggerProperties properties; std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; + std::vector getInputs() const override; + std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/VideoEncoder.hpp b/include/depthai/pipeline/node/VideoEncoder.hpp index ad88cc819..7ab1e225a 100644 --- a/include/depthai/pipeline/node/VideoEncoder.hpp +++ b/include/depthai/pipeline/node/VideoEncoder.hpp @@ -19,8 +19,8 @@ class VideoEncoder : public Node { Properties properties; std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; + std::vector getInputs() const override; + std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/XLinkIn.hpp b/include/depthai/pipeline/node/XLinkIn.hpp index 9e94a60fe..6c4082fde 100644 --- a/include/depthai/pipeline/node/XLinkIn.hpp +++ b/include/depthai/pipeline/node/XLinkIn.hpp @@ -15,8 +15,8 @@ class XLinkIn : public Node { dai::XLinkInProperties properties; std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; + std::vector getInputs() const override; + std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/XLinkOut.hpp b/include/depthai/pipeline/node/XLinkOut.hpp index 8b98858ac..d441cbb40 100644 --- a/include/depthai/pipeline/node/XLinkOut.hpp +++ b/include/depthai/pipeline/node/XLinkOut.hpp @@ -15,8 +15,8 @@ class XLinkOut : public Node { dai::XLinkOutProperties properties; std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; + std::vector getInputs() const override; + std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/src/pipeline/node/ColorCamera.cpp b/src/pipeline/node/ColorCamera.cpp index a356cb355..8065cf1e4 100644 --- a/src/pipeline/node/ColorCamera.cpp +++ b/src/pipeline/node/ColorCamera.cpp @@ -24,11 +24,11 @@ std::string ColorCamera::getName() const { return "ColorCamera"; } -std::vector ColorCamera::getOutputs() { +std::vector ColorCamera::getOutputs() const { return {raw, isp, video, preview, still}; } -std::vector ColorCamera::getInputs() { +std::vector ColorCamera::getInputs() const { return {inputConfig, inputControl}; } diff --git a/src/pipeline/node/DetectionNetwork.cpp b/src/pipeline/node/DetectionNetwork.cpp index ae384c398..ceb9e5b7e 100644 --- a/src/pipeline/node/DetectionNetwork.cpp +++ b/src/pipeline/node/DetectionNetwork.cpp @@ -17,11 +17,11 @@ std::string DetectionNetwork::getName() const { return "DetectionNetwork"; } -std::vector DetectionNetwork::getInputs() { +std::vector DetectionNetwork::getInputs() const { return {input}; } -std::vector DetectionNetwork::getOutputs() { +std::vector DetectionNetwork::getOutputs() const { return {out, passthrough}; } diff --git a/src/pipeline/node/IMU.cpp b/src/pipeline/node/IMU.cpp index c7b3a9581..b5b9f86b8 100644 --- a/src/pipeline/node/IMU.cpp +++ b/src/pipeline/node/IMU.cpp @@ -11,11 +11,11 @@ std::string IMU::getName() const { return "IMU"; } -std::vector IMU::getOutputs() { +std::vector IMU::getOutputs() const { return {out}; } -std::vector IMU::getInputs() { +std::vector IMU::getInputs() const { return {}; } diff --git a/src/pipeline/node/ImageManip.cpp b/src/pipeline/node/ImageManip.cpp index a7909669c..5b67bfd65 100644 --- a/src/pipeline/node/ImageManip.cpp +++ b/src/pipeline/node/ImageManip.cpp @@ -9,11 +9,11 @@ std::string ImageManip::getName() const { return "ImageManip"; } -std::vector ImageManip::getInputs() { +std::vector ImageManip::getInputs() const { return {inputConfig, inputImage}; } -std::vector ImageManip::getOutputs() { +std::vector ImageManip::getOutputs() const { return {out}; } diff --git a/src/pipeline/node/MonoCamera.cpp b/src/pipeline/node/MonoCamera.cpp index 32ee64483..a701622ad 100644 --- a/src/pipeline/node/MonoCamera.cpp +++ b/src/pipeline/node/MonoCamera.cpp @@ -16,11 +16,11 @@ std::string MonoCamera::getName() const { return "MonoCamera"; } -std::vector MonoCamera::getOutputs() { +std::vector MonoCamera::getOutputs() const { return {out, raw}; } -std::vector MonoCamera::getInputs() { +std::vector MonoCamera::getInputs() const { return {inputControl}; } diff --git a/src/pipeline/node/MyProducer.cpp b/src/pipeline/node/MyProducer.cpp index 3600f41bb..a8bb56a4b 100644 --- a/src/pipeline/node/MyProducer.cpp +++ b/src/pipeline/node/MyProducer.cpp @@ -9,11 +9,11 @@ std::string MyProducer::getName() const { return "MyProducer"; } -std::vector MyProducer::getInputs() { +std::vector MyProducer::getInputs() const { return {}; } -std::vector MyProducer::getOutputs() { +std::vector MyProducer::getOutputs() const { return {out}; } diff --git a/src/pipeline/node/NeuralNetwork.cpp b/src/pipeline/node/NeuralNetwork.cpp index 8727aac50..eeb47abc5 100644 --- a/src/pipeline/node/NeuralNetwork.cpp +++ b/src/pipeline/node/NeuralNetwork.cpp @@ -12,11 +12,11 @@ std::string NeuralNetwork::getName() const { return "NeuralNetwork"; } -std::vector NeuralNetwork::getOutputs() { +std::vector NeuralNetwork::getOutputs() const { return {out, passthrough}; } -std::vector NeuralNetwork::getInputs() { +std::vector NeuralNetwork::getInputs() const { return {input}; } diff --git a/src/pipeline/node/ObjectTracker.cpp b/src/pipeline/node/ObjectTracker.cpp index 7fc76d4c5..3266303a8 100644 --- a/src/pipeline/node/ObjectTracker.cpp +++ b/src/pipeline/node/ObjectTracker.cpp @@ -11,11 +11,11 @@ std::string ObjectTracker::getName() const { return "ObjectTracker"; } -std::vector ObjectTracker::getOutputs() { +std::vector ObjectTracker::getOutputs() const { return {out, passthroughTrackerFrame, passthroughDetectionFrame, passthroughDetections}; } -std::vector ObjectTracker::getInputs() { +std::vector ObjectTracker::getInputs() const { return {inputTrackerFrame, inputDetectionFrame, inputDetections}; } diff --git a/src/pipeline/node/SpatialDetectionNetwork.cpp b/src/pipeline/node/SpatialDetectionNetwork.cpp index 977ecf99c..fa0281a49 100644 --- a/src/pipeline/node/SpatialDetectionNetwork.cpp +++ b/src/pipeline/node/SpatialDetectionNetwork.cpp @@ -21,11 +21,11 @@ std::string SpatialDetectionNetwork::getName() const { return "SpatialDetectionNetwork"; } -std::vector SpatialDetectionNetwork::getInputs() { +std::vector SpatialDetectionNetwork::getInputs() const { return {input, inputDepth}; } -std::vector SpatialDetectionNetwork::getOutputs() { +std::vector SpatialDetectionNetwork::getOutputs() const { return {out, boundingBoxMapping, passthrough, passthroughDepth}; } diff --git a/src/pipeline/node/SpatialLocationCalculator.cpp b/src/pipeline/node/SpatialLocationCalculator.cpp index c49a402d7..cc5cd8c20 100644 --- a/src/pipeline/node/SpatialLocationCalculator.cpp +++ b/src/pipeline/node/SpatialLocationCalculator.cpp @@ -12,11 +12,11 @@ std::string SpatialLocationCalculator::getName() const { return "SpatialLocationCalculator"; } -std::vector SpatialLocationCalculator::getOutputs() { +std::vector SpatialLocationCalculator::getOutputs() const { return {out, passthroughDepth}; } -std::vector SpatialLocationCalculator::getInputs() { +std::vector SpatialLocationCalculator::getInputs() const { return {inputConfig, inputDepth}; } diff --git a/src/pipeline/node/StereoDepth.cpp b/src/pipeline/node/StereoDepth.cpp index 68563950a..c7f14bece 100644 --- a/src/pipeline/node/StereoDepth.cpp +++ b/src/pipeline/node/StereoDepth.cpp @@ -17,11 +17,11 @@ std::string StereoDepth::getName() const { return "StereoDepth"; } -std::vector StereoDepth::getOutputs() { +std::vector StereoDepth::getOutputs() const { return {disparity, depth, syncedLeft, syncedRight, rectifiedLeft, rectifiedRight}; } -std::vector StereoDepth::getInputs() { +std::vector StereoDepth::getInputs() const { return {inputConfig, left, right}; } diff --git a/src/pipeline/node/SystemLogger.cpp b/src/pipeline/node/SystemLogger.cpp index 0ab0cb0e5..92ba15504 100644 --- a/src/pipeline/node/SystemLogger.cpp +++ b/src/pipeline/node/SystemLogger.cpp @@ -11,11 +11,11 @@ std::string SystemLogger::getName() const { return "SystemLogger"; } -std::vector SystemLogger::getInputs() { +std::vector SystemLogger::getInputs() const { return {}; } -std::vector SystemLogger::getOutputs() { +std::vector SystemLogger::getOutputs() const { return {out}; } diff --git a/src/pipeline/node/VideoEncoder.cpp b/src/pipeline/node/VideoEncoder.cpp index c3e1ed947..26dcd889a 100644 --- a/src/pipeline/node/VideoEncoder.cpp +++ b/src/pipeline/node/VideoEncoder.cpp @@ -9,11 +9,11 @@ std::string VideoEncoder::getName() const { return "VideoEncoder"; } -std::vector VideoEncoder::getInputs() { +std::vector VideoEncoder::getInputs() const { return {input}; } -std::vector VideoEncoder::getOutputs() { +std::vector VideoEncoder::getOutputs() const { return {bitstream}; } diff --git a/src/pipeline/node/XLinkIn.cpp b/src/pipeline/node/XLinkIn.cpp index ba924cb9c..5dd0138f6 100644 --- a/src/pipeline/node/XLinkIn.cpp +++ b/src/pipeline/node/XLinkIn.cpp @@ -9,11 +9,11 @@ std::string XLinkIn::getName() const { return "XLinkIn"; } -std::vector XLinkIn::getInputs() { +std::vector XLinkIn::getInputs() const { return {}; } -std::vector XLinkIn::getOutputs() { +std::vector XLinkIn::getOutputs() const { return {out}; } diff --git a/src/pipeline/node/XLinkOut.cpp b/src/pipeline/node/XLinkOut.cpp index 16f01cd20..2dcbac30c 100644 --- a/src/pipeline/node/XLinkOut.cpp +++ b/src/pipeline/node/XLinkOut.cpp @@ -11,11 +11,11 @@ std::string XLinkOut::getName() const { return "XLinkOut"; } -std::vector XLinkOut::getInputs() { +std::vector XLinkOut::getInputs() const { return {input}; } -std::vector XLinkOut::getOutputs() { +std::vector XLinkOut::getOutputs() const { return {}; } From d39fa07f460cf2b3051e8cbcca6560d34ca7d4cb Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Wed, 16 Jun 2021 10:39:02 +0900 Subject: [PATCH 02/15] Adjust visibility of getName, getInput, getOutput --- include/depthai/pipeline/node/ColorCamera.hpp | 10 ++++----- .../pipeline/node/DetectionNetwork.hpp | 5 +++-- include/depthai/pipeline/node/IMU.hpp | 7 +++--- include/depthai/pipeline/node/ImageManip.hpp | 10 ++++----- include/depthai/pipeline/node/MonoCamera.hpp | 7 +++--- include/depthai/pipeline/node/MyProducer.hpp | 7 +++--- .../depthai/pipeline/node/ObjectTracker.hpp | 7 +++--- include/depthai/pipeline/node/SPIOut.hpp | 22 +++++++++---------- .../pipeline/node/SpatialDetectionNetwork.hpp | 3 ++- .../node/SpatialLocationCalculator.hpp | 7 +++--- include/depthai/pipeline/node/StereoDepth.hpp | 7 +++--- .../depthai/pipeline/node/SystemLogger.hpp | 7 +++--- .../depthai/pipeline/node/VideoEncoder.hpp | 7 +++--- include/depthai/pipeline/node/XLinkIn.hpp | 7 +++--- include/depthai/pipeline/node/XLinkOut.hpp | 7 +++--- 15 files changed, 66 insertions(+), 54 deletions(-) diff --git a/include/depthai/pipeline/node/ColorCamera.hpp b/include/depthai/pipeline/node/ColorCamera.hpp index 90f841c83..60114fd03 100644 --- a/include/depthai/pipeline/node/ColorCamera.hpp +++ b/include/depthai/pipeline/node/ColorCamera.hpp @@ -19,18 +19,18 @@ class ColorCamera : public Node { private: Properties properties; + std::shared_ptr rawControl; + std::shared_ptr clone() override; + nlohmann::json getProperties() override; + + public: std::string getName() const override; std::vector getOutputs() const override; std::vector getInputs() const override; - nlohmann::json getProperties() override; - std::shared_ptr clone() override; - - std::shared_ptr rawControl; int getScaledSize(int input, int num, int denom) const; - public: /** * Constructs ColorCamera node. */ diff --git a/include/depthai/pipeline/node/DetectionNetwork.hpp b/include/depthai/pipeline/node/DetectionNetwork.hpp index 177b8f21f..93889fc51 100644 --- a/include/depthai/pipeline/node/DetectionNetwork.hpp +++ b/include/depthai/pipeline/node/DetectionNetwork.hpp @@ -26,9 +26,10 @@ class DetectionNetwork : public NeuralNetwork { std::vector getInputs() const override; protected: - DetectionNetwork(const std::shared_ptr& par, int64_t nodeId); Properties properties; - virtual Properties& getPropertiesRef() override; + + DetectionNetwork(const std::shared_ptr& par, int64_t nodeId); + Properties& getPropertiesRef() override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/include/depthai/pipeline/node/IMU.hpp b/include/depthai/pipeline/node/IMU.hpp index 016f69ca9..8c0695aee 100644 --- a/include/depthai/pipeline/node/IMU.hpp +++ b/include/depthai/pipeline/node/IMU.hpp @@ -18,13 +18,14 @@ class IMU : public Node { private: Properties properties; - std::string getName() const override; - std::vector getOutputs() const override; - std::vector getInputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; public: + std::string getName() const override; + std::vector getOutputs() const override; + std::vector getInputs() const override; + /** * Constructs IMU node. */ diff --git a/include/depthai/pipeline/node/ImageManip.hpp b/include/depthai/pipeline/node/ImageManip.hpp index 13fb80fa7..603a46e39 100644 --- a/include/depthai/pipeline/node/ImageManip.hpp +++ b/include/depthai/pipeline/node/ImageManip.hpp @@ -18,16 +18,16 @@ class ImageManip : public Node { private: Properties properties; + std::shared_ptr rawConfig; - std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; - std::shared_ptr rawConfig; - public: + std::string getName() const override; + std::vector getInputs() const override; + std::vector getOutputs() const override; + ImageManip(const std::shared_ptr& par, int64_t nodeId); /** diff --git a/include/depthai/pipeline/node/MonoCamera.hpp b/include/depthai/pipeline/node/MonoCamera.hpp index 6e0a0de0b..9ebe3c47e 100644 --- a/include/depthai/pipeline/node/MonoCamera.hpp +++ b/include/depthai/pipeline/node/MonoCamera.hpp @@ -21,15 +21,16 @@ class MonoCamera : public Node { private: Properties properties; - std::string getName() const override; - std::vector getOutputs() const override; - std::vector getInputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; std::shared_ptr rawControl; public: + std::string getName() const override; + std::vector getOutputs() const override; + std::vector getInputs() const override; + MonoCamera(const std::shared_ptr& par, int64_t nodeId); /** diff --git a/include/depthai/pipeline/node/MyProducer.hpp b/include/depthai/pipeline/node/MyProducer.hpp index b86b60ede..87f675139 100644 --- a/include/depthai/pipeline/node/MyProducer.hpp +++ b/include/depthai/pipeline/node/MyProducer.hpp @@ -10,13 +10,14 @@ namespace node { class MyProducer : public Node { dai::MyProducerProperties properties; - std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; public: + std::string getName() const override; + std::vector getInputs() const override; + std::vector getOutputs() const override; + MyProducer(const std::shared_ptr& par, int64_t nodeId); Output out{*this, "out", Output::Type::MSender, {{DatatypeEnum::Buffer, true}}}; diff --git a/include/depthai/pipeline/node/ObjectTracker.hpp b/include/depthai/pipeline/node/ObjectTracker.hpp index 0af957057..13aac2e2b 100644 --- a/include/depthai/pipeline/node/ObjectTracker.hpp +++ b/include/depthai/pipeline/node/ObjectTracker.hpp @@ -21,15 +21,16 @@ class ObjectTracker : public Node { using Properties = dai::ObjectTrackerProperties; private: - std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; Properties properties; public: + std::string getName() const override; + std::vector getInputs() const override; + std::vector getOutputs() const override; + ObjectTracker(const std::shared_ptr& par, int64_t nodeId); /** diff --git a/include/depthai/pipeline/node/SPIOut.hpp b/include/depthai/pipeline/node/SPIOut.hpp index e9354d8f7..751cc6c2a 100644 --- a/include/depthai/pipeline/node/SPIOut.hpp +++ b/include/depthai/pipeline/node/SPIOut.hpp @@ -14,6 +14,17 @@ namespace node { class SPIOut : public Node { dai::SPIOutProperties properties; + nlohmann::json getProperties() { + nlohmann::json j; + nlohmann::to_json(j, properties); + return j; + } + + std::shared_ptr clone() { + return std::make_shared(*this); + } + + public: std::string getName() const { return "SPIOut"; } @@ -26,17 +37,6 @@ class SPIOut : public Node { return {}; } - nlohmann::json getProperties() { - nlohmann::json j; - nlohmann::to_json(j, properties); - return j; - } - - std::shared_ptr clone() { - return std::make_shared(*this); - } - - public: SPIOut(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { properties.busId = 0; } diff --git a/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp b/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp index 37c5b23b3..642b404d3 100644 --- a/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp +++ b/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp @@ -26,13 +26,14 @@ class SpatialDetectionNetwork : public DetectionNetwork { std::vector getOutputs() const override; protected: - SpatialDetectionNetwork(const std::shared_ptr& par, int64_t nodeId); Properties properties; virtual Properties& getPropertiesRef() override; nlohmann::json getProperties() override; std::shared_ptr clone() override; public: + SpatialDetectionNetwork(const std::shared_ptr& par, int64_t nodeId); + /** * Input message with data to be infered upon * Default queue is blocking with size 5 diff --git a/include/depthai/pipeline/node/SpatialLocationCalculator.hpp b/include/depthai/pipeline/node/SpatialLocationCalculator.hpp index d6f178f47..6a485044f 100644 --- a/include/depthai/pipeline/node/SpatialLocationCalculator.hpp +++ b/include/depthai/pipeline/node/SpatialLocationCalculator.hpp @@ -21,9 +21,6 @@ class SpatialLocationCalculator : public Node { using Properties = dai::SpatialLocationCalculatorProperties; private: - std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; @@ -31,6 +28,10 @@ class SpatialLocationCalculator : public Node { Properties properties; public: + std::string getName() const override; + std::vector getInputs() const override; + std::vector getOutputs() const override; + SpatialLocationCalculator(const std::shared_ptr& par, int64_t nodeId); /** diff --git a/include/depthai/pipeline/node/StereoDepth.hpp b/include/depthai/pipeline/node/StereoDepth.hpp index 0e07ba7d2..41aabc738 100644 --- a/include/depthai/pipeline/node/StereoDepth.hpp +++ b/include/depthai/pipeline/node/StereoDepth.hpp @@ -19,14 +19,15 @@ class StereoDepth : public Node { private: Properties properties; - std::string getName() const override; - std::vector getOutputs() const override; - std::vector getInputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; std::shared_ptr rawConfig; public: + std::string getName() const override; + std::vector getOutputs() const override; + std::vector getInputs() const override; + StereoDepth(const std::shared_ptr& par, int64_t nodeId); /** diff --git a/include/depthai/pipeline/node/SystemLogger.hpp b/include/depthai/pipeline/node/SystemLogger.hpp index aa3e131a4..f57916377 100644 --- a/include/depthai/pipeline/node/SystemLogger.hpp +++ b/include/depthai/pipeline/node/SystemLogger.hpp @@ -14,13 +14,14 @@ namespace node { class SystemLogger : public Node { dai::SystemLoggerProperties properties; - std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; public: + std::string getName() const override; + std::vector getInputs() const override; + std::vector getOutputs() const override; + SystemLogger(const std::shared_ptr& par, int64_t nodeId); /** diff --git a/include/depthai/pipeline/node/VideoEncoder.hpp b/include/depthai/pipeline/node/VideoEncoder.hpp index 7ab1e225a..32c2ba86c 100644 --- a/include/depthai/pipeline/node/VideoEncoder.hpp +++ b/include/depthai/pipeline/node/VideoEncoder.hpp @@ -18,13 +18,14 @@ class VideoEncoder : public Node { private: Properties properties; - std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; public: + std::string getName() const override; + std::vector getInputs() const override; + std::vector getOutputs() const override; + VideoEncoder(const std::shared_ptr& par, int64_t nodeId); /** diff --git a/include/depthai/pipeline/node/XLinkIn.hpp b/include/depthai/pipeline/node/XLinkIn.hpp index 6c4082fde..7bba14a1d 100644 --- a/include/depthai/pipeline/node/XLinkIn.hpp +++ b/include/depthai/pipeline/node/XLinkIn.hpp @@ -14,13 +14,14 @@ namespace node { class XLinkIn : public Node { dai::XLinkInProperties properties; - std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; public: + std::string getName() const override; + std::vector getInputs() const override; + std::vector getOutputs() const override; + XLinkIn(const std::shared_ptr& par, int64_t nodeId); /** diff --git a/include/depthai/pipeline/node/XLinkOut.hpp b/include/depthai/pipeline/node/XLinkOut.hpp index d441cbb40..7b7f45bf5 100644 --- a/include/depthai/pipeline/node/XLinkOut.hpp +++ b/include/depthai/pipeline/node/XLinkOut.hpp @@ -14,13 +14,14 @@ namespace node { class XLinkOut : public Node { dai::XLinkOutProperties properties; - std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; nlohmann::json getProperties() override; std::shared_ptr clone() override; public: + std::string getName() const override; + std::vector getInputs() const override; + std::vector getOutputs() const override; + XLinkOut(const std::shared_ptr& par, int64_t nodeId); /** From 42119815715f9ea04da8a31ab622ea92177a8e9a Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Wed, 16 Jun 2021 21:47:55 +0900 Subject: [PATCH 03/15] Adding getters for parents --- include/depthai/pipeline/Node.hpp | 22 +++++++++++++++------- src/pipeline/Node.cpp | 4 ++-- src/pipeline/Pipeline.cpp | 20 ++++++++++---------- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/include/depthai/pipeline/Node.hpp b/include/depthai/pipeline/Node.hpp index 0a8800942..f820f8f15 100644 --- a/include/depthai/pipeline/Node.hpp +++ b/include/depthai/pipeline/Node.hpp @@ -41,11 +41,13 @@ class Node { }; // fwd declare Input class - struct Input; + class Input; - struct Output { - enum class Type { MSender, SSender }; + class Output { Node& parent; + + public: + enum class Type { MSender, SSender }; const std::string name; const Type type; // Which types and do descendants count as well? @@ -54,7 +56,9 @@ class Node { : parent(par), name(std::move(n)), type(t), possibleDatatypes(std::move(types)) {} bool isSamePipeline(const Input& in); - public: + Node& getParent() { return parent; } + const Node& getParent() const { return parent; } + /** * Check if connection is possible * @param in Input to connect to @@ -88,9 +92,11 @@ class Node { void unlink(const Input& in); }; - struct Input { - enum class Type { SReceiver, MReceiver }; + class Input { Node& parent; + + public: + enum class Type { SReceiver, MReceiver }; const std::string name; const Type type; bool defaultBlocking{true}; @@ -108,7 +114,9 @@ class Node { Input(Node& par, std::string n, Type t, bool blocking, int queueSize, std::vector types) : parent(par), name(std::move(n)), type(t), defaultBlocking(blocking), defaultQueueSize(queueSize), possibleDatatypes(std::move(types)) {} - public: + Node& getParent() { return parent; } + const Node& getParent() const { return parent; } + /** * Overrides default input queue behavior. * @param blocking True blocking, false overwriting diff --git a/src/pipeline/Node.cpp b/src/pipeline/Node.cpp index d591e6be6..30dfd4089 100644 --- a/src/pipeline/Node.cpp +++ b/src/pipeline/Node.cpp @@ -26,9 +26,9 @@ Pipeline Node::getParentPipeline() { } Node::Connection::Connection(Output out, Input in) { - outputId = out.parent.id; + outputId = out.getParent().id; outputName = out.name; - inputId = in.parent.id; + inputId = in.getParent().id; inputName = in.name; } diff --git a/src/pipeline/Pipeline.cpp b/src/pipeline/Pipeline.cpp index ca39763c0..a1fb6d28b 100644 --- a/src/pipeline/Pipeline.cpp +++ b/src/pipeline/Pipeline.cpp @@ -312,9 +312,9 @@ void PipelineImpl::remove(std::shared_ptr toRemove) { bool PipelineImpl::isSamePipeline(const Node::Output& out, const Node::Input& in) { // Check whether Output 'out' and Input 'in' are on the same pipeline. // By checking whether their parent nodes are on same pipeline - auto outputPipeline = out.parent.parent.lock(); + auto outputPipeline = out.getParent().parent.lock(); if(outputPipeline != nullptr) { - return (outputPipeline == in.parent.parent.lock()); + return (outputPipeline == in.getParent().parent.lock()); } return false; } @@ -359,20 +359,20 @@ void PipelineImpl::link(const Node::Output& out, const Node::Input& in) { } if(!canConnect(out, in)) { - throw std::runtime_error(fmt::format("Cannot link '{}.{}' to '{}.{}'", out.parent.getName(), out.name, in.parent.getName(), in.name)); + throw std::runtime_error(fmt::format("Cannot link '{}.{}' to '{}.{}'", out.getParent().getName(), out.name, in.getParent().getName(), in.name)); } // Create 'Connection' object between 'out' and 'in' Node::Connection connection(out, in); // Check if connection was already made - the following is possible as operator[] constructs the underlying set if it doesn't exist. - if(nodeConnectionMap[in.parent.id].count(connection) > 0) { + if(nodeConnectionMap[in.getParent().id].count(connection) > 0) { // this means a connection was already made. - throw std::logic_error(fmt::format("'{}.{}' already linked to '{}.{}'", out.parent.getName(), out.name, in.parent.getName(), in.name)); + throw std::logic_error(fmt::format("'{}.{}' already linked to '{}.{}'", out.getParent().getName(), out.name, in.getParent().getName(), in.name)); } - // Otherwise all is set to add a new connection into nodeConnectionMap[in.parent.id] - nodeConnectionMap[in.parent.id].insert(connection); + // Otherwise all is set to add a new connection into nodeConnectionMap[in.getParent().id] + nodeConnectionMap[in.getParent().id].insert(connection); } void PipelineImpl::unlink(const Node::Output& out, const Node::Input& in) { @@ -385,13 +385,13 @@ void PipelineImpl::unlink(const Node::Output& out, const Node::Input& in) { Node::Connection connection(out, in); // Check if not connected (connection object doesn't exist in nodeConnectionMap) - if(nodeConnectionMap[in.parent.id].count(connection) <= 0) { + if(nodeConnectionMap[in.getParent().id].count(connection) <= 0) { // not connected - throw std::logic_error(fmt::format("'{}.{}' not linked to '{}.{}'", out.parent.getName(), out.name, in.parent.getName(), in.name)); + throw std::logic_error(fmt::format("'{}.{}' not linked to '{}.{}'", out.getParent().getName(), out.name, in.getParent().getName(), in.name)); } // Otherwise if exists, remove this connection - nodeConnectionMap[in.parent.id].erase(connection); + nodeConnectionMap[in.getParent().id].erase(connection); } void PipelineImpl::setCalibrationData(CalibrationHandler calibrationDataHandler) { From c2caf257e5ccf6e16c500f073e3864374e8a84d6 Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Wed, 16 Jun 2021 21:57:28 +0900 Subject: [PATCH 04/15] Fix style, again --- include/depthai/pipeline/Node.hpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/include/depthai/pipeline/Node.hpp b/include/depthai/pipeline/Node.hpp index f820f8f15..84090cc25 100644 --- a/include/depthai/pipeline/Node.hpp +++ b/include/depthai/pipeline/Node.hpp @@ -46,7 +46,7 @@ class Node { class Output { Node& parent; - public: + public: enum class Type { MSender, SSender }; const std::string name; const Type type; @@ -56,8 +56,12 @@ class Node { : parent(par), name(std::move(n)), type(t), possibleDatatypes(std::move(types)) {} bool isSamePipeline(const Input& in); - Node& getParent() { return parent; } - const Node& getParent() const { return parent; } + Node& getParent() { + return parent; + } + const Node& getParent() const { + return parent; + } /** * Check if connection is possible @@ -95,7 +99,7 @@ class Node { class Input { Node& parent; - public: + public: enum class Type { SReceiver, MReceiver }; const std::string name; const Type type; @@ -114,8 +118,12 @@ class Node { Input(Node& par, std::string n, Type t, bool blocking, int queueSize, std::vector types) : parent(par), name(std::move(n)), type(t), defaultBlocking(blocking), defaultQueueSize(queueSize), possibleDatatypes(std::move(types)) {} - Node& getParent() { return parent; } - const Node& getParent() const { return parent; } + Node& getParent() { + return parent; + } + const Node& getParent() const { + return parent; + } /** * Overrides default input queue behavior. From 44b288944235776ad63f36a4b249d57c7074d630 Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Tue, 22 Jun 2021 11:55:13 +0900 Subject: [PATCH 05/15] Add {In,Out}putRef getters --- include/depthai/pipeline/Node.hpp | 43 ++++++++++++++++--- include/depthai/pipeline/node/ColorCamera.hpp | 2 - .../pipeline/node/DetectionNetwork.hpp | 2 - include/depthai/pipeline/node/IMU.hpp | 2 - include/depthai/pipeline/node/ImageManip.hpp | 2 - include/depthai/pipeline/node/MonoCamera.hpp | 2 - include/depthai/pipeline/node/MyProducer.hpp | 2 - .../depthai/pipeline/node/NeuralNetwork.hpp | 2 - .../depthai/pipeline/node/ObjectTracker.hpp | 2 - include/depthai/pipeline/node/SPIOut.hpp | 11 ++--- .../pipeline/node/SpatialDetectionNetwork.hpp | 2 - .../node/SpatialLocationCalculator.hpp | 2 - include/depthai/pipeline/node/StereoDepth.hpp | 2 - .../depthai/pipeline/node/SystemLogger.hpp | 2 - .../depthai/pipeline/node/VideoEncoder.hpp | 2 - include/depthai/pipeline/node/XLinkIn.hpp | 2 - include/depthai/pipeline/node/XLinkOut.hpp | 2 - src/pipeline/node/ColorCamera.cpp | 14 +++--- src/pipeline/node/DetectionNetwork.cpp | 16 +++---- src/pipeline/node/IMU.cpp | 13 ++---- src/pipeline/node/ImageManip.cpp | 16 +++---- src/pipeline/node/MonoCamera.cpp | 14 +++--- src/pipeline/node/MyProducer.cpp | 13 ++---- src/pipeline/node/NeuralNetwork.cpp | 16 +++---- src/pipeline/node/ObjectTracker.cpp | 16 +++---- src/pipeline/node/SpatialDetectionNetwork.cpp | 16 +++---- .../node/SpatialLocationCalculator.cpp | 16 +++---- src/pipeline/node/StereoDepth.cpp | 13 +++--- src/pipeline/node/SystemLogger.cpp | 11 ++--- src/pipeline/node/VideoEncoder.cpp | 16 +++---- src/pipeline/node/XLinkIn.cpp | 13 ++---- src/pipeline/node/XLinkOut.cpp | 11 ++--- 32 files changed, 125 insertions(+), 173 deletions(-) diff --git a/include/depthai/pipeline/Node.hpp b/include/depthai/pipeline/Node.hpp index 84090cc25..458b15adf 100644 --- a/include/depthai/pipeline/Node.hpp +++ b/include/depthai/pipeline/Node.hpp @@ -34,15 +34,19 @@ class Node { struct Connection; protected: + // fwd declare classes + class Input; + class Output; + + Output *firstOutput = nullptr, *lastOutput = nullptr; + Input *firstInput = nullptr, *lastInput = nullptr; + struct DatatypeHierarchy { DatatypeHierarchy(DatatypeEnum d, bool c) : datatype(d), descendants(c) {} DatatypeEnum datatype; bool descendants; }; - // fwd declare Input class - class Input; - class Output { Node& parent; @@ -170,12 +174,41 @@ class Node { /// Retrieves nodes name virtual std::string getName() const = 0; /// Retrieves all nodes outputs - virtual std::vector getOutputs() const = 0; + std::vector getOutputs() { + std::vector result; + for (auto* x: getOutputRefs()) { + result.push_back(*x); + } + return result; + } /// Retrieves all nodes inputs - virtual std::vector getInputs() const = 0; + std::vector getInputs() { + std::vector result; + for (auto* x: getInputRefs()) { + result.push_back(*x); + } + return result; + } /// Retrieves all nodes assets virtual std::vector> getAssets(); + std::vector getOutputRefs() { + if(firstOutput == nullptr) return {}; + return std::vector{firstOutput, lastOutput}; + } + std::vector getOutputRefs() const { + if(firstOutput == nullptr) return {}; + return std::vector{firstOutput, lastOutput}; + } + std::vector getInputRefs() { + if(firstInput == nullptr) return {}; + return std::vector{firstInput, lastInput}; + } + std::vector getInputRefs() const { + if(firstInput == nullptr) return {}; + return std::vector{firstInput, lastInput}; + } + /// Connection between an Input and Output struct Connection { friend struct std::hash; diff --git a/include/depthai/pipeline/node/ColorCamera.hpp b/include/depthai/pipeline/node/ColorCamera.hpp index 60114fd03..9a1b6e324 100644 --- a/include/depthai/pipeline/node/ColorCamera.hpp +++ b/include/depthai/pipeline/node/ColorCamera.hpp @@ -26,8 +26,6 @@ class ColorCamera : public Node { public: std::string getName() const override; - std::vector getOutputs() const override; - std::vector getInputs() const override; int getScaledSize(int input, int num, int denom) const; diff --git a/include/depthai/pipeline/node/DetectionNetwork.hpp b/include/depthai/pipeline/node/DetectionNetwork.hpp index 93889fc51..2b6f7bf9c 100644 --- a/include/depthai/pipeline/node/DetectionNetwork.hpp +++ b/include/depthai/pipeline/node/DetectionNetwork.hpp @@ -22,8 +22,6 @@ class DetectionNetwork : public NeuralNetwork { using Properties = dai::DetectionNetworkProperties; std::string getName() const override; - std::vector getOutputs() const override; - std::vector getInputs() const override; protected: Properties properties; diff --git a/include/depthai/pipeline/node/IMU.hpp b/include/depthai/pipeline/node/IMU.hpp index 8c0695aee..2e77aeec7 100644 --- a/include/depthai/pipeline/node/IMU.hpp +++ b/include/depthai/pipeline/node/IMU.hpp @@ -23,8 +23,6 @@ class IMU : public Node { public: std::string getName() const override; - std::vector getOutputs() const override; - std::vector getInputs() const override; /** * Constructs IMU node. diff --git a/include/depthai/pipeline/node/ImageManip.hpp b/include/depthai/pipeline/node/ImageManip.hpp index 603a46e39..a95c57258 100644 --- a/include/depthai/pipeline/node/ImageManip.hpp +++ b/include/depthai/pipeline/node/ImageManip.hpp @@ -25,8 +25,6 @@ class ImageManip : public Node { public: std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; ImageManip(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/MonoCamera.hpp b/include/depthai/pipeline/node/MonoCamera.hpp index 9ebe3c47e..b4c8d2fd6 100644 --- a/include/depthai/pipeline/node/MonoCamera.hpp +++ b/include/depthai/pipeline/node/MonoCamera.hpp @@ -28,8 +28,6 @@ class MonoCamera : public Node { public: std::string getName() const override; - std::vector getOutputs() const override; - std::vector getInputs() const override; MonoCamera(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/MyProducer.hpp b/include/depthai/pipeline/node/MyProducer.hpp index 87f675139..a42d8f776 100644 --- a/include/depthai/pipeline/node/MyProducer.hpp +++ b/include/depthai/pipeline/node/MyProducer.hpp @@ -15,8 +15,6 @@ class MyProducer : public Node { public: std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; MyProducer(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/NeuralNetwork.hpp b/include/depthai/pipeline/node/NeuralNetwork.hpp index e1745b7cf..02a5e2500 100644 --- a/include/depthai/pipeline/node/NeuralNetwork.hpp +++ b/include/depthai/pipeline/node/NeuralNetwork.hpp @@ -20,8 +20,6 @@ class NeuralNetwork : public Node { using Properties = dai::NeuralNetworkProperties; std::string getName() const override; - std::vector getOutputs() const override; - std::vector getInputs() const override; protected: nlohmann::json getProperties() override; diff --git a/include/depthai/pipeline/node/ObjectTracker.hpp b/include/depthai/pipeline/node/ObjectTracker.hpp index 13aac2e2b..60ea861bc 100644 --- a/include/depthai/pipeline/node/ObjectTracker.hpp +++ b/include/depthai/pipeline/node/ObjectTracker.hpp @@ -28,8 +28,6 @@ class ObjectTracker : public Node { public: std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; ObjectTracker(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/SPIOut.hpp b/include/depthai/pipeline/node/SPIOut.hpp index 751cc6c2a..6703a9d65 100644 --- a/include/depthai/pipeline/node/SPIOut.hpp +++ b/include/depthai/pipeline/node/SPIOut.hpp @@ -29,16 +29,11 @@ class SPIOut : public Node { return "SPIOut"; } - std::vector getInputs() const { - return {input}; - } - - std::vector getOutputs() const { - return {}; - } - SPIOut(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { properties.busId = 0; + + firstInput = &input; + lastInput = &input + 1; } /** diff --git a/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp b/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp index 642b404d3..6da36d5cd 100644 --- a/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp +++ b/include/depthai/pipeline/node/SpatialDetectionNetwork.hpp @@ -22,8 +22,6 @@ class SpatialDetectionNetwork : public DetectionNetwork { using Properties = dai::SpatialDetectionNetworkProperties; std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; protected: Properties properties; diff --git a/include/depthai/pipeline/node/SpatialLocationCalculator.hpp b/include/depthai/pipeline/node/SpatialLocationCalculator.hpp index 6a485044f..ec2e9f827 100644 --- a/include/depthai/pipeline/node/SpatialLocationCalculator.hpp +++ b/include/depthai/pipeline/node/SpatialLocationCalculator.hpp @@ -29,8 +29,6 @@ class SpatialLocationCalculator : public Node { public: std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; SpatialLocationCalculator(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/StereoDepth.hpp b/include/depthai/pipeline/node/StereoDepth.hpp index 41aabc738..58e48d603 100644 --- a/include/depthai/pipeline/node/StereoDepth.hpp +++ b/include/depthai/pipeline/node/StereoDepth.hpp @@ -25,8 +25,6 @@ class StereoDepth : public Node { public: std::string getName() const override; - std::vector getOutputs() const override; - std::vector getInputs() const override; StereoDepth(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/SystemLogger.hpp b/include/depthai/pipeline/node/SystemLogger.hpp index f57916377..2ce4713a3 100644 --- a/include/depthai/pipeline/node/SystemLogger.hpp +++ b/include/depthai/pipeline/node/SystemLogger.hpp @@ -19,8 +19,6 @@ class SystemLogger : public Node { public: std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; SystemLogger(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/VideoEncoder.hpp b/include/depthai/pipeline/node/VideoEncoder.hpp index 32c2ba86c..180846129 100644 --- a/include/depthai/pipeline/node/VideoEncoder.hpp +++ b/include/depthai/pipeline/node/VideoEncoder.hpp @@ -23,8 +23,6 @@ class VideoEncoder : public Node { public: std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; VideoEncoder(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/XLinkIn.hpp b/include/depthai/pipeline/node/XLinkIn.hpp index 7bba14a1d..b6524bd6f 100644 --- a/include/depthai/pipeline/node/XLinkIn.hpp +++ b/include/depthai/pipeline/node/XLinkIn.hpp @@ -19,8 +19,6 @@ class XLinkIn : public Node { public: std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; XLinkIn(const std::shared_ptr& par, int64_t nodeId); diff --git a/include/depthai/pipeline/node/XLinkOut.hpp b/include/depthai/pipeline/node/XLinkOut.hpp index 7b7f45bf5..22844a1b9 100644 --- a/include/depthai/pipeline/node/XLinkOut.hpp +++ b/include/depthai/pipeline/node/XLinkOut.hpp @@ -19,8 +19,6 @@ class XLinkOut : public Node { public: std::string getName() const override; - std::vector getInputs() const override; - std::vector getOutputs() const override; XLinkOut(const std::shared_ptr& par, int64_t nodeId); diff --git a/src/pipeline/node/ColorCamera.cpp b/src/pipeline/node/ColorCamera.cpp index 8065cf1e4..2d89d51cc 100644 --- a/src/pipeline/node/ColorCamera.cpp +++ b/src/pipeline/node/ColorCamera.cpp @@ -18,18 +18,16 @@ ColorCamera::ColorCamera(const std::shared_ptr& par, int64_t nodeI properties.resolution = ColorCameraProperties::SensorResolution::THE_1080_P; properties.fps = 30.0; properties.previewKeepAspectRatio = true; -} -std::string ColorCamera::getName() const { - return "ColorCamera"; -} + firstInput = &inputConfig; + lastInput = &inputControl; -std::vector ColorCamera::getOutputs() const { - return {raw, isp, video, preview, still}; + firstOutput = &video; + lastOutput = &raw; } -std::vector ColorCamera::getInputs() const { - return {inputConfig, inputControl}; +std::string ColorCamera::getName() const { + return "ColorCamera"; } nlohmann::json ColorCamera::getProperties() { diff --git a/src/pipeline/node/DetectionNetwork.cpp b/src/pipeline/node/DetectionNetwork.cpp index ceb9e5b7e..6040a0684 100644 --- a/src/pipeline/node/DetectionNetwork.cpp +++ b/src/pipeline/node/DetectionNetwork.cpp @@ -11,18 +11,16 @@ namespace node { //-------------------------------------------------------------------- // Base Detection Network Class //-------------------------------------------------------------------- -DetectionNetwork::DetectionNetwork(const std::shared_ptr& par, int64_t nodeId) : NeuralNetwork(par, nodeId) {} +DetectionNetwork::DetectionNetwork(const std::shared_ptr& par, int64_t nodeId) : NeuralNetwork(par, nodeId) { + firstInput = &input; + lastInput = &input; -std::string DetectionNetwork::getName() const { - return "DetectionNetwork"; -} - -std::vector DetectionNetwork::getInputs() const { - return {input}; + firstOutput = &out; + lastOutput = &passthrough; } -std::vector DetectionNetwork::getOutputs() const { - return {out, passthrough}; +std::string DetectionNetwork::getName() const { + return "DetectionNetwork"; } DetectionNetwork::Properties& DetectionNetwork::getPropertiesRef() { diff --git a/src/pipeline/node/IMU.cpp b/src/pipeline/node/IMU.cpp index b5b9f86b8..7bf3a3666 100644 --- a/src/pipeline/node/IMU.cpp +++ b/src/pipeline/node/IMU.cpp @@ -5,20 +5,15 @@ namespace dai { namespace node { -IMU::IMU(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) {} +IMU::IMU(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { + firstOutput = &out; + lastOutput = &out; +} std::string IMU::getName() const { return "IMU"; } -std::vector IMU::getOutputs() const { - return {out}; -} - -std::vector IMU::getInputs() const { - return {}; -} - nlohmann::json IMU::getProperties() { nlohmann::json j; nlohmann::to_json(j, properties); diff --git a/src/pipeline/node/ImageManip.cpp b/src/pipeline/node/ImageManip.cpp index 5b67bfd65..c5d426a17 100644 --- a/src/pipeline/node/ImageManip.cpp +++ b/src/pipeline/node/ImageManip.cpp @@ -3,18 +3,16 @@ namespace dai { namespace node { ImageManip::ImageManip(const std::shared_ptr& par, int64_t nodeId) - : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) {} + : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) { + firstInput = &inputConfig; + lastInput = &inputImage; -std::string ImageManip::getName() const { - return "ImageManip"; -} - -std::vector ImageManip::getInputs() const { - return {inputConfig, inputImage}; + firstOutput = &out; + lastOutput = &out; } -std::vector ImageManip::getOutputs() const { - return {out}; +std::string ImageManip::getName() const { + return "ImageManip"; } nlohmann::json ImageManip::getProperties() { diff --git a/src/pipeline/node/MonoCamera.cpp b/src/pipeline/node/MonoCamera.cpp index a701622ad..858578270 100644 --- a/src/pipeline/node/MonoCamera.cpp +++ b/src/pipeline/node/MonoCamera.cpp @@ -10,18 +10,16 @@ MonoCamera::MonoCamera(const std::shared_ptr& par, int64_t nodeId) properties.boardSocket = CameraBoardSocket::AUTO; properties.resolution = MonoCameraProperties::SensorResolution::THE_720_P; properties.fps = 30.0; -} -std::string MonoCamera::getName() const { - return "MonoCamera"; -} + firstInput = &inputControl; + lastInput = &inputControl; -std::vector MonoCamera::getOutputs() const { - return {out, raw}; + firstOutput = &out; + lastOutput = &raw; } -std::vector MonoCamera::getInputs() const { - return {inputControl}; +std::string MonoCamera::getName() const { + return "MonoCamera"; } nlohmann::json MonoCamera::getProperties() { diff --git a/src/pipeline/node/MyProducer.cpp b/src/pipeline/node/MyProducer.cpp index a8bb56a4b..37e0ed230 100644 --- a/src/pipeline/node/MyProducer.cpp +++ b/src/pipeline/node/MyProducer.cpp @@ -3,20 +3,15 @@ namespace dai { namespace node { -MyProducer::MyProducer(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) {} +MyProducer::MyProducer(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { + firstOutput = &out; + lastOutput = &out; +} std::string MyProducer::getName() const { return "MyProducer"; } -std::vector MyProducer::getInputs() const { - return {}; -} - -std::vector MyProducer::getOutputs() const { - return {out}; -} - nlohmann::json MyProducer::getProperties() { nlohmann::json j; nlohmann::to_json(j, properties); diff --git a/src/pipeline/node/NeuralNetwork.cpp b/src/pipeline/node/NeuralNetwork.cpp index eeb47abc5..7d316d0d7 100644 --- a/src/pipeline/node/NeuralNetwork.cpp +++ b/src/pipeline/node/NeuralNetwork.cpp @@ -6,18 +6,16 @@ namespace dai { namespace node { -NeuralNetwork::NeuralNetwork(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) {} +NeuralNetwork::NeuralNetwork(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { + firstInput = &input; + lastInput = &input; -std::string NeuralNetwork::getName() const { - return "NeuralNetwork"; -} - -std::vector NeuralNetwork::getOutputs() const { - return {out, passthrough}; + firstOutput = &out; + lastOutput = &passthrough; } -std::vector NeuralNetwork::getInputs() const { - return {input}; +std::string NeuralNetwork::getName() const { + return "NeuralNetwork"; } NeuralNetwork::Properties& NeuralNetwork::getPropertiesRef() { diff --git a/src/pipeline/node/ObjectTracker.cpp b/src/pipeline/node/ObjectTracker.cpp index 3266303a8..47c8e59d8 100644 --- a/src/pipeline/node/ObjectTracker.cpp +++ b/src/pipeline/node/ObjectTracker.cpp @@ -5,18 +5,16 @@ namespace dai { namespace node { -ObjectTracker::ObjectTracker(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) {} +ObjectTracker::ObjectTracker(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { + firstInput = &inputTrackerFrame; + lastInput = &inputDetections; -std::string ObjectTracker::getName() const { - return "ObjectTracker"; -} - -std::vector ObjectTracker::getOutputs() const { - return {out, passthroughTrackerFrame, passthroughDetectionFrame, passthroughDetections}; + firstOutput = &out; + lastOutput = &passthroughDetections; } -std::vector ObjectTracker::getInputs() const { - return {inputTrackerFrame, inputDetectionFrame, inputDetections}; +std::string ObjectTracker::getName() const { + return "ObjectTracker"; } nlohmann::json ObjectTracker::getProperties() { diff --git a/src/pipeline/node/SpatialDetectionNetwork.cpp b/src/pipeline/node/SpatialDetectionNetwork.cpp index fa0281a49..8174b02db 100644 --- a/src/pipeline/node/SpatialDetectionNetwork.cpp +++ b/src/pipeline/node/SpatialDetectionNetwork.cpp @@ -11,7 +11,13 @@ namespace node { //-------------------------------------------------------------------- // Base Detection Network Class //-------------------------------------------------------------------- -SpatialDetectionNetwork::SpatialDetectionNetwork(const std::shared_ptr& par, int64_t nodeId) : DetectionNetwork(par, nodeId) {} +SpatialDetectionNetwork::SpatialDetectionNetwork(const std::shared_ptr& par, int64_t nodeId) : DetectionNetwork(par, nodeId) { + firstInput = &input; + lastInput = &inputDepth; + + firstOutput = &out; + lastOutput = &passthroughDepth; +} std::shared_ptr SpatialDetectionNetwork::clone() { return std::make_shared::type>(*this); @@ -21,14 +27,6 @@ std::string SpatialDetectionNetwork::getName() const { return "SpatialDetectionNetwork"; } -std::vector SpatialDetectionNetwork::getInputs() const { - return {input, inputDepth}; -} - -std::vector SpatialDetectionNetwork::getOutputs() const { - return {out, boundingBoxMapping, passthrough, passthroughDepth}; -} - SpatialDetectionNetwork::Properties& SpatialDetectionNetwork::getPropertiesRef() { return properties; } diff --git a/src/pipeline/node/SpatialLocationCalculator.cpp b/src/pipeline/node/SpatialLocationCalculator.cpp index cc5cd8c20..59638b2f9 100644 --- a/src/pipeline/node/SpatialLocationCalculator.cpp +++ b/src/pipeline/node/SpatialLocationCalculator.cpp @@ -6,18 +6,16 @@ namespace dai { namespace node { SpatialLocationCalculator::SpatialLocationCalculator(const std::shared_ptr& par, int64_t nodeId) - : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) {} + : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) { + firstInput = &inputConfig; + lastInput = &inputDepth; -std::string SpatialLocationCalculator::getName() const { - return "SpatialLocationCalculator"; -} - -std::vector SpatialLocationCalculator::getOutputs() const { - return {out, passthroughDepth}; + firstOutput = &out; + lastOutput = &passthroughDepth; } -std::vector SpatialLocationCalculator::getInputs() const { - return {inputConfig, inputDepth}; +std::string SpatialLocationCalculator::getName() const { + return "SpatialLocationCalculator"; } nlohmann::json SpatialLocationCalculator::getProperties() { diff --git a/src/pipeline/node/StereoDepth.cpp b/src/pipeline/node/StereoDepth.cpp index c7f14bece..7b6eb2802 100644 --- a/src/pipeline/node/StereoDepth.cpp +++ b/src/pipeline/node/StereoDepth.cpp @@ -11,20 +11,17 @@ namespace node { StereoDepth::StereoDepth(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) { // 'properties' defaults already set + firstInput = &left; + lastInput = &right; + + firstOutput = &depth; + lastOutput = &rectifiedRight; } std::string StereoDepth::getName() const { return "StereoDepth"; } -std::vector StereoDepth::getOutputs() const { - return {disparity, depth, syncedLeft, syncedRight, rectifiedLeft, rectifiedRight}; -} - -std::vector StereoDepth::getInputs() const { - return {inputConfig, left, right}; -} - nlohmann::json StereoDepth::getProperties() { nlohmann::json j; properties.initialConfig = *rawConfig; diff --git a/src/pipeline/node/SystemLogger.cpp b/src/pipeline/node/SystemLogger.cpp index 92ba15504..417f69e4d 100644 --- a/src/pipeline/node/SystemLogger.cpp +++ b/src/pipeline/node/SystemLogger.cpp @@ -5,20 +5,15 @@ namespace node { SystemLogger::SystemLogger(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { properties.rateHz = 1.0f; + + firstOutput = &out; + lastOutput = &out; } std::string SystemLogger::getName() const { return "SystemLogger"; } -std::vector SystemLogger::getInputs() const { - return {}; -} - -std::vector SystemLogger::getOutputs() const { - return {out}; -} - nlohmann::json SystemLogger::getProperties() { nlohmann::json j; nlohmann::to_json(j, properties); diff --git a/src/pipeline/node/VideoEncoder.cpp b/src/pipeline/node/VideoEncoder.cpp index 26dcd889a..22be6dea6 100644 --- a/src/pipeline/node/VideoEncoder.cpp +++ b/src/pipeline/node/VideoEncoder.cpp @@ -3,18 +3,16 @@ namespace dai { namespace node { -VideoEncoder::VideoEncoder(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) {} +VideoEncoder::VideoEncoder(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { + firstInput = &input; + lastInput = &input; -std::string VideoEncoder::getName() const { - return "VideoEncoder"; -} - -std::vector VideoEncoder::getInputs() const { - return {input}; + firstOutput = &bitstream; + lastOutput = &bitstream; } -std::vector VideoEncoder::getOutputs() const { - return {bitstream}; +std::string VideoEncoder::getName() const { + return "VideoEncoder"; } nlohmann::json VideoEncoder::getProperties() { diff --git a/src/pipeline/node/XLinkIn.cpp b/src/pipeline/node/XLinkIn.cpp index 5dd0138f6..4689982ce 100644 --- a/src/pipeline/node/XLinkIn.cpp +++ b/src/pipeline/node/XLinkIn.cpp @@ -3,20 +3,15 @@ namespace dai { namespace node { -XLinkIn::XLinkIn(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) {} +XLinkIn::XLinkIn(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { + firstOutput = &out; + lastOutput = &out; +} std::string XLinkIn::getName() const { return "XLinkIn"; } -std::vector XLinkIn::getInputs() const { - return {}; -} - -std::vector XLinkIn::getOutputs() const { - return {out}; -} - nlohmann::json XLinkIn::getProperties() { nlohmann::json j; nlohmann::to_json(j, properties); diff --git a/src/pipeline/node/XLinkOut.cpp b/src/pipeline/node/XLinkOut.cpp index 2dcbac30c..be80627f1 100644 --- a/src/pipeline/node/XLinkOut.cpp +++ b/src/pipeline/node/XLinkOut.cpp @@ -5,20 +5,15 @@ namespace node { XLinkOut::XLinkOut(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { properties.maxFpsLimit = -1; + + firstInput = &input; + lastInput = &input; } std::string XLinkOut::getName() const { return "XLinkOut"; } -std::vector XLinkOut::getInputs() const { - return {input}; -} - -std::vector XLinkOut::getOutputs() const { - return {}; -} - nlohmann::json XLinkOut::getProperties() { nlohmann::json j; nlohmann::to_json(j, properties); From ff5d6b1b6edc68eceb572432e593410be6613429 Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Tue, 22 Jun 2021 13:36:59 +0900 Subject: [PATCH 06/15] Fix style --- include/depthai/pipeline/Node.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/depthai/pipeline/Node.hpp b/include/depthai/pipeline/Node.hpp index 458b15adf..fbe84aab2 100644 --- a/include/depthai/pipeline/Node.hpp +++ b/include/depthai/pipeline/Node.hpp @@ -176,7 +176,7 @@ class Node { /// Retrieves all nodes outputs std::vector getOutputs() { std::vector result; - for (auto* x: getOutputRefs()) { + for(auto* x : getOutputRefs()) { result.push_back(*x); } return result; @@ -184,7 +184,7 @@ class Node { /// Retrieves all nodes inputs std::vector getInputs() { std::vector result; - for (auto* x: getInputRefs()) { + for(auto* x : getInputRefs()) { result.push_back(*x); } return result; From aee36a8e3f6e563442fb881e48ca2e87eaeb14ba Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Tue, 29 Jun 2021 16:33:08 +0900 Subject: [PATCH 07/15] Convert from 2 pointers to a vector --- include/depthai/pipeline/Node.hpp | 20 +++++++++---------- include/depthai/pipeline/node/SPIOut.hpp | 3 +-- src/pipeline/node/ColorCamera.cpp | 7 ++----- src/pipeline/node/DetectionNetwork.cpp | 7 ++----- src/pipeline/node/IMU.cpp | 3 +-- src/pipeline/node/ImageManip.cpp | 7 ++----- src/pipeline/node/MonoCamera.cpp | 7 ++----- src/pipeline/node/MyProducer.cpp | 3 +-- src/pipeline/node/NeuralNetwork.cpp | 6 ++---- src/pipeline/node/ObjectTracker.cpp | 7 ++----- src/pipeline/node/SpatialDetectionNetwork.cpp | 7 ++----- .../node/SpatialLocationCalculator.cpp | 7 ++----- src/pipeline/node/StereoDepth.cpp | 7 ++----- src/pipeline/node/SystemLogger.cpp | 3 +-- src/pipeline/node/VideoEncoder.cpp | 7 ++----- src/pipeline/node/XLinkIn.cpp | 3 +-- src/pipeline/node/XLinkOut.cpp | 3 +-- 17 files changed, 36 insertions(+), 71 deletions(-) diff --git a/include/depthai/pipeline/Node.hpp b/include/depthai/pipeline/Node.hpp index fbe84aab2..505a24848 100644 --- a/include/depthai/pipeline/Node.hpp +++ b/include/depthai/pipeline/Node.hpp @@ -38,8 +38,8 @@ class Node { class Input; class Output; - Output *firstOutput = nullptr, *lastOutput = nullptr; - Input *firstInput = nullptr, *lastInput = nullptr; + std::vector outputs; + std::vector inputs; struct DatatypeHierarchy { DatatypeHierarchy(DatatypeEnum d, bool c) : datatype(d), descendants(c) {} @@ -193,20 +193,20 @@ class Node { virtual std::vector> getAssets(); std::vector getOutputRefs() { - if(firstOutput == nullptr) return {}; - return std::vector{firstOutput, lastOutput}; + if(outputs.empty()) return {}; + return outputs; } std::vector getOutputRefs() const { - if(firstOutput == nullptr) return {}; - return std::vector{firstOutput, lastOutput}; + if(outputs.empty()) return {}; + return {outputs.begin(), outputs.end()}; } std::vector getInputRefs() { - if(firstInput == nullptr) return {}; - return std::vector{firstInput, lastInput}; + if(inputs.empty()) return {}; + return inputs; } std::vector getInputRefs() const { - if(firstInput == nullptr) return {}; - return std::vector{firstInput, lastInput}; + if(inputs.empty()) return {}; + return {inputs.begin(), inputs.end()}; } /// Connection between an Input and Output diff --git a/include/depthai/pipeline/node/SPIOut.hpp b/include/depthai/pipeline/node/SPIOut.hpp index 6703a9d65..5baa95359 100644 --- a/include/depthai/pipeline/node/SPIOut.hpp +++ b/include/depthai/pipeline/node/SPIOut.hpp @@ -32,8 +32,7 @@ class SPIOut : public Node { SPIOut(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { properties.busId = 0; - firstInput = &input; - lastInput = &input + 1; + inputs = {&input}; } /** diff --git a/src/pipeline/node/ColorCamera.cpp b/src/pipeline/node/ColorCamera.cpp index 2d89d51cc..f3cf14f96 100644 --- a/src/pipeline/node/ColorCamera.cpp +++ b/src/pipeline/node/ColorCamera.cpp @@ -19,11 +19,8 @@ ColorCamera::ColorCamera(const std::shared_ptr& par, int64_t nodeI properties.fps = 30.0; properties.previewKeepAspectRatio = true; - firstInput = &inputConfig; - lastInput = &inputControl; - - firstOutput = &video; - lastOutput = &raw; + inputs = {&inputConfig, &inputControl}; + outputs = {&video, &preview, &still, &isp, &raw}; } std::string ColorCamera::getName() const { diff --git a/src/pipeline/node/DetectionNetwork.cpp b/src/pipeline/node/DetectionNetwork.cpp index 6040a0684..6a1306675 100644 --- a/src/pipeline/node/DetectionNetwork.cpp +++ b/src/pipeline/node/DetectionNetwork.cpp @@ -12,11 +12,8 @@ namespace node { // Base Detection Network Class //-------------------------------------------------------------------- DetectionNetwork::DetectionNetwork(const std::shared_ptr& par, int64_t nodeId) : NeuralNetwork(par, nodeId) { - firstInput = &input; - lastInput = &input; - - firstOutput = &out; - lastOutput = &passthrough; + inputs = {&input}; + outputs = {&out, &passthrough}; } std::string DetectionNetwork::getName() const { diff --git a/src/pipeline/node/IMU.cpp b/src/pipeline/node/IMU.cpp index 7bf3a3666..befe66dd7 100644 --- a/src/pipeline/node/IMU.cpp +++ b/src/pipeline/node/IMU.cpp @@ -6,8 +6,7 @@ namespace dai { namespace node { IMU::IMU(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { - firstOutput = &out; - lastOutput = &out; + outputs = {&out}; } std::string IMU::getName() const { diff --git a/src/pipeline/node/ImageManip.cpp b/src/pipeline/node/ImageManip.cpp index c5d426a17..bb87e89db 100644 --- a/src/pipeline/node/ImageManip.cpp +++ b/src/pipeline/node/ImageManip.cpp @@ -4,11 +4,8 @@ namespace node { ImageManip::ImageManip(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) { - firstInput = &inputConfig; - lastInput = &inputImage; - - firstOutput = &out; - lastOutput = &out; + inputs = {&inputConfig, &inputImage}; + outputs = {&out}; } std::string ImageManip::getName() const { diff --git a/src/pipeline/node/MonoCamera.cpp b/src/pipeline/node/MonoCamera.cpp index 858578270..b8a92db06 100644 --- a/src/pipeline/node/MonoCamera.cpp +++ b/src/pipeline/node/MonoCamera.cpp @@ -11,11 +11,8 @@ MonoCamera::MonoCamera(const std::shared_ptr& par, int64_t nodeId) properties.resolution = MonoCameraProperties::SensorResolution::THE_720_P; properties.fps = 30.0; - firstInput = &inputControl; - lastInput = &inputControl; - - firstOutput = &out; - lastOutput = &raw; + inputs = {&inputControl}; + outputs = {&out, &raw}; } std::string MonoCamera::getName() const { diff --git a/src/pipeline/node/MyProducer.cpp b/src/pipeline/node/MyProducer.cpp index 37e0ed230..42f248ecb 100644 --- a/src/pipeline/node/MyProducer.cpp +++ b/src/pipeline/node/MyProducer.cpp @@ -4,8 +4,7 @@ namespace dai { namespace node { MyProducer::MyProducer(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { - firstOutput = &out; - lastOutput = &out; + outputs = {&out}; } std::string MyProducer::getName() const { diff --git a/src/pipeline/node/NeuralNetwork.cpp b/src/pipeline/node/NeuralNetwork.cpp index 7d316d0d7..d07063a36 100644 --- a/src/pipeline/node/NeuralNetwork.cpp +++ b/src/pipeline/node/NeuralNetwork.cpp @@ -7,11 +7,9 @@ namespace dai { namespace node { NeuralNetwork::NeuralNetwork(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { - firstInput = &input; - lastInput = &input; + inputs = {&input}; - firstOutput = &out; - lastOutput = &passthrough; + outputs = {&out, &passthrough}; } std::string NeuralNetwork::getName() const { diff --git a/src/pipeline/node/ObjectTracker.cpp b/src/pipeline/node/ObjectTracker.cpp index 47c8e59d8..e37e872b8 100644 --- a/src/pipeline/node/ObjectTracker.cpp +++ b/src/pipeline/node/ObjectTracker.cpp @@ -6,11 +6,8 @@ namespace dai { namespace node { ObjectTracker::ObjectTracker(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { - firstInput = &inputTrackerFrame; - lastInput = &inputDetections; - - firstOutput = &out; - lastOutput = &passthroughDetections; + inputs = {&inputTrackerFrame, &inputDetectionFrame, &inputDetections}; + outputs = {&out, &passthroughTrackerFrame, &passthroughDetectionFrame, &passthroughDetections}; } std::string ObjectTracker::getName() const { diff --git a/src/pipeline/node/SpatialDetectionNetwork.cpp b/src/pipeline/node/SpatialDetectionNetwork.cpp index 8174b02db..8ad188517 100644 --- a/src/pipeline/node/SpatialDetectionNetwork.cpp +++ b/src/pipeline/node/SpatialDetectionNetwork.cpp @@ -12,11 +12,8 @@ namespace node { // Base Detection Network Class //-------------------------------------------------------------------- SpatialDetectionNetwork::SpatialDetectionNetwork(const std::shared_ptr& par, int64_t nodeId) : DetectionNetwork(par, nodeId) { - firstInput = &input; - lastInput = &inputDepth; - - firstOutput = &out; - lastOutput = &passthroughDepth; + inputs = {&input, &inputDepth}; + outputs = {&out, &boundingBoxMapping, &passthrough, &passthroughDepth}; } std::shared_ptr SpatialDetectionNetwork::clone() { diff --git a/src/pipeline/node/SpatialLocationCalculator.cpp b/src/pipeline/node/SpatialLocationCalculator.cpp index 59638b2f9..6b5c044d2 100644 --- a/src/pipeline/node/SpatialLocationCalculator.cpp +++ b/src/pipeline/node/SpatialLocationCalculator.cpp @@ -7,11 +7,8 @@ namespace node { SpatialLocationCalculator::SpatialLocationCalculator(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) { - firstInput = &inputConfig; - lastInput = &inputDepth; - - firstOutput = &out; - lastOutput = &passthroughDepth; + inputs = {&inputConfig, &inputDepth}; + outputs = {&out, &passthroughDepth}; } std::string SpatialLocationCalculator::getName() const { diff --git a/src/pipeline/node/StereoDepth.cpp b/src/pipeline/node/StereoDepth.cpp index 7b6eb2802..aa77c9eb1 100644 --- a/src/pipeline/node/StereoDepth.cpp +++ b/src/pipeline/node/StereoDepth.cpp @@ -11,11 +11,8 @@ namespace node { StereoDepth::StereoDepth(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) { // 'properties' defaults already set - firstInput = &left; - lastInput = &right; - - firstOutput = &depth; - lastOutput = &rectifiedRight; + inputs = {&inputConfig, &left, &right}; + outputs = {&depth, &disparity, &syncedLeft, &syncedRight, &rectifiedLeft, &rectifiedRight}; } std::string StereoDepth::getName() const { diff --git a/src/pipeline/node/SystemLogger.cpp b/src/pipeline/node/SystemLogger.cpp index 417f69e4d..3e459075d 100644 --- a/src/pipeline/node/SystemLogger.cpp +++ b/src/pipeline/node/SystemLogger.cpp @@ -6,8 +6,7 @@ namespace node { SystemLogger::SystemLogger(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { properties.rateHz = 1.0f; - firstOutput = &out; - lastOutput = &out; + outputs = {&out}; } std::string SystemLogger::getName() const { diff --git a/src/pipeline/node/VideoEncoder.cpp b/src/pipeline/node/VideoEncoder.cpp index 22be6dea6..002a63158 100644 --- a/src/pipeline/node/VideoEncoder.cpp +++ b/src/pipeline/node/VideoEncoder.cpp @@ -4,11 +4,8 @@ namespace dai { namespace node { VideoEncoder::VideoEncoder(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { - firstInput = &input; - lastInput = &input; - - firstOutput = &bitstream; - lastOutput = &bitstream; + inputs = {&input}; + outputs = {&bitstream}; } std::string VideoEncoder::getName() const { diff --git a/src/pipeline/node/XLinkIn.cpp b/src/pipeline/node/XLinkIn.cpp index 4689982ce..ae10c79af 100644 --- a/src/pipeline/node/XLinkIn.cpp +++ b/src/pipeline/node/XLinkIn.cpp @@ -4,8 +4,7 @@ namespace dai { namespace node { XLinkIn::XLinkIn(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { - firstOutput = &out; - lastOutput = &out; + outputs = {&out}; } std::string XLinkIn::getName() const { diff --git a/src/pipeline/node/XLinkOut.cpp b/src/pipeline/node/XLinkOut.cpp index be80627f1..b74abca93 100644 --- a/src/pipeline/node/XLinkOut.cpp +++ b/src/pipeline/node/XLinkOut.cpp @@ -6,8 +6,7 @@ namespace node { XLinkOut::XLinkOut(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId) { properties.maxFpsLimit = -1; - firstInput = &input; - lastInput = &input; + inputs = {&input}; } std::string XLinkOut::getName() const { From d7da6378efa3ac88549edd0dc659162bd6e8b9ff Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Tue, 29 Jun 2021 16:41:41 +0900 Subject: [PATCH 08/15] Add the EdgeDetector for the CI --- include/depthai/pipeline/node/EdgeDetector.hpp | 2 -- src/pipeline/node/EdgeDetector.cpp | 13 ++++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/include/depthai/pipeline/node/EdgeDetector.hpp b/include/depthai/pipeline/node/EdgeDetector.hpp index 1ebffb331..b3aec25cc 100644 --- a/include/depthai/pipeline/node/EdgeDetector.hpp +++ b/include/depthai/pipeline/node/EdgeDetector.hpp @@ -22,8 +22,6 @@ class EdgeDetector : public Node { private: std::string getName() const override; - std::vector getInputs() override; - std::vector getOutputs() override; nlohmann::json getProperties() override; std::shared_ptr clone() override; diff --git a/src/pipeline/node/EdgeDetector.cpp b/src/pipeline/node/EdgeDetector.cpp index c8e45c770..6025bd66f 100644 --- a/src/pipeline/node/EdgeDetector.cpp +++ b/src/pipeline/node/EdgeDetector.cpp @@ -6,20 +6,15 @@ namespace dai { namespace node { EdgeDetector::EdgeDetector(const std::shared_ptr& par, int64_t nodeId) - : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) {} + : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) { + inputs = {&inputConfig, &inputImage}; + outputs = {&outputImage}; + } std::string EdgeDetector::getName() const { return "EdgeDetector"; } -std::vector EdgeDetector::getOutputs() { - return {outputImage}; -} - -std::vector EdgeDetector::getInputs() { - return {inputConfig, inputImage}; -} - nlohmann::json EdgeDetector::getProperties() { nlohmann::json j; properties.initialConfig = *rawConfig; From 36e72fe1473f96a277772a3ec62a19fa1996dc08 Mon Sep 17 00:00:00 2001 From: Kunal Tyagi Date: Tue, 29 Jun 2021 19:22:40 +0900 Subject: [PATCH 09/15] Fix style --- src/pipeline/node/EdgeDetector.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pipeline/node/EdgeDetector.cpp b/src/pipeline/node/EdgeDetector.cpp index 6025bd66f..2c5c1a7c7 100644 --- a/src/pipeline/node/EdgeDetector.cpp +++ b/src/pipeline/node/EdgeDetector.cpp @@ -7,9 +7,9 @@ namespace node { EdgeDetector::EdgeDetector(const std::shared_ptr& par, int64_t nodeId) : Node(par, nodeId), rawConfig(std::make_shared()), initialConfig(rawConfig) { - inputs = {&inputConfig, &inputImage}; - outputs = {&outputImage}; - } + inputs = {&inputConfig, &inputImage}; + outputs = {&outputImage}; +} std::string EdgeDetector::getName() const { return "EdgeDetector"; From 514941631ea59923707f2143a0ea475100d2a904 Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Wed, 14 Jul 2021 14:26:29 +0200 Subject: [PATCH 10/15] Close queues when closing the device --- include/depthai/device/DataQueue.hpp | 20 ++++++++++++++++++++ src/device/DataQueue.cpp | 18 ++++++++++++++++++ src/device/Device.cpp | 4 +++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/include/depthai/device/DataQueue.hpp b/include/depthai/device/DataQueue.hpp index ba65436f5..71615bf02 100644 --- a/include/depthai/device/DataQueue.hpp +++ b/include/depthai/device/DataQueue.hpp @@ -40,6 +40,16 @@ class DataOutputQueue { DataOutputQueue(const std::shared_ptr& conn, const std::string& streamName, unsigned int maxSize = 16, bool blocking = true); ~DataOutputQueue(); + /** + * Check whether queue is closed + */ + bool isClosed() const; + + /** + * Closes the queue and underlying thread + */ + void close(); + /** * Sets queue behavior when full (maxSize) * @@ -339,6 +349,16 @@ class DataInputQueue { DataInputQueue(const std::shared_ptr& conn, const std::string& streamName, unsigned int maxSize = 16, bool blocking = true); ~DataInputQueue(); + /** + * Check whether queue is closed + */ + bool isClosed() const; + + /** + * Closes the queue and underlying thread + */ + void close(); + /** * Sets maximum message size. If message is larger than specified, then an exception is issued. * diff --git a/src/device/DataQueue.cpp b/src/device/DataQueue.cpp index 6eb4a92cd..4d7009aad 100644 --- a/src/device/DataQueue.cpp +++ b/src/device/DataQueue.cpp @@ -80,6 +80,15 @@ DataOutputQueue::DataOutputQueue(const std::shared_ptr& conn, c }); } +bool DataOutputQueue::isClosed() const { + return running; +} + +void DataOutputQueue::close() { + running = false; + queue.destruct(); +} + DataOutputQueue::~DataOutputQueue() { spdlog::debug("DataOutputQueue ({}) about to be destructed...", name); // Set reading thread to stop @@ -198,6 +207,15 @@ DataInputQueue::DataInputQueue(const std::shared_ptr& conn, con }); } +bool DataInputQueue::isClosed() const { + return running; +} + +void DataInputQueue::close() { + running = false; + queue.destruct(); +} + DataInputQueue::~DataInputQueue() { spdlog::debug("DataInputQueue ({}) about to be destructed...", name); // Set writing thread to stop diff --git a/src/device/Device.cpp b/src/device/Device.cpp index cb6d428ad..ac55fe855 100644 --- a/src/device/Device.cpp +++ b/src/device/Device.cpp @@ -339,7 +339,9 @@ void Device::close() { connection->close(); connection = nullptr; - // Clear queues + // Close and clear queues + for(auto& kv : outputQueueMap) kv.second->close(); + for(auto& kv : inputQueueMap) kv.second->close(); outputQueueMap.clear(); inputQueueMap.clear(); From db8ce0770425abbf5a82282df3b2a68bfe045abf Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Wed, 14 Jul 2021 17:10:46 +0200 Subject: [PATCH 11/15] Closing the data queue joins the underlying thread --- src/device/DataQueue.cpp | 49 ++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/src/device/DataQueue.cpp b/src/device/DataQueue.cpp index 4d7009aad..58d54496f 100644 --- a/src/device/DataQueue.cpp +++ b/src/device/DataQueue.cpp @@ -75,8 +75,9 @@ DataOutputQueue::DataOutputQueue(const std::shared_ptr& conn, c exceptionMessage = fmt::format("Communication exception - possible device error/misconfiguration. Original message '{}'", ex.what()); } - queue.destruct(); + // Close the queue running = false; + queue.destruct(); }); } @@ -85,21 +86,25 @@ bool DataOutputQueue::isClosed() const { } void DataOutputQueue::close() { - running = false; + // Set reading thread to stop and allow to be closed only once + if(!running.exchange(false)) return; + + // Destroy queue queue.destruct(); + + // Then join thread + if(readingThread.joinable()) readingThread.join(); + + // Log + spdlog::debug("DataOutputQueue ({}) closed", name); } DataOutputQueue::~DataOutputQueue() { - spdlog::debug("DataOutputQueue ({}) about to be destructed...", name); - // Set reading thread to stop - running = false; - - // Destroy queue - queue.destruct(); + // Close the queue first + close(); - // join thread + // Then join thread if(readingThread.joinable()) readingThread.join(); - spdlog::debug("DataOutputQueue ({}) destructed", name); } void DataOutputQueue::setBlocking(bool blocking) { @@ -202,8 +207,9 @@ DataInputQueue::DataInputQueue(const std::shared_ptr& conn, con exceptionMessage = fmt::format("Communication exception - possible device error/misconfiguration. Original message '{}'", ex.what()); } - queue.destruct(); + // Close the queue running = false; + queue.destruct(); }); } @@ -212,20 +218,25 @@ bool DataInputQueue::isClosed() const { } void DataInputQueue::close() { - running = false; + // Set reading thread to stop and allow to be closed only once + if(!running.exchange(false)) return; + + // Destroy queue queue.destruct(); + + // Then join thread + if(writingThread.joinable()) writingThread.join(); + + // Log + spdlog::debug("DataInputQueue ({}) closed", name); } DataInputQueue::~DataInputQueue() { - spdlog::debug("DataInputQueue ({}) about to be destructed...", name); - // Set writing thread to stop - running = false; - - // Destroy queue - queue.destruct(); + // Close the queue + close(); + // Then join thread if(writingThread.joinable()) writingThread.join(); - spdlog::debug("DataInputQueue ({}) destructed", name); } void DataInputQueue::setBlocking(bool blocking) { From 1eafe370cf96b9eb693114c05d52322f30112c16 Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Wed, 14 Jul 2021 18:33:17 +0200 Subject: [PATCH 12/15] Fixed DataQueue isClosed logic --- include/depthai/device/DataQueue.hpp | 4 ++-- src/device/DataQueue.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/depthai/device/DataQueue.hpp b/include/depthai/device/DataQueue.hpp index 71615bf02..847085f5f 100644 --- a/include/depthai/device/DataQueue.hpp +++ b/include/depthai/device/DataQueue.hpp @@ -46,7 +46,7 @@ class DataOutputQueue { bool isClosed() const; /** - * Closes the queue and underlying thread + * Closes the queue and the underlying thread */ void close(); @@ -355,7 +355,7 @@ class DataInputQueue { bool isClosed() const; /** - * Closes the queue and underlying thread + * Closes the queue and the underlying thread */ void close(); diff --git a/src/device/DataQueue.cpp b/src/device/DataQueue.cpp index 58d54496f..9ee802213 100644 --- a/src/device/DataQueue.cpp +++ b/src/device/DataQueue.cpp @@ -82,7 +82,7 @@ DataOutputQueue::DataOutputQueue(const std::shared_ptr& conn, c } bool DataOutputQueue::isClosed() const { - return running; + return !running; } void DataOutputQueue::close() { @@ -214,7 +214,7 @@ DataInputQueue::DataInputQueue(const std::shared_ptr& conn, con } bool DataInputQueue::isClosed() const { - return running; + return !running; } void DataInputQueue::close() { From 6ae815c044fbf76be62ebdfacb7eceea4a5bda8b Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Fri, 16 Jul 2021 09:46:44 +0300 Subject: [PATCH 13/15] Hotfix: fix NN memory allocation regression --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index eb52990f3..138c4ff8a 100644 --- a/cmake/Depthai/DepthaiDeviceSideConfig.cmake +++ b/cmake/Depthai/DepthaiDeviceSideConfig.cmake @@ -2,7 +2,7 @@ set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot") # "full commit hash of device side binary" -set(DEPTHAI_DEVICE_SIDE_COMMIT "04b3c29581c258502fb50540f3954bd49aac7f90") +set(DEPTHAI_DEVICE_SIDE_COMMIT "c02b60f1b735fedef3b52b838e5b3c65affd6c61") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From 92b3830bc3539060bd91479e711d2d709336011b Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Sun, 18 Jul 2021 00:03:04 +0300 Subject: [PATCH 14/15] Update FW with SDK update --- cmake/Depthai/DepthaiDeviceSideConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Depthai/DepthaiDeviceSideConfig.cmake b/cmake/Depthai/DepthaiDeviceSideConfig.cmake index 7275b318a..abff3259e 100644 --- a/cmake/Depthai/DepthaiDeviceSideConfig.cmake +++ b/cmake/Depthai/DepthaiDeviceSideConfig.cmake @@ -2,7 +2,7 @@ set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot") # "full commit hash of device side binary" -set(DEPTHAI_DEVICE_SIDE_COMMIT "eb69fc0283cf82608e6eccf6f37b1709a2db8b5b") +set(DEPTHAI_DEVICE_SIDE_COMMIT "673983dd2b693f267cb3cb11a4247ec4a38a6508") # "version if applicable" set(DEPTHAI_DEVICE_SIDE_VERSION "") From b4f28511ef6f56ca0f7233d20311bc2b960e8f26 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Mon, 19 Jul 2021 06:54:58 +0300 Subject: [PATCH 15/15] Bump version to 2.7.2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9cca33e5..ba616b837 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ if(WIN32) endif() # Create depthai project -project(depthai VERSION "2.7.1" LANGUAGES CXX C) +project(depthai VERSION "2.7.2" LANGUAGES CXX C) get_directory_property(has_parent PARENT_DIRECTORY) if(has_parent) set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)