Skip to content

Commit

Permalink
Merge pull request #314 from luxonis/develop
Browse files Browse the repository at this point in the history
Release v2.7.2.0
  • Loading branch information
SzabolcsGergely authored Jul 19, 2021
2 parents 4a36b56 + 4d82a4b commit 0cf02f6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
2 changes: 1 addition & 1 deletion depthai-core
Submodule depthai-core updated 41 files
+1 −1 CMakeLists.txt
+1 −1 cmake/Depthai/DepthaiDeviceSideConfig.cmake
+20 −0 include/depthai/device/DataQueue.hpp
+60 −11 include/depthai/pipeline/Node.hpp
+4 −6 include/depthai/pipeline/node/ColorCamera.hpp
+3 −4 include/depthai/pipeline/node/DetectionNetwork.hpp
+0 −2 include/depthai/pipeline/node/EdgeDetector.hpp
+2 −3 include/depthai/pipeline/node/IMU.hpp
+3 −5 include/depthai/pipeline/node/ImageManip.hpp
+2 −3 include/depthai/pipeline/node/MonoCamera.hpp
+2 −3 include/depthai/pipeline/node/MyProducer.hpp
+0 −2 include/depthai/pipeline/node/NeuralNetwork.hpp
+2 −3 include/depthai/pipeline/node/ObjectTracker.hpp
+6 −12 include/depthai/pipeline/node/SPIOut.hpp
+2 −3 include/depthai/pipeline/node/SpatialDetectionNetwork.hpp
+2 −3 include/depthai/pipeline/node/SpatialLocationCalculator.hpp
+2 −3 include/depthai/pipeline/node/StereoDepth.hpp
+2 −3 include/depthai/pipeline/node/SystemLogger.hpp
+2 −3 include/depthai/pipeline/node/VideoEncoder.hpp
+2 −3 include/depthai/pipeline/node/XLinkIn.hpp
+2 −3 include/depthai/pipeline/node/XLinkOut.hpp
+42 −13 src/device/DataQueue.cpp
+3 −1 src/device/Device.cpp
+2 −2 src/pipeline/Node.cpp
+10 −10 src/pipeline/Pipeline.cpp
+3 −8 src/pipeline/node/ColorCamera.cpp
+4 −9 src/pipeline/node/DetectionNetwork.cpp
+4 −9 src/pipeline/node/EdgeDetector.cpp
+3 −9 src/pipeline/node/IMU.cpp
+4 −9 src/pipeline/node/ImageManip.cpp
+3 −8 src/pipeline/node/MonoCamera.cpp
+3 −9 src/pipeline/node/MyProducer.cpp
+5 −9 src/pipeline/node/NeuralNetwork.cpp
+4 −9 src/pipeline/node/ObjectTracker.cpp
+4 −9 src/pipeline/node/SpatialDetectionNetwork.cpp
+4 −9 src/pipeline/node/SpatialLocationCalculator.cpp
+2 −8 src/pipeline/node/StereoDepth.cpp
+2 −8 src/pipeline/node/SystemLogger.cpp
+4 −9 src/pipeline/node/VideoEncoder.cpp
+3 −9 src/pipeline/node/XLinkIn.cpp
+2 −8 src/pipeline/node/XLinkOut.cpp
4 changes: 4 additions & 0 deletions src/DataQueueBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ void DataQueueBindings::bind(pybind11::module& m){
};
py::class_<DataOutputQueue, std::shared_ptr<DataOutputQueue>>(m, "DataOutputQueue", DOC(dai, DataOutputQueue))
.def("getName", &DataOutputQueue::getName, DOC(dai, DataOutputQueue, getName))
.def("isClosed", &DataOutputQueue::isClosed, DOC(dai, DataOutputQueue, isClosed))
.def("close", &DataOutputQueue::close, DOC(dai, DataOutputQueue, close))

.def("addCallback", addCallbackLambda, py::arg("callback"), DOC(dai, DataOutputQueue, addCallback))
.def("addCallback", addCallbackLambda, py::arg("callback"), DOC(dai, DataOutputQueue, addCallback, 2))
Expand Down Expand Up @@ -92,6 +94,8 @@ void DataQueueBindings::bind(pybind11::module& m){

// Bind DataInputQueue
py::class_<DataInputQueue, std::shared_ptr<DataInputQueue>>(m, "DataInputQueue", DOC(dai, DataInputQueue))
.def("isClosed", &DataInputQueue::isClosed, DOC(dai, DataInputQueue, isClosed))
.def("close", &DataInputQueue::close, DOC(dai, DataInputQueue, close))
.def("getName", &DataInputQueue::getName, DOC(dai, DataInputQueue, getName))
.def("setBlocking", &DataInputQueue::setBlocking, py::arg("blocking"), DOC(dai, DataInputQueue, setBlocking))
.def("getBlocking", &DataInputQueue::getBlocking, DOC(dai, DataInputQueue, getBlocking))
Expand Down
41 changes: 32 additions & 9 deletions src/pipeline/NodeBindings.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "NodeBindings.hpp"

#include "depthai/pipeline/Node.hpp"
#include "depthai/pipeline/Pipeline.hpp"
#include "depthai/pipeline/node/XLinkIn.hpp"
#include "depthai/pipeline/node/XLinkOut.hpp"
#include "depthai/pipeline/node/ColorCamera.hpp"
Expand Down Expand Up @@ -29,23 +30,30 @@ void NodeBindings::bind(pybind11::module& m){

// Base 'Node' class binding
py::class_<Node, std::shared_ptr<Node>> pyNode(m, "Node", DOC(dai, Node));
pyNode
.def_readonly("id", &Node::id, DOC(dai, Node, id))
.def("getName", &Node::getName, DOC(dai, Node, getName))
.def("getOutputs", &Node::getOutputs, DOC(dai, Node, getOutputs))
.def("getInputs", &Node::getInputs, DOC(dai, Node, getInputs))
.def("getAssets", &Node::getAssets, DOC(dai, Node, getAssets))
;


// Node::Input bindings
py::class_<Node::Input>(pyNode, "Input", DOC(dai, Node, Input))
py::class_<Node::Input> pyInput(pyNode, "Input", DOC(dai, Node, Input));
py::enum_<Node::Input::Type>(pyInput, "Type")
.value("SReceiver", Node::Input::Type::SReceiver)
.value("MReceiver", Node::Input::Type::MReceiver)
;
pyInput
.def_property_readonly("name", [](const Node::Input& input){ return input.name; })
.def_property_readonly("type", [](const Node::Input& input){ return input.type; })
.def("setBlocking", &Node::Input::setBlocking, py::arg("blocking"), DOC(dai, Node, Input, setBlocking))
.def("getBlocking", &Node::Input::getBlocking, DOC(dai, Node, Input, getBlocking))
.def("setQueueSize", &Node::Input::setQueueSize, py::arg("size"), DOC(dai, Node, Input, setQueueSize))
.def("getQueueSize", &Node::Input::getQueueSize, DOC(dai, Node, Input, getQueueSize))
;

// Node::Output bindings
py::class_<Node::Output>(pyNode, "Output", DOC(dai, Node, Output))
py::class_<Node::Output> pyOutput(pyNode, "Output", DOC(dai, Node, Output));
py::enum_<Node::Output::Type>(pyOutput, "Type")
.value("MSender", Node::Output::Type::MSender)
.value("SSender", Node::Output::Type::SSender)
;
pyOutput
.def("canConnect", &Node::Output::canConnect, py::arg("in"), DOC(dai, Node, Output, canConnect))
.def("link", &Node::Output::link, py::arg("in"), DOC(dai, Node, Output, link))
.def("unlink", &Node::Output::unlink, py::arg("in"), DOC(dai, Node, Output, unlink))
Expand All @@ -61,6 +69,21 @@ void NodeBindings::bind(pybind11::module& m){
.def_property("inputId", [](Node::Connection& conn) { return conn.inputId; }, [](Node::Connection& conn, Node::Id id) {conn.inputId = id; }, DOC(dai, Node, Connection, inputId))
.def_property("inputName", [](Node::Connection& conn) { return conn.inputName; }, [](Node::Connection& conn, std::string name) {conn.inputName = name; }, DOC(dai, Node, Connection, inputName))
;

pyNode
.def_readonly("id", &Node::id, DOC(dai, Node, id))
.def("getName", &Node::getName, DOC(dai, Node, getName))
.def("getOutputs", &Node::getOutputs, DOC(dai, Node, getOutputs))
.def("getInputs", &Node::getInputs, DOC(dai, Node, getInputs))
.def("getAssets", &Node::getAssets, DOC(dai, Node, getAssets))
.def("getOutputRefs", static_cast<std::vector< Node::Output*> (Node::*)()>(&Node::getOutputRefs), DOC(dai, Node, getOutputRefs), py::return_value_policy::reference_internal)
.def("getInputRefs", static_cast<std::vector<Node::Input*> (Node::*)()>(&Node::getInputRefs), DOC(dai, Node, getInputRefs), py::return_value_policy::reference_internal)
.def("getOutputRefs", static_cast<std::vector<const Node::Output*> (Node::*)() const>(&Node::getOutputRefs), DOC(dai, Node, getOutputRefs), py::return_value_policy::reference_internal)
.def("getInputRefs", static_cast<std::vector<const Node::Input*> (Node::*)() const>(&Node::getInputRefs), DOC(dai, Node, getInputRefs), py::return_value_policy::reference_internal)
.def("getParentPipeline", py::overload_cast<>(&Node::getParentPipeline), DOC(dai, Node, getParentPipeline))
.def("getParentPipeline", py::overload_cast<>(&Node::getParentPipeline, py::const_), DOC(dai, Node, getParentPipeline))
;

// MSVC errors out with:
// Error C2326 'void NodeBindings::bind(pybind11::module &)': function cannot access 'dai::Node::Connection::outputId'
// ...
Expand Down

0 comments on commit 0cf02f6

Please sign in to comment.