Skip to content

Commit

Permalink
[RVC2] Added getStereoPairs and getAvailableStereoPairs API (#959)
Browse files Browse the repository at this point in the history
* Added bindings for getStereoPairs

* Available stereo pairs bindings.

* Bump core.

* Update core with merged get_stereo_pairs
  • Loading branch information
zrezke authored Jan 24, 2024
1 parent 4802dfa commit 72b0b72
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/DeviceBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ void DeviceBindings::bind(pybind11::module& m, void* pCallstack){
.def("getConnectionInterfaces", [](DeviceBase& d) { py::gil_scoped_release release; return d.getConnectionInterfaces(); }, DOC(dai, DeviceBase, getConnectionInterfaces))
.def("getConnectedCameraFeatures", [](DeviceBase& d) { py::gil_scoped_release release; return d.getConnectedCameraFeatures(); }, DOC(dai, DeviceBase, getConnectedCameraFeatures))
.def("getCameraSensorNames", [](DeviceBase& d) { py::gil_scoped_release release; return d.getCameraSensorNames(); }, DOC(dai, DeviceBase, getCameraSensorNames))
.def("getStereoPairs", [](DeviceBase& d) { py::gil_scoped_release release; return d.getStereoPairs(); }, DOC(dai, DeviceBase, getStereoPairs))
.def("getAvailableStereoPairs", [](DeviceBase& d) { py::gil_scoped_release release; return d.getAvailableStereoPairs(); }, DOC(dai, DeviceBase, getAvailableStereoPairs))
.def("getConnectedIMU", [](DeviceBase& d) { py::gil_scoped_release release; return d.getConnectedIMU(); }, DOC(dai, DeviceBase, getConnectedIMU))
.def("getIMUFirmwareVersion", [](DeviceBase& d) { py::gil_scoped_release release; return d.getIMUFirmwareVersion(); }, DOC(dai, DeviceBase, getIMUFirmwareVersion))
.def("getEmbeddedIMUFirmwareVersion", [](DeviceBase& d) { py::gil_scoped_release release; return d.getEmbeddedIMUFirmwareVersion(); }, DOC(dai, DeviceBase, getEmbeddedIMUFirmwareVersion))
Expand Down
16 changes: 16 additions & 0 deletions src/pipeline/CommonBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
#include "depthai-shared/common/DetectionParserOptions.hpp"
#include "depthai-shared/common/RotatedRect.hpp"
#include "depthai-shared/common/Rect.hpp"
#include "depthai-shared/common/StereoPair.hpp"
#include "depthai-shared/common/Colormap.hpp"
#include "depthai-shared/common/FrameEvent.hpp"
#include "depthai-shared/common/Interpolation.hpp"

// depthai
#include "depthai/common/CameraFeatures.hpp"
#include "depthai/common/CameraExposureOffset.hpp"
#include "depthai/common/StereoPair.hpp"
#include "depthai/utility/ProfilingData.hpp"

void CommonBindings::bind(pybind11::module& m, void* pCallstack){
Expand Down Expand Up @@ -61,6 +63,7 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
py::class_<DetectionParserOptions> detectionParserOptions(m, "DetectionParserOptions", DOC(dai, DetectionParserOptions));
py::class_<RotatedRect> rotatedRect(m, "RotatedRect", DOC(dai, RotatedRect));
py::class_<Rect> rect(m, "Rect", DOC(dai, Rect));
py::class_<StereoPair> stereoPair(m, "StereoPair", DOC(dai, StereoPair));
py::enum_<CameraExposureOffset> cameraExposureOffset(m, "CameraExposureOffset");
py::enum_<Colormap> colormap(m, "Colormap", DOC(dai, Colormap));
py::enum_<FrameEvent> frameEvent(m, "FrameEvent", DOC(dai, FrameEvent));
Expand Down Expand Up @@ -108,6 +111,19 @@ void CommonBindings::bind(pybind11::module& m, void* pCallstack){
.def_readwrite("height", &Rect::height)
;

stereoPair
.def(py::init<>())
.def_readwrite("left", &StereoPair::left)
.def_readwrite("right", &StereoPair::right)
.def_readwrite("baseline", &StereoPair::baseline)
.def_readwrite("isVertical", &StereoPair::isVertical)
.def("__repr__", [](StereoPair& stereoPair) {
std::stringstream stream;
stream << stereoPair;
return stream.str();
})
;

timestamp
.def(py::init<>())
.def_readwrite("sec", &Timestamp::sec)
Expand Down

0 comments on commit 72b0b72

Please sign in to comment.