From 765e5e8de2a0d462397f6a00f747e85c301dae74 Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Sat, 31 Oct 2020 15:42:27 +0200 Subject: [PATCH 1/8] Update depthai-core: fix_recreate_device_loop --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index e3e5aeca7..56ddc626e 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit e3e5aeca7b015376f79669f9d7b766249b4d85ae +Subproject commit 56ddc626e264d95803458cf1e88a68603ba03c5e From f4bdeba70fab7317eb6d3a0001a83f5dc6a228c8 Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Mon, 2 Nov 2020 21:28:57 +0100 Subject: [PATCH 2/8] Added 3.9 python, CI fixes --- .github/workflows/main.yml | 18 ++++++++++-------- CMakeLists.txt | 7 +++++-- depthai-core | 2 +- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 65fc41468..9f5ab679a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,8 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-architecture: [x64, x86] steps: - name: Cache .hunter folder uses: actions/cache@v2 @@ -32,9 +33,10 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.python-architecture }} - name: Append build hash if not a tagged commit if: startsWith(github.ref, 'refs/tags/v') != true - run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}' + run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV - name: Install dependencies run: | python -m pip install --upgrade pip @@ -51,7 +53,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - name: Cache .hunter folder uses: actions/cache@v2 @@ -67,14 +69,14 @@ jobs: python-version: ${{ matrix.python-version }} - name: Append build hash if not a tagged commit if: startsWith(github.ref, 'refs/tags/v') != true - run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}' + run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV - name: Install dependencies run: | python -m pip install --upgrade pip brew install libusb python -m pip install delocate - name: Set macos deployment target - run: echo '::set-env name=MACOSX_DEPLOYMENT_TARGET::10.9' + run: echo "MACOSX_DEPLOYMENT_TARGET=10.9" >> $GITHUB_ENV - name: Building wheels run: python -m pip wheel . -w ./wheelhouse/ - name: Auditing wheels @@ -111,10 +113,10 @@ jobs: run: mkdir -p wheelhouse/audited/ - name: Append build hash if not a tagged commit if: startsWith(github.ref, 'refs/tags/v') != true - run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}' + run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV - name: Building a source distribution run: | - /opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar,zip + /opt/python/cp38-cp38/bin/python3.8 setup.py sdist --formats=gztar mv dist/* wheelhouse/audited/ - name: Building wheels run: for PYBIN in /opt/python/cp3*/bin; do "${PYBIN}/pip" wheel . -w ./wheelhouse/; done @@ -141,7 +143,7 @@ jobs: submodules: 'recursive' - name: Append build hash if not a tagged commit if: startsWith(github.ref, 'refs/tags/v') != true - run: echo '::set-env name=BUILD_COMMIT_HASH::${{github.sha}}' + run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV - name: Building wheel run: python3 -m pip wheel . -w ./wheelhouse/ - name: Auditing wheel diff --git a/CMakeLists.txt b/CMakeLists.txt index 38379f64f..9147c392b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,10 +53,13 @@ target_link_libraries(${TARGET_NAME} # Add bindings revision target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_BINDINGS_REVISION="${PROJECT_VERSION}") -# Add commit hash, default to "dev" -if(NOT DEPTHAI_PYTHON_COMMIT_HASH) + +# Add default commit hash (dev) if not build by CI +if(NOT DEFINED ENV{CI} AND NOT DEPTHAI_PYTHON_COMMIT_HASH) set(DEPTHAI_PYTHON_COMMIT_HASH dev) endif() + +# Add compile definition for bindings if(DEPTHAI_PYTHON_COMMIT_HASH) target_compile_definitions(${TARGET_NAME} PRIVATE DEPTHAI_PYTHON_COMMIT_HASH="${DEPTHAI_PYTHON_COMMIT_HASH}") endif() diff --git a/depthai-core b/depthai-core index 56ddc626e..2c9da502a 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 56ddc626e264d95803458cf1e88a68603ba03c5e +Subproject commit 2c9da502aff27f9271875a349abef6f7d1684d1d From 3f45415080c919557f96b505eb4a54e6d836a003 Mon Sep 17 00:00:00 2001 From: TheMarpe Date: Mon, 2 Nov 2020 22:05:12 +0100 Subject: [PATCH 3/8] Windows environment variable set --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f5ab679a..defb6394b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: architecture: ${{ matrix.python-architecture }} - name: Append build hash if not a tagged commit if: startsWith(github.ref, 'refs/tags/v') != true - run: echo "BUILD_COMMIT_HASH=${{github.sha}}" >> $GITHUB_ENV + run: echo "BUILD_COMMIT_HASH=${{github.sha}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Install dependencies run: | python -m pip install --upgrade pip From 763c63b987e8ea24657b3994b218bc4ccd441696 Mon Sep 17 00:00:00 2001 From: SzabolcsGergely Date: Wed, 4 Nov 2020 07:01:49 +0200 Subject: [PATCH 4/8] Remove EOL python3.5 wheels --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index defb6394b..b4ae9e071 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9] python-architecture: [x64, x86] steps: - name: Cache .hunter folder @@ -53,7 +53,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - name: Cache .hunter folder uses: actions/cache@v2 From fac49836bb238e56eee5f2ad1a407ee8421e3476 Mon Sep 17 00:00:00 2001 From: Sachin Guruswamy <43363595+saching13@users.noreply.github.com> Date: Thu, 5 Nov 2020 19:55:53 -0800 Subject: [PATCH 5/8] Fetching USB speed and Myriad X serial number (#56) * updated for usb fetch wip * updated wrapper to write usb speed * modified hunter config in depthai-core for build fix * updating submodule linking * added is_usb3() check function * updated for usb fetch wip * added is_usb3() check function * updated device commit id * linked to the upadted depthai core and added api to get myriad x serial id * update depthai-core * linking updated depthai-core in usb-testing * added eeprom loaded check * added destructor to python not tested * changing link to depthai-core * updated link to depthai-core * linking to the updated depthai-core with multi device xlink support * updated device side config on depthai-core * updated linking to depthai-core * updated link to xlink * updated link to xlink * updated link to xlink * updated link to xlink * added print statement on calibration file path to verify with mx id * updated depthai-core link * added device change check on swapping devices for testing * added api to check cameras connection * added api to write to eeprom and fetch existing pipeline * renamed api to write_eeprom_data * changed xlink path * added wrapper for xlinkConnect to make it threadsafe in depthai-shared * updated device side commit id and xlinkwrapper * removed text.txt * updated depthai-core Co-authored-by: alex-luxonis --- depthai-core | 2 +- src/device_bindings.cpp | 69 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 69 insertions(+), 2 deletions(-) diff --git a/depthai-core b/depthai-core index 2c9da502a..a6950b42b 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 2c9da502aff27f9271875a349abef6f7d1684d1d +Subproject commit a6950b42be0b087919c413484b6552893b45c6a0 diff --git a/src/device_bindings.cpp b/src/device_bindings.cpp index a76530545..307f2fc87 100644 --- a/src/device_bindings.cpp +++ b/src/device_bindings.cpp @@ -124,9 +124,76 @@ void init_binding_device(pybind11::module& m){ "Returns a vector defining how much the right camera is translated w.r.t left camera." ) + .def( + "is_usb3", + &Device::is_usb3, + "Return true if connected over usb3 or else false." + ) + + .def( + "get_mx_id", + &Device::get_mx_id, + "Return the Myraid X serial number of the device." + ) + + .def( + "is_eeprom_loaded", + &Device::is_eeprom_loaded, + "Return true if EEPROM has both intrinsic matrixes." + ) + .def( + "is_device_changed", + &Device::is_device_changed, + "Return true if device is swapped while running over watchdog thread." + ) + + .def( + "reset_device_changed", + &Device::reset_device_changed, + "Sets device_changed var to false to detect the next swap while running over watchdog thread." + ) + + .def( + "is_rgb_connected", + &Device::is_rgb_connected, + "Returns true if RGB camera is connected." + ) + + .def( + "is_left_connected", + &Device::is_left_connected, + "Returns true if left stereo camera is connected." + ) - ; + .def( + "is_right_connected", + &Device::is_right_connected, + "Returns true if right stereo camera is connected." + ) + .def( + "write_eeprom_data", + [](Device& device, py::dict config) + { + // str(dict) for string representation uses ['] , but JSON requires ["] + // fast & dirty solution: + std::string str = py::str(config); + boost::replace_all(str, "\'", "\""); + boost::replace_all(str, "None", "null"); + boost::replace_all(str, "True", "true"); + boost::replace_all(str, "False", "false"); + // TODO: make better json serialization + + return device.write_eeprom_data(str); + }, + "Takes board config and calibration data as input and writes to eeprom", + py::arg("config") = py::dict() + ) + .def( + "get_pipeline", + &Device::get_pipeline, + "Returns shared ptr of CNNHostPipeline created using cerate_pipeline." + ); py::enum_(m, "AutofocusMode") From cd9672d8a8eb48811889241a131a655caa2aeee7 Mon Sep 17 00:00:00 2001 From: alex-luxonis Date: Mon, 23 Nov 2020 19:29:54 +0200 Subject: [PATCH 6/8] Update depthai-core: rgb_fixes --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index a6950b42b..2a3897993 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit a6950b42be0b087919c413484b6552893b45c6a0 +Subproject commit 2a3897993334a251a8737a11bcc1fe24ae8edac3 From c5edf0834a0108fa78efb3069d29f4cf4b32b4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pi=C5=82atowski?= Date: Wed, 25 Nov 2020 13:09:38 +0100 Subject: [PATCH 7/8] Bump version 0.4.0 --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index 2a3897993..329c501af 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 2a3897993334a251a8737a11bcc1fe24ae8edac3 +Subproject commit 329c501afad6ab7f32d4921840659e1b7a4c9f30 From 7cc0ed2d4d894885990941fb824507ccd0390f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pi=C5=82atowski?= Date: Wed, 2 Dec 2020 14:10:16 +0100 Subject: [PATCH 8/8] bump depthai-core --- depthai-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depthai-core b/depthai-core index 329c501af..96e2dc4a4 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 329c501afad6ab7f32d4921840659e1b7a4c9f30 +Subproject commit 96e2dc4a40dc608707a383cb398c8b86b4842294