diff --git a/depthai-core b/depthai-core index bab310c73..eaa9a1232 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit bab310c7386b4fa1814daf775d5f0be3d6adbc2e +Subproject commit eaa9a1232190ae232bff85864897c9f837e02d35 diff --git a/docs/source/components/pipeline.rst b/docs/source/components/pipeline.rst index 2aadc2c3d..2e1390c97 100644 --- a/docs/source/components/pipeline.rst +++ b/docs/source/components/pipeline.rst @@ -43,7 +43,7 @@ The reason behind this is that OpenVINO doesn't provide version inside the blob. pipeline = depthai.Pipeline() # Set the correct version: - pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2020_1) + pipeline.setOpenVINOVersion(depthai.OpenVINO.Version.VERSION_2021_4) How to place it ############### diff --git a/examples/imu_rotation_vector.py b/examples/imu_rotation_vector.py index 61f20292b..63563fae6 100755 --- a/examples/imu_rotation_vector.py +++ b/examples/imu_rotation_vector.py @@ -53,7 +53,7 @@ def timeDeltaToMilliS(delta) -> float: print(f"Rotation vector timestamp: {tsF.format(timeDeltaToMilliS(rvTs))} ms") print(f"Quaternion: i: {imuF.format(rVvalues.i)} j: {imuF.format(rVvalues.j)} " f"k: {imuF.format(rVvalues.k)} real: {imuF.format(rVvalues.real)}") - print(f"Accuracy (rad): {imuF.format(rVvalues.accuracy)}") + print(f"Accuracy (rad): {imuF.format(rVvalues.rotationVectorAccuracy)}") if cv2.waitKey(1) == ord('q'): diff --git a/src/DatatypeBindings.cpp b/src/DatatypeBindings.cpp index c939b8f3b..a0ac63aa8 100644 --- a/src/DatatypeBindings.cpp +++ b/src/DatatypeBindings.cpp @@ -80,6 +80,16 @@ void DatatypeBindings::bind(pybind11::module& m){ o.ts.nsec = (ts - o.ts.sec) * 1000000000.0; } ) + .def_property("tsDevice", + [](const RawImgFrame& o){ + double ts = o.tsDevice.sec + o.tsDevice.nsec / 1000000000.0; + return ts; + }, + [](RawImgFrame& o, double ts){ + o.tsDevice.sec = ts; + o.tsDevice.nsec = (ts - o.tsDevice.sec) * 1000000000.0; + } + ) ; py::enum_(rawImgFrame, "Type") @@ -304,11 +314,11 @@ void DatatypeBindings::bind(pybind11::module& m){ .def_readwrite("timestamp", &IMUReport::timestamp) ; - py::enum_(imureport, "IMUReportAccuracy") - .value("UNRELIABLE", IMUReport::IMUReportAccuracy::UNRELIABLE) - .value("LOW", IMUReport::IMUReportAccuracy::LOW) - .value("MEDIUM", IMUReport::IMUReportAccuracy::MEDIUM) - .value("HIGH", IMUReport::IMUReportAccuracy::HIGH) + py::enum_(imureport, "Accuracy") + .value("UNRELIABLE", IMUReport::Accuracy::UNRELIABLE) + .value("LOW", IMUReport::Accuracy::LOW) + .value("MEDIUM", IMUReport::Accuracy::MEDIUM) + .value("HIGH", IMUReport::Accuracy::HIGH) ; py::class_>(m, "IMUReportAccelerometer", DOC(dai, IMUReportAccelerometer)) @@ -338,7 +348,7 @@ void DatatypeBindings::bind(pybind11::module& m){ .def_readwrite("j", &IMUReportRotationVectorWAcc::j) .def_readwrite("k", &IMUReportRotationVectorWAcc::k) .def_readwrite("real", &IMUReportRotationVectorWAcc::real) - .def_readwrite("accuracy", &IMUReportRotationVectorWAcc::accuracy) + .def_readwrite("rotationVectorAccuracy", &IMUReportRotationVectorWAcc::rotationVectorAccuracy) ; #if 0 @@ -521,6 +531,7 @@ void DatatypeBindings::bind(pybind11::module& m){ .def(py::init<>()) // getters .def("getTimestamp", &ImgFrame::getTimestamp, DOC(dai, ImgFrame, getTimestamp)) + .def("getTimestampDevice", &ImgFrame::getTimestampDevice, DOC(dai, ImgFrame, getTimestampDevice)) .def("getInstanceNum", &ImgFrame::getInstanceNum, DOC(dai, ImgFrame, getInstanceNum)) .def("getCategory", &ImgFrame::getCategory, DOC(dai, ImgFrame, getCategory)) .def("getSequenceNum", &ImgFrame::getSequenceNum, DOC(dai, ImgFrame, getSequenceNum)) diff --git a/src/openvino/OpenVINOBindings.cpp b/src/openvino/OpenVINOBindings.cpp index 6ad3346ac..eca2a0b04 100644 --- a/src/openvino/OpenVINOBindings.cpp +++ b/src/openvino/OpenVINOBindings.cpp @@ -19,19 +19,18 @@ void OpenVINOBindings::bind(pybind11::module& m){ ; // not strongly typed enum OpenVINO::Version - // previous step defined class 'OpenVINO' (variable 'openvino') + // previous step defined class 'OpenVINO' (variable 'openvino') // which is used in defining the following enum (its scope) - // and that the values are available directly under OpenVINO.VERSION_2020_1, ... + // and that the values are available directly under OpenVINO.VERSION_2021_4, ... // they are exported - // By default, pybind creates strong typed enums, eg: OpenVINO::Version::VERSION_2020_1 + // By default, pybind creates strong typed enums, eg: OpenVINO::Version::VERSION_2021_4 py::enum_(openvino, "Version", DOC(dai, OpenVINO, Version)) - .value("VERSION_2020_1", OpenVINO::Version::VERSION_2020_1) - .value("VERSION_2020_2", OpenVINO::Version::VERSION_2020_2) .value("VERSION_2020_3", OpenVINO::Version::VERSION_2020_3) .value("VERSION_2020_4", OpenVINO::Version::VERSION_2020_4) .value("VERSION_2021_1", OpenVINO::Version::VERSION_2021_1) .value("VERSION_2021_2", OpenVINO::Version::VERSION_2021_2) .value("VERSION_2021_3", OpenVINO::Version::VERSION_2021_3) + .value("VERSION_2021_4", OpenVINO::Version::VERSION_2021_4) .export_values() ;